Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-18 Thread Thomas Huth
On 18/11/2019 10.25, Markus Armbruster wrote: > Philippe Mathieu-Daudé writes: > > [...] >> The related question is, is it OK to use size_t to iterate over an array? >> >> for (size_t i = 0; i < ARRAY_SIZE(array); i++) { >> ... >> } > > My rule of thumb on integer types is "whatever lets

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-18 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: [...] > The related question is, is it OK to use size_t to iterate over an array? > > for (size_t i = 0; i < ARRAY_SIZE(array); i++) { > ... > } My rule of thumb on integer types is "whatever lets me avoid not-obviously-safe conversions (implicit ones in pa

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Philippe Mathieu-Daudé
On 11/15/19 5:13 PM, Thomas Huth wrote: On 15/11/2019 17.13, Paolo Bonzini wrote: On 15/11/19 16:54, Thomas Huth wrote: On 15/11/2019 16.54, Peter Maydell wrote: On Fri, 15 Nov 2019 at 15:10, Thomas Huth wrote: When CONFIG_IDE_ISA is disabled, compilation currently fails: hw/i386/pc_piix

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Philippe Mathieu-Daudé
On 11/15/19 5:12 PM, Thomas Huth wrote: On 15/11/2019 17.15, Peter Maydell wrote: On Fri, 15 Nov 2019 at 16:08, Thomas Huth wrote: On 15/11/2019 16.54, Peter Maydell wrote: On Fri, 15 Nov 2019 at 15:10, Thomas Huth wrote: --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -78,7 +78,6 @@ st

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Thomas Huth
On 15/11/2019 17.13, Paolo Bonzini wrote: > On 15/11/19 16:54, Thomas Huth wrote: >> On 15/11/2019 16.54, Peter Maydell wrote: >>> On Fri, 15 Nov 2019 at 15:10, Thomas Huth wrote: When CONFIG_IDE_ISA is disabled, compilation currently fails: hw/i386/pc_piix.c: In function ‘pc_

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Thomas Huth
On 15/11/2019 17.15, Peter Maydell wrote: > On Fri, 15 Nov 2019 at 16:08, Thomas Huth wrote: >> >> On 15/11/2019 16.54, Peter Maydell wrote: >>> On Fri, 15 Nov 2019 at 15:10, Thomas Huth wrote: --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -78,7 +78,6 @@ static void pc_init1(M

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Peter Maydell
On Fri, 15 Nov 2019 at 16:08, Thomas Huth wrote: > > On 15/11/2019 16.54, Peter Maydell wrote: > > On Fri, 15 Nov 2019 at 15:10, Thomas Huth wrote: > >> --- a/hw/i386/pc_piix.c > >> +++ b/hw/i386/pc_piix.c > >> @@ -78,7 +78,6 @@ static void pc_init1(MachineState *machine, > >> X86MachineStat

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Paolo Bonzini
On 15/11/19 16:54, Thomas Huth wrote: > On 15/11/2019 16.54, Peter Maydell wrote: >> On Fri, 15 Nov 2019 at 15:10, Thomas Huth wrote: >>> >>> When CONFIG_IDE_ISA is disabled, compilation currently fails: >>> >>> hw/i386/pc_piix.c: In function ‘pc_init1’: >>> hw/i386/pc_piix.c:81:9: error: unused

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Thomas Huth
On 15/11/2019 16.54, Peter Maydell wrote: > On Fri, 15 Nov 2019 at 15:10, Thomas Huth wrote: >> >> When CONFIG_IDE_ISA is disabled, compilation currently fails: >> >> hw/i386/pc_piix.c: In function ‘pc_init1’: >> hw/i386/pc_piix.c:81:9: error: unused variable ‘i’ [-Werror=unused-variable] >> >>

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Peter Maydell
On Fri, 15 Nov 2019 at 15:10, Thomas Huth wrote: > > When CONFIG_IDE_ISA is disabled, compilation currently fails: > > hw/i386/pc_piix.c: In function ‘pc_init1’: > hw/i386/pc_piix.c:81:9: error: unused variable ‘i’ [-Werror=unused-variable] > > Move the variable declaration to the right code blo

Re: [PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Michael S. Tsirkin
On Fri, Nov 15, 2019 at 03:50:49PM +0100, Thomas Huth wrote: > When CONFIG_IDE_ISA is disabled, compilation currently fails: > > hw/i386/pc_piix.c: In function ‘pc_init1’: > hw/i386/pc_piix.c:81:9: error: unused variable ‘i’ [-Werror=unused-variable] > > Move the variable declaration to the rig

[PATCH for-4.2] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled

2019-11-15 Thread Thomas Huth
When CONFIG_IDE_ISA is disabled, compilation currently fails: hw/i386/pc_piix.c: In function ‘pc_init1’: hw/i386/pc_piix.c:81:9: error: unused variable ‘i’ [-Werror=unused-variable] Move the variable declaration to the right code block to avoid this problem. Fixes: 4501d317b50e ("hw/i386/pc: E