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=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 C0D2EC28CBC for ; Wed, 6 May 2020 09:36:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5CE72075E for ; Wed, 6 May 2020 09:36:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729081AbgEFJgs (ORCPT ); Wed, 6 May 2020 05:36:48 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:42187 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728640AbgEFJgs (ORCPT ); Wed, 6 May 2020 05:36:48 -0400 Received: from localhost (lfbn-lyo-1-9-35.w86-202.abo.wanadoo.fr [86.202.105.35]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 0C349240028; Wed, 6 May 2020 09:34:41 +0000 (UTC) Date: Wed, 6 May 2020 11:34:41 +0200 From: Alexandre Belloni To: Samuel Zou Cc: a.zummo@towertech.it, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] rtc: pcf8523: Use PTR_ERR_OR_ZERO() to simplify code Message-ID: <20200506093441.GB34497@piout.net> References: <1588757640-39044-1-git-send-email-zou_wei@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1588757640-39044-1-git-send-email-zou_wei@huawei.com> Sender: linux-rtc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org Hi, On 06/05/2020 17:34:00+0800, Samuel Zou wrote: > Fixes coccicheck warning: > > drivers/rtc/rtc-pcf8523.c:361:1-3: WARNING: PTR_ERR_OR_ZERO can be used > I'm not taking this change because it is useless and will have to be revert as soon as the probe function changes (and it will). Does it really simplifies the code? I very much doubt so. > Reported-by: Hulk Robot > Signed-off-by: Samuel Zou > --- > drivers/rtc/rtc-pcf8523.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/rtc/rtc-pcf8523.c b/drivers/rtc/rtc-pcf8523.c > index 47e0f41..da8889a 100644 > --- a/drivers/rtc/rtc-pcf8523.c > +++ b/drivers/rtc/rtc-pcf8523.c > @@ -358,10 +358,8 @@ static int pcf8523_probe(struct i2c_client *client, > > rtc = devm_rtc_device_register(&client->dev, DRIVER_NAME, > &pcf8523_rtc_ops, THIS_MODULE); > - if (IS_ERR(rtc)) > - return PTR_ERR(rtc); > > - return 0; > + return PTR_ERR_OR_ZERO(rtc); > } > > static const struct i2c_device_id pcf8523_id[] = { > -- > 2.6.2 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com