]> git.sur5r.net Git - u-boot/commitdiff
pci: Fix compiler warnings in dm_pciauto_setup_device()
authorBin Meng <bmeng.cn@gmail.com>
Thu, 18 Feb 2016 07:14:47 +0000 (23:14 -0800)
committerSimon Glass <sjg@chromium.org>
Fri, 26 Feb 2016 15:53:10 +0000 (08:53 -0700)
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@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/pci/pci_auto.c

index 88bc416c61628fd2c44042dbd22dd79eb0480729..ee9a854bda48b89c6b3f99124ac15d6933f503f1 100644 (file)
@@ -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;