pci: Fix compiler warnings in dm_pciauto_setup_device()
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,
^
Signed-off-by Bin Meng <[email protected]>
---
drivers/pci/pci_auto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci_auto.c +1 -1
@@ -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
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, ^Signed-off-by Bin Meng <[email protected]>---
drivers/pci/pci_auto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Simon Glass <[email protected]>
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
Signed-off-by Bin Meng <[email protected]>---
drivers/pci/pci_auto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Simon Glass <[email protected]>
Applied to u-boot-dm, thanks!