Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1701841 > unrolled thread

[PATCH] staging: fsl-mc: fix resource_size.cocci warnings

Started byCihangir Akturk <cakturk@gmail.com>
First post2017-08-02 10:20 +0200
Last post2017-08-02 10:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging: fsl-mc: fix resource_size.cocci warnings Cihangir Akturk <cakturk@gmail.com> - 2017-08-02 10:20 +0200

#1701841 — [PATCH] staging: fsl-mc: fix resource_size.cocci warnings

FromCihangir Akturk <cakturk@gmail.com>
Date2017-08-02 10:20 +0200
Subject[PATCH] staging: fsl-mc: fix resource_size.cocci warnings
Message-ID<u9X2O-7mD-29@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web