* [PATCH] net: sparx5: fix resource_size.cocci warnings
@ 2021-09-26 7:42 Yang Li
2021-09-27 12:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-09-26 7:42 UTC (permalink / raw)
To: davem
Cc: kuba, lars.povlsen, Steen.Hegelund, UNGLinuxDriver, netdev,
linux-arm-kernel, linux-kernel, Yang Li
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@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: sparx5: fix resource_size.cocci warnings
2021-09-26 7:42 [PATCH] net: sparx5: fix resource_size.cocci warnings Yang Li
@ 2021-09-27 12:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-09-27 12:30 UTC (permalink / raw)
To: Yang Li
Cc: davem, kuba, lars.povlsen, Steen.Hegelund, UNGLinuxDriver,
netdev, linux-arm-kernel, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Sun, 26 Sep 2021 15:42:12 +0800 you wrote:
> 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 ]
>
> [...]
Here is the summary with links:
- net: sparx5: fix resource_size.cocci warnings
https://git.kernel.org/netdev/net-next/c/867d1ac99f11
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-27 12:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-26 7:42 [PATCH] net: sparx5: fix resource_size.cocci warnings Yang Li
2021-09-27 12:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).