Received: from eggs.gnu.org ([2001:4830:134:3::10]:44036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aB4zs-00013M-Kt for qemu-devel@nongnu.org; Mon, 21 Dec 2015 13:15:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aB4zp-00086O-FA for qemu-devel@nongnu.org; Mon, 21 Dec 2015 13:15:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aB4zp-00085l-Ad for qemu-devel@nongnu.org; Mon, 21 Dec 2015 13:15:45 -0500 Date: Mon, 21 Dec 2015 23:45:38 +0530 (IST) From: P J P In-Reply-To: <1450696004-47043-2-git-send-email-yanmiaobest@gmail.com> Message-ID: References: <1450696004-47043-1-git-send-email-yanmiaobest@gmail.com> <1450696004-47043-2-git-send-email-yanmiaobest@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [Qemu-devel] [PATCH 1/3] net/vmxnet3: return 1 on device activation failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Miao Yan Cc: dmitry@daynix.com, jasowang@redhat.com, qemu-devel@nongnu.org +-- On Mon, 21 Dec 2015, Miao Yan wrote --+ | So return 1 on device activation failure instead of -1; | | Signed-off-by: Miao Yan | --- | hw/net/vmxnet3.c | 2 +- | 1 file changed, 1 insertion(+), 1 deletion(-) | | diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c | index e168285..9185408 100644 | --- a/hw/net/vmxnet3.c | +++ b/hw/net/vmxnet3.c | @@ -1652,7 +1652,7 @@ static uint64_t vmxnet3_get_command_status(VMXNET3State *s) | | switch (s->last_command) { | case VMXNET3_CMD_ACTIVATE_DEV: | - ret = (s->device_active) ? 0 : -1; | + ret = (s->device_active) ? 0 : 1; | VMW_CFPRN("Device active: %" PRIx64, ret); | break; It seems okay. Considering that the function returns 'uint64_t', -1 would become an extremely large value. I wonder if that is intended. If '1' indicates the error, the 'default:' case in the same switch needs to be updated too. default: VMW_WRPRN("Received request for unknown command: %x", s->last_command); ret = -1; break; Why does the function return 'uint64_t' type? All return values from other cases seem to be within uint32_t type. -- Prasad J Pandit / Red Hat Product Security Team 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F