Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-30 Thread Stefan Hajnoczi
On Wed, May 30, 2012 at 3:26 AM, Anthony Liguori aligu...@us.ibm.com wrote: 3) It's not how the rest of QEMU is written.  Consistency is the most important purpose of Coding Style. (3) is the most important consideration of all. Fair enough if its a style choice and you want QEMU to be

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-30 Thread Peter Maydell
On 30 May 2012 08:33, Stefan Hajnoczi stefa...@gmail.com wrote: I'd love to use them because they keep variables and the code that uses them together - great for checking that correct types are being used during code review and also less noise in the patch. Just open a new scope with { and

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-30 Thread Stefan Hajnoczi
On Wed, May 30, 2012 at 8:34 AM, Peter Maydell peter.mayd...@linaro.org wrote: On 30 May 2012 08:33, Stefan Hajnoczi stefa...@gmail.com wrote: I'd love to use them because they keep variables and the code that uses them together - great for checking that correct types are being used during

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-30 Thread Kevin Wolf
Am 30.05.2012 09:33, schrieb Stefan Hajnoczi: On Wed, May 30, 2012 at 3:26 AM, Anthony Liguori aligu...@us.ibm.com wrote: 3) It's not how the rest of QEMU is written. Consistency is the most important purpose of Coding Style. (3) is the most important consideration of all. Fair enough if

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-29 Thread Anthony Liguori
On 05/28/2012 08:39 PM, Stefan Hajnoczi wrote: On Wed, May 23, 2012 at 5:03 PM, Stefan Weils...@weilnetz.de wrote: Am 23.05.2012 17:32, schrieb Kevin Wolf: Maybe, but I already had patches rejected because of that style. Did this policy change? I'd appreciate that! Agreed, people have been

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-28 Thread Stefan Hajnoczi
On Wed, May 23, 2012 at 5:03 PM, Stefan Weil s...@weilnetz.de wrote: Am 23.05.2012 17:32, schrieb Kevin Wolf: Am 23.05.2012 17:29, schrieb Stefan Weil: Am 23.05.2012 10:09, schrieb Stefan Hajnoczi: On Tue, May 22, 2012 at 10:23 PM, Stefan Weils...@weilnetz.de   wrote: The local variables

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-28 Thread Daniel P. Berrange
On Mon, May 28, 2012 at 01:39:58PM +0100, Stefan Hajnoczi wrote: On Wed, May 23, 2012 at 5:03 PM, Stefan Weil s...@weilnetz.de wrote: Am 23.05.2012 17:32, schrieb Kevin Wolf: Am 23.05.2012 17:29, schrieb Stefan Weil: Am 23.05.2012 10:09, schrieb Stefan Hajnoczi: On Tue, May 22, 2012

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-28 Thread Peter Maydell
On 28 May 2012 13:39, Stefan Hajnoczi stefa...@gmail.com wrote: Agreed, people have been asked to declare variables at the beginning of the scope.  I don't understand why, C99 allows them to be declared anywhere and it usually makes the code more readable IMO (you don't have to jump to the

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-28 Thread Andreas Färber
Am 23.05.2012 10:09, schrieb Stefan Hajnoczi: On Tue, May 22, 2012 at 10:23 PM, Stefan Weil s...@weilnetz.de wrote: The local variables ret, i are only used if __linux__ is defined. Signed-off-by: Stefan Weil s...@weilnetz.de --- hw/virtio-blk.c |4 +++- 1 file changed, 3

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-23 Thread Stefan Hajnoczi
On Tue, May 22, 2012 at 10:23 PM, Stefan Weil s...@weilnetz.de wrote: The local variables ret, i are only used if __linux__ is defined. Signed-off-by: Stefan Weil s...@weilnetz.de ---  hw/virtio-blk.c |    4 +++-  1 file changed, 3 insertions(+), 1 deletion(-) The #ifdef __linux__ further

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-23 Thread Stefan Weil
Am 23.05.2012 10:09, schrieb Stefan Hajnoczi: On Tue, May 22, 2012 at 10:23 PM, Stefan Weils...@weilnetz.de wrote: The local variables ret, i are only used if __linux__ is defined. Signed-off-by: Stefan Weils...@weilnetz.de --- hw/virtio-blk.c |4 +++- 1 file changed, 3 insertions(+),

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-23 Thread Kevin Wolf
Am 23.05.2012 17:29, schrieb Stefan Weil: Am 23.05.2012 10:09, schrieb Stefan Hajnoczi: On Tue, May 22, 2012 at 10:23 PM, Stefan Weils...@weilnetz.de wrote: The local variables ret, i are only used if __linux__ is defined. Signed-off-by: Stefan Weils...@weilnetz.de --- hw/virtio-blk.c |

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-23 Thread Stefan Weil
Am 23.05.2012 17:32, schrieb Kevin Wolf: Am 23.05.2012 17:29, schrieb Stefan Weil: Am 23.05.2012 10:09, schrieb Stefan Hajnoczi: On Tue, May 22, 2012 at 10:23 PM, Stefan Weils...@weilnetz.de wrote: The local variables ret, i are only used if __linux__ is defined. Signed-off-by: Stefan

[Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-22 Thread Stefan Weil
The local variables ret, i are only used if __linux__ is defined. Signed-off-by: Stefan Weil s...@weilnetz.de --- hw/virtio-blk.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index f9e1896..60750cb 100644 --- a/hw/virtio-blk.c +++