Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4458317pxt; Wed, 11 Aug 2021 06:35:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzePegswyM7rld8MnFovd2KLq8vzL9jAGvZEpPa2GW4oazWpwn3P/rN/LT+fr5B2rAyAuvP X-Received: by 2002:a05:6402:13cf:: with SMTP id a15mr11357074edx.117.1628688949430; Wed, 11 Aug 2021 06:35:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628688949; cv=none; d=google.com; s=arc-20160816; b=HbnlRhmsoIqOIpoFEj+y2dBobvxTHCDz8w1VS3gw1EpK8EkrVrsH8YCHGpm7GnzqRF PCum3PV99FFDzGXUP0Tl0f5b3vT25PnSkPJfQZa/MHY/ds1PTIPnO2+Rn2uCrTql6jtS sOfElv3GmRQfPgC5Gt7gq2Qy5AU4oR+ieNrdi/VE1bnOyskuPJbQwautezPEiYvjsAt5 MOHLtHGpsKE9oRUx4X6BWrdoiRRVTS86mJVpWLa1ma1ssrfnMweoMxP81GSjrIIfljHx PxpNPP5jB1nHyLPi56+jeL0YNtRa+AAi9b3M0fjdcZV4bU2wfnF9RIyeITtrD1GGGZfj fBLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Z/i7uQ6NKzurDPa7kL9kranXmn5doyAE8sAhZqvAspI=; b=ZAgDEwxgdOTgXm9/0IxeNm12xQo6LFzBuieB+0/6Ho51LmjKGCDJV7/zLpblFA776r 9jzo6KeddhYsQKI06H5XBOZBPL1CWMXqMLyOD04oKKFWkiwGzV4k1wKb+oYDvCtU+ccK GwjezvNEnBud1DgY0bNVilZT1tChzPqf7t0PCe4n2EklAT6YIar5wz1mGt0f0yul5W16 rC4Q53aFhrYUpPKzi0S6kaVwljGU+mrBD+SMPTkuuJ5EwsYk5pRvjw+evThUSMHlrPi+ 2EzWnAnUcd/5fyPObfIK9hGy82N75MP4/XADC/dSOIvBOz4VIy4nEuGykTXMdmRg1AVf DCig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=coUue+pP; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ar26si4231987ejc.725.2021.08.11.06.35.14; Wed, 11 Aug 2021 06:35:49 -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; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=coUue+pP; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230487AbhHKNb4 (ORCPT + 99 others); Wed, 11 Aug 2021 09:31:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbhHKNb4 (ORCPT ); Wed, 11 Aug 2021 09:31:56 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF053C061765 for ; Wed, 11 Aug 2021 06:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Z/i7uQ6NKzurDPa7kL9kranXmn5doyAE8sAhZqvAspI=; b=coUue+pPIg0Yq4CHnDyn+K7Al Kho/NHvDSf05QcdOdTXMnJW3EbccdgpHkjtjFVREEiv0NPbmTUHb/gh/7lqL0ZuAkWhh1X3Ft4mK5 WmIlbFl2nO4EXVyk0dsILamKbJYbNYuDTeGKh+c0UQvNiM/N+CUzNFlvuJT/YuUuHl0Ks36PEF26l fKKEMrAYKYlhIK+/Xvv2o0pT+c1oQZ54gUmwJcrDlkcAbwMNJerZPZKYbYdUI1jmsTgwQVN93eOTi N4+QyNilC3uAwbC8ANiwkGAL5qnLC29Xv8pOpqEoptyRuPiHU9/+qd4sXkhq23xGgEdnsSsY29zXV pUzcFF6GA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:47182) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mDoKJ-0000Z6-1p; Wed, 11 Aug 2021 14:31:23 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1mDoKI-0003Bu-QI; Wed, 11 Aug 2021 14:31:22 +0100 Date: Wed, 11 Aug 2021 14:31:22 +0100 From: "Russell King (Oracle)" To: Tang Bin Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ARM/smp_twd: Cleanup the unnecessary cast Message-ID: <20210811133121.GV22278@shell.armlinux.org.uk> References: <20210811131512.940-1-tangbin@cmss.chinamobile.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210811131512.940-1-tangbin@cmss.chinamobile.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!