From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXDVa-0002Vw-Pr for qemu-devel@nongnu.org; Wed, 23 May 2012 11:30:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXDVY-0000V7-9V for qemu-devel@nongnu.org; Wed, 23 May 2012 11:29:54 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:35731) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXDVY-0000UV-3q for qemu-devel@nongnu.org; Wed, 23 May 2012 11:29:52 -0400 Message-ID: <4FBD026C.5040304@weilnetz.de> Date: Wed, 23 May 2012 17:29:48 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1337721812-30229-1-git-send-email-sw@weilnetz.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Paolo Bonzini , Anthony Liguori , qemu-devel@nongnu.org Am 23.05.2012 10:09, schrieb Stefan Hajnoczi: > On Tue, May 22, 2012 at 10:23 PM, Stefan Weil wrote: >> The local variables ret, i are only used if __linux__ is defined. >> >> Signed-off-by: Stefan Weil >> --- >> hw/virtio-blk.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) > The #ifdef __linux__ further down in the function declares the local > hdr variable. We could move ret and i down into the #ifdef instead of > adding a new one. I noticed that, but declaring variables anywhere is C++, not C code. hdr violates the QEMU coding rules (other patches which did not declare local variables at the beginning of a block were already rejected). That's why I wrote the patch as it is. Regards, Stefan W.