Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp587123ybe; Thu, 5 Sep 2019 02:43:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/OOlIs7rZyPt4a55Djo8d0FAHXdRtk+UQRC2gtr0pchoUg3NtyweT8YwzAg2qhKimW1WU X-Received: by 2002:a63:7b4d:: with SMTP id k13mr2287461pgn.182.1567676636498; Thu, 05 Sep 2019 02:43:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567676636; cv=none; d=google.com; s=arc-20160816; b=0yXgzVGIxBc0JvKvQ2JaxPPFrZGSi8yNMyT+qBgLu2IHfGSmTuiO4JeYzRxXcdLm/v rA8Go3Lq7ppOgEkD1sLE3k4wcSXDbAs+smoQIbombfYsDzTXjDgKDeyYHUTgYnxR+KDr CYZvAsEcfvriZ5s7RU8NEcuihLIyVEdyP+uAMQ2oDrH29z3L1hunM3VYDigeb7y3OjqJ Rs31mrOd0U392APj9Z8sMPshtn5/DH17RCEqhDFD4KCy2RSI9bh02GbKyG1JV9rI/hJt O0hyl5RRKNnQ3P68QINEjG45Sl+Hv4U7bojODGmnyvLg2PJ2rMtAjLDlB28o3gYtz+GP hk6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=7Duma6Pa6x5ASENWws4Q5A6TwshdZp+muJVmYaqr4eI=; b=ihEKTTQ7V/khjRKLXZsR+2552J2PeD8nAqFdS6Iz4+rqJR5W9Ty9nVUPeuIFy3XLyC FHJu4NEG0TgQ+zsAuAq9Oo9/WZKQRHc1yF0nRWka8HQK/Qqt3YtZJfYgP3uxwEt8eHx8 2b74jWvjHzvUp4GCw1QynvHiNVgUlCjHK9YVFI92WAgRv4QBtXomVIY08Pu1M2J7JrmU 0VXx4uLbUrcE1U+fFmbXjvK34Ep22JHSbVmVY4XsdOJ8vUbDRZt+vOk+irBn+JKBUqiZ punh3uc+ndf9IASbLkWb6kRpUoVuJHblQWzHAVJqb//CGUcfMnfhIhLhbAwZY+qnvaWP U0dw== 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 o4si1555126pll.194.2019.09.05.02.43.41; Thu, 05 Sep 2019 02:43:56 -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 S1732513AbfIEITE (ORCPT + 99 others); Thu, 5 Sep 2019 04:19:04 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:46340 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726175AbfIEITE (ORCPT ); Thu, 5 Sep 2019 04:19:04 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B3E1C515E8C09A72F1EA; Thu, 5 Sep 2019 16:18:59 +0800 (CST) Received: from [127.0.0.1] (10.177.29.68) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Thu, 5 Sep 2019 16:18:54 +0800 Message-ID: <5D70C4EC.4090501@huawei.com> Date: Thu, 5 Sep 2019 16:18:52 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Alexandre Belloni CC: , , , , , , , , , , Subject: Re: [PATCH 4/4] rtc: ds1347: Use PTR_ERR_OR_ZERO rather than its implementation References: <1567665795-5901-1-git-send-email-zhongjiang@huawei.com> <1567665795-5901-5-git-send-email-zhongjiang@huawei.com> <20190905073943.GA21254@piout.net> In-Reply-To: <20190905073943.GA21254@piout.net> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/9/5 15:39, Alexandre Belloni wrote: > 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. Anyway, Thanks, Sincerely, zhong jiang >> 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 >>