Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1349079

[PATCH 0/2] lguest: Minor cleanups of boot code

From Paul Bolle <pebolle@tiscali.nl>
Newsgroups linux.kernel
Subject [PATCH 0/2] lguest: Minor cleanups of boot code
Date 2016-03-03 13:10 +0100
Message-ID <r8AeS-6Vw-23@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] lguest: Minor cleanups of boot code Paul Bolle <pebolle@tiscali.nl> - 2016-03-03 13:10 +0100
  [PATCH 1/2] lguest: read length of device_cap later Paul Bolle <pebolle@tiscali.nl> - 2016-03-03 13:10 +0100

csiph-web