Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752088AbcDKEyk (ORCPT ); Mon, 11 Apr 2016 00:54:40 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:49341 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751522AbcDKEyj (ORCPT ); Mon, 11 Apr 2016 00:54:39 -0400 From: Vaishali Thakkar To: emilio@elopez.com.ar Cc: mturquette@baylibre.com, sboyd@codeaurora.org, maxime.ripard@free-electrons.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Vaishali Thakkar Subject: [PATCH] clk: sunxi: Use resource_size Date: Mon, 11 Apr 2016 10:23:03 +0530 Message-Id: <1460350383-7661-1-git-send-email-vaishali.thakkar@oracle.com> X-Mailer: git-send-email 2.1.4 X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 889 Lines: 24 Use the function resource_size instaed of explicit computation. Problem found using Coccinelle. Signed-off-by: Vaishali Thakkar --- drivers/clk/sunxi/clk-sun9i-mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/sunxi/clk-sun9i-mmc.c b/drivers/clk/sunxi/clk-sun9i-mmc.c index 028dd83..7167373 100644 --- a/drivers/clk/sunxi/clk-sun9i-mmc.c +++ b/drivers/clk/sunxi/clk-sun9i-mmc.c @@ -106,7 +106,7 @@ static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev) r = platform_get_resource(pdev, IORESOURCE_MEM, 0); /* one clock/reset pair per word */ - count = DIV_ROUND_UP((r->end - r->start + 1), SUN9I_MMC_WIDTH); + count = DIV_ROUND_UP((resource_size(r)), SUN9I_MMC_WIDTH); data->membase = devm_ioremap_resource(&pdev->dev, r); if (IS_ERR(data->membase)) return PTR_ERR(data->membase); -- 2.1.4