From d12edf9661a408d04efc9c0a4ff9a15413195d8a Mon Sep 17 00:00:00 2001 From: Zou Wei Date: Sat, 14 Nov 2020 17:24:20 +0800 Subject: [PATCH] mfd: altera-sysmgr: Use resource_size function on resource object 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 Signed-off-by: Lee Jones --- 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 41076d121dd5..193a96c8b1ea 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); }