pci_rom.c: Fix may be used uninitialized warning
PATCH 1/1 pci_rom.c: Fix may be used uninitialized warning
With gcc-5.x we get:drivers/pci/pci_rom.c: In function 'dm_pci_run_vga_bios':drivers/pci/pci_rom.c:352:3: warning: 'ram' may be used uninitialized in this function [-Wmaybe-uninitialized]
While unconvinced that this can happen in practice (if we malloc we set alloced to true, it will be false otherwise), silence the compiler.
--- drivers/pci/pci_rom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci_rom.c +1 -1
@@ -266,7 +266,7 @@ int dm_pci_run_vga_bios(struct udevice *dev, int (*int15_handler)(void), int exec_method) {struct pci_child_platdata *pplat =dev_get_parent_platdata (dev); -struct pci_rom_header *rom, *ram; +struct pci_rom_header *rom, *ram =NULL ;int vesa_mode =-1 ;bool emulate, alloced;int ret;
Signature · 1 line
2.7.0.rc3
PATCH 1/1 pci_rom.c: Fix may be used uninitialized warning
Quoted 5 lines · Tom Rini
With gcc-5.x we get:
drivers/pci/pci_rom.c: In function 'dm_pci_run_vga_bios':drivers/pci/pci_rom.c:352:3: warning: 'ram' may be used uninitialized in this function [-Wmaybe-uninitialized]
Quoted 8 lines
While unconvinced that this can happen in practice (if we malloc we set alloced to true, it will be false otherwise), silence the compiler.
Signed-off-by Tom Rini <[email protected]>--- drivers/pci/pci_rom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 1/1 pci_rom.c: Fix may be used uninitialized warning
Quoted 9 lines · Bin Meng
Quoted 8 lines · Tom Rini
With gcc-5.x we get:
drivers/pci/pci_rom.c: In function 'dm_pci_run_vga_bios':drivers/pci/pci_rom.c:352:3: warning: 'ram' may be used uninitialized in this function [-Wmaybe-uninitialized]While unconvinced that this can happen in practice (if we malloc we set alloced to true, it will be false otherwise), silence the compiler.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Tom Rini <[email protected]>--- drivers/pci/pci_rom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Bin Meng <[email protected]>
Thanks Tom. I did something wrong there...
Quoted 11 lines · Tom Rini
With gcc-5.x we get:
drivers/pci/pci_rom.c: In function 'dm_pci_run_vga_bios':drivers/pci/pci_rom.c:352:3: warning: 'ram' may be used uninitialized in this function [-Wmaybe-uninitialized]While unconvinced that this can happen in practice (if we malloc we set alloced to true, it will be false otherwise), silence the compiler.
Signed-off-by Tom Rini <[email protected]>Reviewed-by Bin Meng <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160119/a1e7c8e6/attachment.sig>