diff mbox

drivers: jtag: fix resource_size.cocci warnings

Message ID 20170803143544.GA34229@lkp-ib03.lkp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

kernel test robot Aug. 3, 2017, 2:35 p.m. UTC
drivers/jtag/jtag-aspeed.c:724:37-40: ERROR: Missing resource_size with res


 Use resource_size function on resource object
 instead of explicit computation.

Generated by: scripts/coccinelle/api/resource_size.cocci

Fixes: acf0c42bb646 ("drivers: jtag: Add Aspeed SoC 24xx and 25xx families JTAG master driver")
CC: Oleksandr Shamray <oleksandrs@mellanox.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 jtag-aspeed.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Oleksandr Shamray Aug. 3, 2017, 2:48 p.m. UTC | #1
> -----Original Message-----
> From: kbuild test robot [mailto:lkp@intel.com]
> Sent: Thursday, August 3, 2017 5:36 PM
> To: Oleksandr Shamray <oleksandrs@mellanox.com>
> Cc: kbuild-all@01.org; gregkh@linuxfoundation.org; arnd@arndb.de; linux-
> kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> devicetree@vger.kernel.org; openbmc@lists.ozlabs.org; joel@jms.id.au;
> jiri@resnulli.us; tklauser@distanz.ch; linux-serial@vger.kernel.org;
> mec@shout.net; vadimp@maellanox.com; system-sw-low-level <system-sw-
> low-level@mellanox.com>; Oleksandr Shamray <oleksandrs@mellanox.com>;
> Jiri Pirko <jiri@mellanox.com>
> Subject: [PATCH] drivers: jtag: fix resource_size.cocci warnings
> 
> drivers/jtag/jtag-aspeed.c:724:37-40: ERROR: Missing resource_size with res
> 
> 
>  Use resource_size function on resource object  instead of explicit computation.
> 
> Generated by: scripts/coccinelle/api/resource_size.cocci
> 
> Fixes: acf0c42bb646 ("drivers: jtag: Add Aspeed SoC 24xx and 25xx families
> JTAG master driver")
> CC: Oleksandr Shamray <oleksandrs@mellanox.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Acked-by: Oleksandr Shamray <oleksandrs@mellanox.com>

> ---
> 
>  jtag-aspeed.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/jtag/jtag-aspeed.c
> +++ b/drivers/jtag/jtag-aspeed.c
> @@ -721,7 +721,7 @@ int aspeed_jtag_init(struct platform_dev
>  	return 0;
> 
>  out_region:
> -	release_mem_region(res->start, res->end - res->start + 1);
> +	release_mem_region(res->start, resource_size(res));
>  	return err;
>  }
>
diff mbox

Patch

--- a/drivers/jtag/jtag-aspeed.c
+++ b/drivers/jtag/jtag-aspeed.c
@@ -721,7 +721,7 @@  int aspeed_jtag_init(struct platform_dev
 	return 0;
 
 out_region:
-	release_mem_region(res->start, res->end - res->start + 1);
+	release_mem_region(res->start, resource_size(res));
 	return err;
 }