mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cihangir Akturk <cakturk@gmail.com>
To: stuyoder@gmail.com
Cc: laurentiu.tudor@nxp.com, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	Cihangir Akturk <cakturk@gmail.com>
Subject: [PATCH] staging: fsl-mc: fix resource_size.cocci warnings
Date: Wed,  2 Aug 2017 11:18:07 +0300	[thread overview]
Message-ID: <1501661887-4169-1-git-send-email-cakturk@gmail.com> (raw)

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

             reply	other threads:[~2017-08-02  8:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02  8:18 Cihangir Akturk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-07-20  5:49 Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1501661887-4169-1-git-send-email-cakturk@gmail.com \
    --to=cakturk@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=laurentiu.tudor@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stuyoder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®