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 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 sty

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 wrote: > On 30 May 2012 08:33, Stefan Hajnoczi 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

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 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 close it when you'r

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 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 consistent. I'd love t

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 Weil 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 asked to declare

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 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(-) > >

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 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 definition to chec

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 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

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 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 Weil   wrote: > > The local variables ret,

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 Weil wrote: The local variables ret, i are only used if __linux__ is defined. Signed-off-by: Stefan Weil --- hw/virtio

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 Weil wrote: >>> The local variables ret, i are only used if __linux__ is defined. >>> >>> Signed-off-by: Stefan Weil >>> --- >>> hw/virtio-blk.c |4 +++- >>>

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 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

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 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 declare

[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 --- 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 +++ b/hw/virtio-blk.c @