Message ID | Y6TM4ZidDExh8SPx@qemulion |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp3259wrn; Thu, 22 Dec 2022 13:38:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXuGF7lQTbb50yNM3XGJ96yiGDv7Djt+QJiGmlUdTPxOWiP6kzzB9ijC6vYBzWNgMywxkhGa X-Received: by 2002:a05:6402:f04:b0:46d:ca42:2e59 with SMTP id i4-20020a0564020f0400b0046dca422e59mr6939964eda.11.1671745138356; Thu, 22 Dec 2022 13:38:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671745138; cv=none; d=google.com; s=arc-20160816; b=dtPL4oUCTwIasVlkHgJYFuzAaIVnoXa9S3hUaWc9+w9xdewKWYrqXn9XLNQpziirtV LhgG1E6ZAfxtUPAKsgYtyXWFdQCExJS3KxTclyqFhVnijR82n/3OeM6FSbtC7GYCLSbb Kqs/ckI+Ddt7Qq2LxinWLx4mZimjG2AhivwalCYLoYrJ0MHgM41CR2ZH7xpzYV7eyf5k xRUU09qtcRNFZf6D4ZzedPoD34JD6sVGzu7k3hY56UUQdBdIEO/wgDoCd8bvXCWMjsCU nAsHYC/pfF1xnPJ2ch5e5PCcxiD4pFcpRB+ih4nOuEacobY9uARj1ldNlF1BTGIgF/XC u6Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=Q8MbiPsXu42L3dRMInjSkxyCQhJEZHcbxl8oYQDU6xA=; b=mFE8mtMQ+P7R7eTdzSZOklh0GEreNPmbz/EdkILj2+XK3tqRxChFZxXfmp6bAkePn1 mor5Dm/AEpYZieBQB1uYiYjsZS/+dvMaC1VXGpGz1bQVSqP73lMmOwlNxl5a6crJUtzS Xc7jHGU2/CCfMmEsqzQL8IBzD9oyG1jApyN7BJNsCUQPa3uTQ2Ga4N8B7lcko1E4KObM WWlKzPqp8Ci7m3FBY2ZVC2dqrzooO02LzkSZpGUZuEjWvF1sDN6y+hWdS20ixGteZLLv FjqxPWIKhRnp5LAevpz0dyExvQBry0M3p3Oa9YcP3SpSc5F2bD/PKNH/xY6/LZxRw8CI RUqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=jo2h4mRh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i15-20020a0564020f0f00b00480e42f3032si390084eda.305.2022.12.22.13.38.33; Thu, 22 Dec 2022 13:38:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=jo2h4mRh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235249AbiLVVcw (ORCPT <rfc822;pacteraone@gmail.com> + 99 others); Thu, 22 Dec 2022 16:32:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbiLVVcu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 22 Dec 2022 16:32:50 -0500 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54D6C220D5 for <linux-kernel@vger.kernel.org>; Thu, 22 Dec 2022 13:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1671744745; bh=m5A13CbMy20Q47cLnzC6Fb6fhQStUuVBXbSnoheidMw=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=jo2h4mRhgABlqJVSOkh+AOYw9YgnQ62n/FQwXqdp57JOm0M48hS8t6NQlWTPPUfm0 SOJLBfq3qg0V28fYH2R+SKutRUdw1NgJSJ4NYRZ7OiePtV2Z4qgryFuk6U4kmed1js k6RF3Y/ONgGqU5KIliHlJEmgC4JWsYl+U4UCTY+k= Received: by b-3.in.mailobj.net [192.168.90.13] with ESMTP via ip-206.mailobj.net [213.182.55.206] Thu, 22 Dec 2022 22:32:25 +0100 (CET) X-EA-Auth: tNs3jUzJmrB1wishT6YQd/hDpbc92I55S2KpqxvBARFKBIIUugaz6hFy61mU3PncJY/3szve5aMOVJKIR1WPju0/Ks6Qpq+y Date: Fri, 23 Dec 2022 03:02:17 +0530 From: Deepak R Varma <drv@mailo.com> To: Yinbo Zhu <zhuyinbo@loongson.cn>, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar <ssengar@microsoft.com>, Praveen Kumar <kumarpraveen@linux.microsoft.com>, drv@mailo.com Subject: [PATCH] soc: loongson: use resource_size() helper function Message-ID: <Y6TM4ZidDExh8SPx@qemulion> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752951830182592626?= X-GMAIL-MSGID: =?utf-8?q?1752951830182592626?= |
Series |
soc: loongson: use resource_size() helper function
|
|
Commit Message
Deepak R Varma
Dec. 22, 2022, 9:32 p.m. UTC
Use the resource_size() function instead of a open coded computation
resource size. It makes the code more readable.
Issue identified using resource_size.cocci coccinelle semantic patch.
Signed-off-by: Deepak R Varma <drv@mailo.com>
---
Note: Proposed change is compile tested only.
drivers/soc/loongson/loongson2_guts.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.34.1
Comments
On Fri, Dec 23, 2022 at 03:02:17AM +0530, Deepak R Varma wrote: > Use the resource_size() function instead of a open coded computation > resource size. It makes the code more readable. > > Issue identified using resource_size.cocci coccinelle semantic patch. > > Signed-off-by: Deepak R Varma <drv@mailo.com> > --- Hello, Requesting a review and feedback on this patch proposal? Thank you, ./drv
On Sun, Jan 08, 2023 at 08:57:48PM +0800, Huacai Chen wrote: > On Sun, Jan 8, 2023 at 4:10 AM Deepak R Varma <drv@mailo.com> wrote: > > > > On Fri, Dec 23, 2022 at 03:02:17AM +0530, Deepak R Varma wrote: > > > Use the resource_size() function instead of a open coded computation > > > resource size. It makes the code more readable. > > > > > > Issue identified using resource_size.cocci coccinelle semantic patch. > > > > > > Signed-off-by: Deepak R Varma <drv@mailo.com> > > > --- > > > > Hello, > > Requesting a review and feedback on this patch proposal? > Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> > But I think this should be merged through soc@kernel.org maintained by Arnd. Thank you Huacai. Appreciate your time. Hello Arnd, Can you please tell me if I need to do anything further to have this merged as suggested by Huacai? Thanks, ./drv > > Huacai > > > > Thank you, > > ./drv > > > > > >
diff --git a/drivers/soc/loongson/loongson2_guts.c b/drivers/soc/loongson/loongson2_guts.c index bace4bc8e03b..aba4f8832805 100644 --- a/drivers/soc/loongson/loongson2_guts.c +++ b/drivers/soc/loongson/loongson2_guts.c @@ -107,7 +107,7 @@ static int loongson2_guts_probe(struct platform_device *pdev) guts->little_endian = of_property_read_bool(np, "little-endian"); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - guts->regs = ioremap(res->start, res->end - res->start + 1); + guts->regs = ioremap(res->start, resource_size(res)); if (IS_ERR(guts->regs)) return PTR_ERR(guts->regs);