]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pci: pci_mvebu, pci_aardvark: Fix size of configuration cache
authorMarek Behún <marek.behun@nic.cz>
Thu, 11 Nov 2021 15:35:44 +0000 (16:35 +0100)
committerStefan Roese <sr@denx.de>
Wed, 15 Dec 2021 07:57:36 +0000 (08:57 +0100)
Since u32 takes up 4 bytes, we need to divide the number of u32s by 4
for cfgcache.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/pci/pci-aardvark.c
drivers/pci/pci_mvebu.c

index 4e94b776c5b9d46a40defac3eb2f42ba7268cbc2..8abbc3ffe84f690cac015cb2619e93b7b441598b 100644 (file)
@@ -202,7 +202,7 @@ struct pcie_advk {
        int                     sec_busno;
        struct udevice          *dev;
        struct gpio_desc        reset_gpio;
-       u32                     cfgcache[0x34 - 0x10];
+       u32                     cfgcache[(0x34 - 0x10) / 4];
        bool                    cfgcrssve;
 };
 
index 14cd82db6ff8cafa3c8f7bd21a09b151f679c47e..2d1624deb2665d51630b9c708d3dcb1374159323 100644 (file)
@@ -88,7 +88,7 @@ struct mvebu_pcie {
        unsigned int mem_attr;
        unsigned int io_target;
        unsigned int io_attr;
-       u32 cfgcache[0x34 - 0x10];
+       u32 cfgcache[(0x34 - 0x10) / 4];
 };
 
 /*