lkml.org 
[lkml]   [2016]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/2] lguest: Minor cleanups of boot code
Date
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

\
 
 \ /
  Last update: 2016-03-03 13:41    [W:0.053 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site