Skip to contentSkip to conversation

pci: Fix compiler warnings in dm_pciauto_setup_device()

PATCH New Bin Meng 2 participants 3 messages Feb 18, 2016 – Feb 26, 2016 PCI

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/1 pci: Fix compiler warnings in dm_pciauto_setup_device()

Fix the following compiler warnings when DEBUG is on.

warning: 'bar_res' may be used uninitialized in this function. drivers/pci/pci_auto.c:101:21:
if (!enum_only && pciauto_region_allocate(bar_res, bar_size,

                        ^

---

 drivers/pci/pci_auto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci_auto.c +1 -1
index 88bc416..ee9a854 100644
@@ -30,7 +30,7 @@ void dm_pciauto_setup_device(struct udevice *dev, int bars_num,
 	u8 header_type;
 	int rom_addr;
 	pci_addr_t bar_value;
-	struct pci_region *bar_res;
+	struct pci_region *bar_res = NULL;
 	int found_mem64 = 0;
 	u16 class;
 
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH 1/1 pci: Fix compiler warnings in dm_pciauto_setup_device()

Quoted 4 lines · Bin Meng

Fix the following compiler warnings when DEBUG is on.

warning: 'bar_res' may be used uninitialized in this function. drivers/pci/pci_auto.c:101:21:

Quoted 8 lines
   if (!enum_only && pciauto_region_allocate(bar_res, bar_size,
                        ^

---

 drivers/pci/pci_auto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#2 lore raw

PATCH 1/1 pci: Fix compiler warnings in dm_pciauto_setup_device()

Quoted 8 lines · Simon Glass
Quoted 7 lines · Bin Meng

Fix the following compiler warnings when DEBUG is on.

warning: 'bar_res' may be used uninitialized in this function. drivers/pci/pci_auto.c:101:21:

   if (!enum_only && pciauto_region_allocate(bar_res, bar_size,
                        ^
Quoted 7 lines
Quoted 5 lines

---

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

Applied to u-boot-dm, thanks!