mirror of https://lore.kernel.org/lkml/
 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; 2+ messages in thread
From: Julia Lawall @ 2017-07-20  5:49 UTC (permalink / raw)
  To: laurentiu.tudor
  Cc: devel, arnd, marc.zyngier, roy.pledge, linux-kernel, agraf,
	catalin.horghidan, leoyang.li, bharat.bhushan, linux-arm-kernel,
	Laurentiu Tudor, gregkh, stuyoder

 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] 2+ messages in thread

* [PATCH] staging: fsl-mc: fix resource_size.cocci warnings
@ 2017-08-02  8:18 Cihangir Akturk
  0 siblings, 0 replies; 2+ messages in thread
From: Cihangir Akturk @ 2017-08-02  8:18 UTC (permalink / raw)
  To: stuyoder; +Cc: laurentiu.tudor, gregkh, linux-kernel, devel, Cihangir Akturk

Use resource_size() function on resource objects instead of
explicit computation.

This patch fixes the following coccinelle warning:

drivers/staging/fsl-mc/bus/dprc-driver.c:620:35-38: ERROR: Missing
resource_size with mc_dev -> regions

Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
---
 drivers/staging/fsl-mc/bus/dprc-driver.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c
index 4cdd190..485abad 100644
--- a/drivers/staging/fsl-mc/bus/dprc-driver.c
+++ b/drivers/staging/fsl-mc/bus/dprc-driver.c
@@ -617,8 +617,7 @@ static int dprc_probe(struct fsl_mc_device *mc_dev)
 		if (WARN_ON(mc_dev->obj_desc.region_count == 0))
 			return -EINVAL;
 
-		region_size = mc_dev->regions[0].end -
-			      mc_dev->regions[0].start + 1;
+		region_size = resource_size(mc_dev->regions);
 
 		error = fsl_create_mc_io(&mc_dev->dev,
 					 mc_dev->regions[0].start,
-- 
2.7.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-02  8:18 UTC | newest]

Thread overview: 2+ messages (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
2017-08-02  8:18 Cihangir Akturk

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

all inboxes | Powered by JetHome®