Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp498515ybe; Thu, 5 Sep 2019 01:01:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+USGZGVzgamdp/aOrl7J6V+Afyx7pSx344HWCB43eWET8K1Pf2XGAb69MCdkIFGn09K6x X-Received: by 2002:a63:6d8d:: with SMTP id i135mr1952056pgc.303.1567670484608; Thu, 05 Sep 2019 01:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567670484; cv=none; d=google.com; s=arc-20160816; b=TXnEFPwd0PRBYm301RVp0nwuE7ssz+rtXmRbWJlVzdgFCkYnxLR8l5FcVM2Vd6ppPz 1C4pSmt5Lelm4zE21H/eaetyCNqtOC6Q5T009q5VZdLH01S3J8LrQ8BydqiVLS65jLZL A9icgZSJ2A5WYW4eq0RLlOnDLP2n0ve3ufJmuw2AzXs2NBGpZ5ZQ2320Oa0OvfaNGdoh h9SnrKFBmJvc0cuNr4q58y45EAgNruOWlT32yfDaa4w0to7KD5t622uUPAjVSRm+R0gH FO+kwcbEJVgENol+IsahiQ1VPUZyfXEHtqiGR+kaxiH+NpqXW9/zRK2mIKw8Ye/jXHEt gb6A== 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; bh=jntxVDHSaTY7Od69KUUlpYnL/um4lZ+mSJvb2Xfa34Y=; b=rWEq6gDETnG6OXFLizJHabKPl2RtZVqUZioStdq8BRN9qc7MonBn51HEtcflpgNh9U tVZ9+DVmatZH/XjQmlU7nj9L954fIW1W2cCNOyrHW4+mEm907u6FL7HTOzFBI3PmV5yE ut54mUKatPfmO8Mll7XpJ6zLLOJZ71k7cqLflxr4BhyTXi+XSL0yCPLyb7vtVxYokegL OiIEEzWIOEnFaiQPfu+sNf9rXZjHLxvIRsr8guCTRrpFSFlM46tly1Wq6cPxyRIB0BnS lxcUPUt0L51eBFuZ9iQm6CAVOPh3JVc3GFpe1ymlkKAutF0HbZx3fa+0SzHSfX762cc0 JS5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n14si1405122pjj.56.2019.09.05.01.01.07; Thu, 05 Sep 2019 01:01:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732175AbfIEHjv (ORCPT + 99 others); Thu, 5 Sep 2019 03:39:51 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:36847 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731162AbfIEHjv (ORCPT ); Thu, 5 Sep 2019 03:39:51 -0400 Received: from localhost (aclermont-ferrand-651-1-259-53.w86-207.abo.wanadoo.fr [86.207.98.53]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 30611100016; Thu, 5 Sep 2019 07:39:46 +0000 (UTC) Date: Thu, 5 Sep 2019 09:39:43 +0200 From: Alexandre Belloni To: zhong jiang Cc: tony@atomide.com, udeep.dutt@intel.com, ashutosh.dixit@intel.com, gregkh@linuxfoundation.org, kishon@ti.com, jonathanh@nvidia.com, a.zummo@towertech.it, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, arnd@arndb.de, lorenzo.pieralisi@arm.com Subject: Re: [PATCH 4/4] rtc: ds1347: Use PTR_ERR_OR_ZERO rather than its implementation Message-ID: <20190905073943.GA21254@piout.net> References: <1567665795-5901-1-git-send-email-zhongjiang@huawei.com> <1567665795-5901-5-git-send-email-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1567665795-5901-5-git-send-email-zhongjiang@huawei.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/09/2019 14:43:15+0800, zhong jiang wrote: > PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. It is better to > use it directly. hence just replace it. > Unless you have a more significant contribution to this driver, I'm not going to apply this patch, especially since it will have to be reverted as soon as the probe function changes. > Signed-off-by: zhong jiang > --- > drivers/rtc/rtc-ds1347.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/rtc/rtc-ds1347.c b/drivers/rtc/rtc-ds1347.c > index d392a7b..5a64eea 100644 > --- a/drivers/rtc/rtc-ds1347.c > +++ b/drivers/rtc/rtc-ds1347.c > @@ -151,10 +151,7 @@ static int ds1347_probe(struct spi_device *spi) > rtc = devm_rtc_device_register(&spi->dev, "ds1347", > &ds1347_rtc_ops, THIS_MODULE); > > - if (IS_ERR(rtc)) > - return PTR_ERR(rtc); > - > - return 0; > + return PTR_ERR_OR_ZERO(rtc); > } > > static struct spi_driver ds1347_driver = { > -- > 1.7.12.4 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com