Browse Source

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>
Vasyl Gomonovych 8 years ago
parent
commit
263a7c57db
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/mfd/kempld-core.c

+ 1 - 1
drivers/mfd/kempld-core.c

@@ -458,7 +458,7 @@ static int kempld_probe(struct platform_device *pdev)
 		return -EINVAL;
 		return -EINVAL;
 
 
 	pld->io_base = devm_ioport_map(dev, ioport->start,
 	pld->io_base = devm_ioport_map(dev, ioport->start,
-					ioport->end - ioport->start);
+					resource_size(ioport));
 	if (!pld->io_base)
 	if (!pld->io_base)
 		return -ENOMEM;
 		return -ENOMEM;