[U-Boot] [PATCH] pci: Fix compiler warnings in dm_pciauto_setup_device()

Bin Meng bmeng.cn at gmail.com
Thu Feb 18 08:14:47 CET 2016


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,
                        ^

Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
---

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

diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
index 88bc416..ee9a854 100644
--- a/drivers/pci/pci_auto.c
+++ b/drivers/pci/pci_auto.c
@@ -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;
 
-- 
1.8.2.1



More information about the U-Boot mailing list