staging: fsl-mc: fix resource_size.cocci warnings
authorCihangir Akturk <cakturk@gmail.com>
Wed, 2 Aug 2017 08:18:07 +0000 (11:18 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Aug 2017 22:18:25 +0000 (15:18 -0700)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fsl-mc/bus/dprc-driver.c

index 4cdd190a338b6657ff97318852c642d10915cd06..485abad0f32f3e9df91ed51461c96364da20a727 100644 (file)
@@ -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,