From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B91EAC3A5A5 for ; Thu, 5 Sep 2019 08:19:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E5CB20870 for ; Thu, 5 Sep 2019 08:19:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730710AbfIEITE (ORCPT ); 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-rtc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rtc@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 >>