[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1632642132-79551-1-git-send-email-yang.lee@linux.alibaba.com>
Date: Sun, 26 Sep 2021 15:42:12 +0800
From: Yang Li <yang.lee@...ux.alibaba.com>
To: davem@...emloft.net
Cc: kuba@...nel.org, lars.povlsen@...rochip.com,
Steen.Hegelund@...rochip.com, UNGLinuxDriver@...rochip.com,
netdev@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, Yang Li <yang.lee@...ux.alibaba.com>
Subject: [PATCH] net: sparx5: fix resource_size.cocci warnings
Use resource_size function on resource object
instead of explicit computation.
Clean up coccicheck warning:
./drivers/net/ethernet/microchip/sparx5/sparx5_main.c:237:19-22: ERROR:
Missing resource_size with iores [ idx ]
Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@...ux.alibaba.com>
---
drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
index cbece6e..c6eb0b7 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
@@ -234,8 +234,7 @@ static int sparx5_create_targets(struct sparx5 *sparx5)
}
iomem[idx] = devm_ioremap(sparx5->dev,
iores[idx]->start,
- iores[idx]->end - iores[idx]->start
- + 1);
+ resource_size(iores[idx]));
if (!iomem[idx]) {
dev_err(sparx5->dev, "Unable to get switch registers: %s\n",
iores[idx]->name);
--
1.8.3.1
Powered by blists - more mailing lists