* [PATCH -next] mfd: altera-sysmgr: Use resource_size function on resource object
@ 2020-11-14 9:24 Zou Wei
2020-11-27 7:40 ` Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Zou Wei @ 2020-11-14 9:24 UTC (permalink / raw)
To: thor.thayer, lee.jones; +Cc: linux-kernel, Zou Wei
./drivers/mfd/altera-sysmgr.c:155:36-39: WARNING: Suspicious code. resource_size is maybe missing with res
Generated by: scripts/coccinelle/api/resource_size.cocci
Signed-off-by: Zou Wei <zou_wei@huawei.com>
---
drivers/mfd/altera-sysmgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/altera-sysmgr.c b/drivers/mfd/altera-sysmgr.c
index 41076d1..193a96c 100644
--- a/drivers/mfd/altera-sysmgr.c
+++ b/drivers/mfd/altera-sysmgr.c
@@ -152,7 +152,7 @@ static int sysmgr_probe(struct platform_device *pdev)
if (!base)
return -ENOMEM;
- sysmgr_config.max_register = res->end - res->start - 3;
+ sysmgr_config.max_register = resource_size(res) - 3;
regmap = devm_regmap_init_mmio(dev, base, &sysmgr_config);
}
--
2.6.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] mfd: altera-sysmgr: Use resource_size function on resource object
2020-11-14 9:24 [PATCH -next] mfd: altera-sysmgr: Use resource_size function on resource object Zou Wei
@ 2020-11-27 7:40 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2020-11-27 7:40 UTC (permalink / raw)
To: Zou Wei; +Cc: thor.thayer, linux-kernel
On Sat, 14 Nov 2020, Zou Wei wrote:
> ./drivers/mfd/altera-sysmgr.c:155:36-39: WARNING: Suspicious code. resource_size is maybe missing with res
>
> Generated by: scripts/coccinelle/api/resource_size.cocci
>
> Signed-off-by: Zou Wei <zou_wei@huawei.com>
> ---
> drivers/mfd/altera-sysmgr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-27 7:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-14 9:24 [PATCH -next] mfd: altera-sysmgr: Use resource_size function on resource object Zou Wei
2020-11-27 7:40 ` Lee Jones
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).