public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] lguest: Minor cleanups of boot code
@ 2016-03-03 12:01 Paul Bolle
  2016-03-03 12:01 ` [PATCH 1/2] lguest: read length of device_cap later Paul Bolle
  2016-03-03 12:01 ` [PATCH 2/2] lguest: read offset " Paul Bolle
  0 siblings, 2 replies; 5+ messages in thread
From: Paul Bolle @ 2016-03-03 12:01 UTC (permalink / raw)
  To: Rusty Russell, Thomas Gleixner, Ingo Molnar, H. Peter Anvin
  Cc: x86, lguest, linux-kernel

Building arch/x86/lguest/boot.o triggers two warnings:
    arch/x86/lguest/boot.c: In function 'early_put_chars':
    arch/x86/lguest/boot.c:1300:5: warning: 'device_len' may be used uninitialized in this function [-Wmaybe-uninitialized]
      if (device_len < (offsetof(struct virtio_console_config, emerg_wr)
         ^
    arch/x86/lguest/boot.c:1238:6: note: 'device_len' was declared here
      u32 device_len;
          ^
    arch/x86/lguest/boot.c:1306:21: warning: 'device_offset' may be used uninitialized in this function [-Wmaybe-uninitialized]
      console_cfg_offset = device_offset;
                         ^
    arch/x86/lguest/boot.c:1237:6: note: 'device_offset' was declared here
      u32 device_offset;
          ^

These annoy me for some time now. So I investigated whether
probe_pci_console(), which actually triggers these warnings, could be
reorganized to make these warnings go away. (Because I really dislike to
initialize variables to some default value just to shut up the compiler.)

I came up with this short series. It makes, I think, the code clearer for the
people reading it. And as a bonus the compiler is silent now.

Paul Bolle (2):
  lguest: read length of device_cap later
  lguest: read offset of device_cap later

 arch/x86/lguest/boot.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

-- 
2.4.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-10  9:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-03 12:01 [PATCH 0/2] lguest: Minor cleanups of boot code Paul Bolle
2016-03-03 12:01 ` [PATCH 1/2] lguest: read length of device_cap later Paul Bolle
2016-06-10  9:42   ` [tip:x86/cleanups] lguest: Read " tip-bot for Paul Bolle
2016-03-03 12:01 ` [PATCH 2/2] lguest: read offset " Paul Bolle
2016-06-10  9:43   ` [tip:x86/cleanups] lguest: Read " tip-bot for Paul Bolle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox