diff mbox

[U-Boot,4/4] pci_rom: fix may be used uninitialized warning

Message ID 1455661771-52559-5-git-send-email-andreas.devel@googlemail.com
State Accepted
Commit ed48899c1173cf0767d85f389650f544ce846006
Delegated to: Tom Rini
Headers show

Commit Message

Andreas Bießmann Feb. 16, 2016, 10:29 p.m. UTC
Building pci_rom.c with my toolchain complains about may be used uninitialized
rom varaible:

---8<---
+drivers/pci/pci_rom.c:269:25: note: 'rom' was declared here
w+drivers/pci/pci_rom.c: In function 'dm_pci_run_vga_bios':
w+drivers/pci/pci_rom.c:154:14: warning: 'rom' may be used uninitialized in this function [-Wmaybe-uninitialized]
--->8---

Fix this as done in 55616b86c745fcac5a791268ab8e7cba36965c0f the ram variable.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
---

 drivers/pci/pci_rom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anatolij Gustschin Feb. 17, 2016, 7:23 a.m. UTC | #1
On Tue, 16 Feb 2016 23:29:31 +0100
Andreas Bießmann andreas.devel@googlemail.com wrote:

> Building pci_rom.c with my toolchain complains about may be used uninitialized
> rom varaible:
> 
> ---8<---
> +drivers/pci/pci_rom.c:269:25: note: 'rom' was declared here
> w+drivers/pci/pci_rom.c: In function 'dm_pci_run_vga_bios':
> w+drivers/pci/pci_rom.c:154:14: warning: 'rom' may be used uninitialized in this function [-Wmaybe-uninitialized]
> --->8---
> 
> Fix this as done in 55616b86c745fcac5a791268ab8e7cba36965c0f the ram variable.
> 
> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>

Acked-by: Anatolij Gustschin <agust@denx.de>
Tom Rini Feb. 25, 2016, 3:24 p.m. UTC | #2
On Tue, Feb 16, 2016 at 11:29:31PM +0100, Andreas Bießmann wrote:

> Building pci_rom.c with my toolchain complains about may be used uninitialized
> rom varaible:
> 

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c
index d5bf6f4..9eb605b 100644
--- a/drivers/pci/pci_rom.c
+++ b/drivers/pci/pci_rom.c
@@ -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 = NULL;
+	struct pci_rom_header *rom = NULL, *ram = NULL;
 	int vesa_mode = -1;
 	bool emulate, alloced;
 	int ret;