From: Julia Lawall Date: Thu, 20 Jul 2017 05:49:35 +0000 (+0200) Subject: staging: fsl-mc: fix resource_size.cocci warnings X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5be271ff96ec1a19c332bbb610662d83aa86799d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: fsl-mc: fix resource_size.cocci warnings 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 Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/fsl-mc/bus/mc-io.c b/drivers/staging/fsl-mc/bus/mc-io.c index 4e6f99a62cf0..f65c23ce83f1 100644 --- 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(struct fsl_mc_device *mc_dev, 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;