]> Git Repo - u-boot.git/commitdiff
pci_rom.c: Fix may be used uninitialized warning
authorTom Rini <[email protected]>
Sat, 16 Jan 2016 14:50:26 +0000 (14:50 +0000)
committerTom Rini <[email protected]>
Tue, 19 Jan 2016 13:31:21 +0000 (08:31 -0500)
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]>
drivers/pci/pci_rom.c

index 8c83be623fddcb7b7c2b27dbde192b3877d75bbd..ed2f61dfc33c67d363679ddf31772034578125a5 100644 (file)
@@ -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;
This page took 0.0352 seconds and 4 git commands to generate.