Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <zou_wei@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Zou Wei and committed by
Lee Jones
d12edf96 14639a22

+1 -1
+1 -1
drivers/mfd/altera-sysmgr.c
··· 152 152 if (!base) 153 153 return -ENOMEM; 154 154 155 - sysmgr_config.max_register = res->end - res->start - 3; 155 + sysmgr_config.max_register = resource_size(res) - 3; 156 156 regmap = devm_regmap_init_mmio(dev, base, &sysmgr_config); 157 157 } 158 158