From: Vasyl Gomonovych <gomonovych@gmail.com>
Date: Mon, 20 Nov 2017 21:02:55 +0000 (+0100)
Subject: mfd: kempld-core: Use resource_size function on resource object
X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=263a7c57db8d59f7fdea39ea525f48d3d42ba697;p=linux.git

mfd: kempld-core: Use resource_size function on resource object

drivers/mfd/kempld-core.c:461:13-16: WARNING: Suspicious code. resource_size is maybe missing with ioport

Generated by: scripts/coccinelle/api/resource_size.cocci

Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---

diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
index 55d824b3a808e..390b27cb2c2e9 100644
--- a/drivers/mfd/kempld-core.c
+++ b/drivers/mfd/kempld-core.c
@@ -458,7 +458,7 @@ static int kempld_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	pld->io_base = devm_ioport_map(dev, ioport->start,
-					ioport->end - ioport->start);
+					resource_size(ioport));
 	if (!pld->io_base)
 		return -ENOMEM;