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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT 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 7819EC46464 for ; Tue, 14 Aug 2018 16:15:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2CE8921709 for ; Tue, 14 Aug 2018 16:15:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2CE8921709 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732430AbeHNTDd (ORCPT ); Tue, 14 Aug 2018 15:03:33 -0400 Received: from mail.bootlin.com ([62.4.15.54]:32954 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728978AbeHNTDc (ORCPT ); Tue, 14 Aug 2018 15:03:32 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 1A6EA2072C; Tue, 14 Aug 2018 18:15:42 +0200 (CEST) Received: from localhost (unknown [37.168.208.63]) by mail.bootlin.com (Postfix) with ESMTPSA id 901FB203EC; Tue, 14 Aug 2018 18:15:41 +0200 (CEST) Date: Tue, 14 Aug 2018 18:15:41 +0200 From: Alexandre Belloni To: zhong jiang Cc: a.zummo@towertech.it, baruch@tkos.co.il, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] rtc:rtc-digicolor: Use PTR_ERR_OR_ZERO to replace the open code Message-ID: <20180814161541.GP943@piout.net> References: <1534159885-25364-1-git-send-email-zhongjiang@huawei.com> <1534159885-25364-2-git-send-email-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1534159885-25364-2-git-send-email-zhongjiang@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 13/08/2018 19:31:24+0800, zhong jiang wrote: > PTR_ERR_OR_ZERO has implemented the if(IS_ERR(...)) + PTR_ERR, So > just replace them rather than duplicating its implement. > > Signed-off-by: zhong jiang > --- > drivers/rtc/rtc-digicolor.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/rtc/rtc-digicolor.c b/drivers/rtc/rtc-digicolor.c > index b253bf1..fd6850c 100644 > --- a/drivers/rtc/rtc-digicolor.c > +++ b/drivers/rtc/rtc-digicolor.c > @@ -202,10 +202,8 @@ static int __init dc_rtc_probe(struct platform_device *pdev) > platform_set_drvdata(pdev, rtc); > rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, pdev->name, > &dc_rtc_ops, THIS_MODULE); > - if (IS_ERR(rtc->rtc_dev)) > - return PTR_ERR(rtc->rtc_dev); > > - return 0; > + return PTR_ERR_OR_ZERO(rtc->rtc_dev); As many other maintainers, I don't find that kind of change useful and I'm not taking them unless there are other improvements in the driver. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com