Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4468465pxt; Wed, 11 Aug 2021 06:50:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmlGuL4PgSVcHPYK+ac22Bd7JitBrRppAvhivDU+ZuQaMY71LeGsdF85rFITD/kscEbjCF X-Received: by 2002:a05:6638:419a:: with SMTP id az26mr5103087jab.70.1628689821759; Wed, 11 Aug 2021 06:50:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628689821; cv=none; d=google.com; s=arc-20160816; b=DdUo2hPF8ZFbOn9v0S8C2eefdMzOS6+uk3FeCvcO1sblDt7x2K98sm+JqYplwrEia8 7sHT3+273WBMmLSJ45YI0WPoY1705HjmmT47gl2smE9Vr+kmOP+vaTNJEOMtab5fyOH4 vSNeUYufsrQtx6tfuzRq1PlGIvy9TsbhuB0bTnLhDchetfCQNON7DWTzHDjXaydd6rLe EElJSmMpC0XH3hSNHZ34SFTkVOp1tqzwFz/Wj+zOFY7x9opMnw96z3IsSO2xKRdga4BQ nIaJOW9dv1VE/mAHoIcLS6AENCm9s/X4J+Gce0C8le74mfwiZfalv5sRGy2koprdv2I9 U17g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=0IR/2bpM9Hkmq3pm0D3moiTGj8nfdVt5WgDVjjhLvgo=; b=IhL1R7QmLzbumHdm1KN5k01l77aWONWi718FG2645E6SBzSiMp63NYrPb49u8jD517 xK8fAdY0oGSGawnkXd8QHktYMOwOhZszjg24XOfXCcBnCVZA6r04uSX7N8/+myUjBxYj 9BIBCbx6SFf+ciLQKucKzeX6nBXuc1IRM002gRiJZgxuFEOYMcA8xNKw/2nrCSPV/WgW MX1+aFmNNPwhY69vXBQFUEGJ/tZc4DdODG7hDmIhf2E1R1Z7d/sgBAVCa9H34sVBRxuV tzAgIU68v4UasxdXJDkqMzDn5QLf/nW6AqaFG8wqY8tysWq2572uK9HM3Hta/2HYhjnD RpiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t7si21849ilf.11.2021.08.11.06.50.10; Wed, 11 Aug 2021 06:50:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231864AbhHKNr5 (ORCPT + 99 others); Wed, 11 Aug 2021 09:47:57 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:64270 "EHLO cmccmta3.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230479AbhHKNr4 (ORCPT ); Wed, 11 Aug 2021 09:47:56 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.3]) by rmmx-syy-dmz-app11-12011 (RichMail) with SMTP id 2eeb6113d4db165-65096; Wed, 11 Aug 2021 21:47:09 +0800 (CST) X-RM-TRANSID: 2eeb6113d4db165-65096 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from [192.168.26.114] (unknown[10.42.68.12]) by rmsmtp-syy-appsvr02-12002 (RichMail) with SMTP id 2ee26113d4dc0dd-43701; Wed, 11 Aug 2021 21:47:09 +0800 (CST) X-RM-TRANSID: 2ee26113d4dc0dd-43701 Subject: Re: [PATCH] ARM/smp_twd: Cleanup the unnecessary cast To: "Russell King (Oracle)" Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20210811131512.940-1-tangbin@cmss.chinamobile.com> <20210811133121.GV22278@shell.armlinux.org.uk> From: tangbin Message-ID: <54505b20-a9c6-9ade-dced-cb4c24df0770@cmss.chinamobile.com> Date: Wed, 11 Aug 2021 21:47:10 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20210811133121.GV22278@shell.armlinux.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Russell: On 2021/8/11 21:31, Russell King (Oracle) wrote: > On Wed, Aug 11, 2021 at 09:15:12PM +0800, Tang Bin wrote: >> It's not necessary to specify 'int' castingfor 'PTR_ERR(twd_clk)'. >> >> Signed-off-by: Tang Bin >> --- >> arch/arm/kernel/smp_twd.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c >> index 9a14f721a..423e9079d 100644 >> --- a/arch/arm/kernel/smp_twd.c >> +++ b/arch/arm/kernel/smp_twd.c >> @@ -199,7 +199,7 @@ static void twd_get_clock(struct device_node *np) >> twd_clk = clk_get_sys("smp_twd", NULL); >> >> if (IS_ERR(twd_clk)) { >> - pr_err("smp_twd: clock not found %d\n", (int) PTR_ERR(twd_clk)); >> + pr_err("smp_twd: clock not found %d\n", PTR_ERR(twd_clk)); > Sorry, NAK. > > This change _will_ produce a compiler warning. "%d" expects an argument > of type "int", but PTR_ERR() returns a type of "long". Sorry, but the > cast is entirely necessary. > > A better solution today would be to get rid of the PTR_ERR() entirely > and use %pe, which will get us a textual description of the error when > the appropriate kernel configuration option is enabled. > Got it, Thanks. >