]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net: stmmac: dwmac-anarion: Use annotation __iomem for register base
authorSimon Horman <horms@kernel.org>
Thu, 6 Apr 2023 17:30:09 +0000 (19:30 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 8 Apr 2023 03:06:04 +0000 (20:06 -0700)
Use __iomem annotation the register base: the ctl_block field of struct
anarion_gmac. I believe this is the normal practice for such variables.

By doing so some casting is avoided.
And sparse no longer reports:

 .../dwmac-anarion.c:29:23: warning: incorrect type in argument 1 (different address spaces)
 .../dwmac-anarion.c:29:23:    expected void const volatile [noderef] __iomem *addr
 .../dwmac-anarion.c:29:23:    got void *
 .../dwmac-anarion.c:34:22: warning: incorrect type in argument 2 (different address spaces)
 .../dwmac-anarion.c:34:22:    expected void volatile [noderef] __iomem *addr
 .../dwmac-anarion.c:34:22:    got void *

No functional change intended.
Compile tested only.

Signed-off-by: Simon Horman <horms@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c

index dfbaea06d10865909bc0351e5682a2c6a638d9e6..2357e77434fbe08c613eb5cbae027b857d409581 100644 (file)
 #define  GMAC_CONFIG_INTF_RGMII                (0x1 << 0)
 
 struct anarion_gmac {
-       uintptr_t ctl_block;
+       void __iomem *ctl_block;
        uint32_t phy_intf_sel;
 };
 
 static uint32_t gmac_read_reg(struct anarion_gmac *gmac, uint8_t reg)
 {
-       return readl((void *)(gmac->ctl_block + reg));
+       return readl(gmac->ctl_block + reg);
 };
 
 static void gmac_write_reg(struct anarion_gmac *gmac, uint8_t reg, uint32_t val)
 {
-       writel(val, (void *)(gmac->ctl_block + reg));
+       writel(val, gmac->ctl_block + reg);
 }
 
 static int anarion_gmac_init(struct platform_device *pdev, void *priv)
@@ -77,7 +77,7 @@ static struct anarion_gmac *anarion_config_dt(struct platform_device *pdev)
        if (!gmac)
                return ERR_PTR(-ENOMEM);
 
-       gmac->ctl_block = (uintptr_t)ctl_block;
+       gmac->ctl_block = ctl_block;
 
        err = of_get_phy_mode(pdev->dev.of_node, &phy_mode);
        if (err)