public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] staging: fsl-mc: fix resource_size.cocci warnings
@ 2017-07-20  5:49 Julia Lawall
  0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2017-07-20  5:49 UTC (permalink / raw)
  To: linux-arm-kernel

 Use resource_size function on resource object
 instead of explicit computation.

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

Fixes: a037b7ec2eb7 ("staging: fsl-mc: allow the driver compile multi-arch")
CC: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

url:
https://github.com/0day-ci/linux/commits/laurentiu-tudor-nxp-com/staging-fsl-mc-make-the-driver-compile-on-other-architectures/20170718-021715
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago


 mc-io.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/staging/fsl-mc/bus/mc-io.c
+++ b/drivers/staging/fsl-mc/bus/mc-io.c
@@ -242,8 +242,7 @@ int __must_check fsl_mc_portal_allocate(
 		goto error_cleanup_resource;

 	mc_portal_phys_addr = dpmcp_dev->regions[0].start;
-	mc_portal_size = dpmcp_dev->regions[0].end -
-			 dpmcp_dev->regions[0].start + 1;
+	mc_portal_size = resource_size(dpmcp_dev->regions);

 	if (WARN_ON(mc_portal_size != mc_bus_dev->mc_io->portal_size))
 		goto error_cleanup_resource;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-20  5:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-20  5:49 [PATCH] staging: fsl-mc: fix resource_size.cocci warnings Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox