Skip to content

Commit

Permalink
mfd: altera-sysmgr: Use resource_size function on resource object
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
  • Loading branch information
SamuelZOU authored and Lee Jones committed Nov 27, 2020
1 parent 14639a2 commit d12edf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mfd/altera-sysmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit d12edf9

Please sign in to comment.