Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1649324ybj; Wed, 6 May 2020 02:38:46 -0700 (PDT) X-Google-Smtp-Source: APiQypJ+Rc0iV/Zcv16dwfM4jaZ3IbmsWzVyOr0LHewioevXXrlGlm71EkHZ7QHBpxWA0w9jTPy7 X-Received: by 2002:a50:f78c:: with SMTP id h12mr5695505edn.207.1588757926365; Wed, 06 May 2020 02:38:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588757926; cv=none; d=google.com; s=arc-20160816; b=CRmNxv4lRFf6IxabK8yQmpSw4XX/JA4cmMacbjcXOLXHMNbTZKhlplrBuHzN05xy4P 4swqNfYFioGkS7CiEE5kU78JiWUu2FplJ91Mw6KRcJ5KN7nMfR8s16TaePukGYi/6sP6 csguYTb4zh/UdD/zbsdj7ZLf38iOaMJghCx5+BkA4tf9YiROvtsMiL/76TaE9o207Z+K qBc6oFmY0n+wL+IECwZCzdLw2r7Oo6Dw0N7+VLcgYfftV8UFFb3i7Tg90lxElMboqtHj eKohf11YXd8tJHdHmZji9ncMmRmzDYHTeDwj0f6mGYmW5fY383ILTU+s4mpinnodZRLu kIBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=eZS0tYqlIXLHfDD7lfKyJkmbbd+r3R73ZxFYo9pIlpM=; b=06JCwtmJ8RuyIt6NT2CKCZLso9V29cthFfi5+EokTjAAPb5aiVP4dKcBQQ2KFhwBPI 2UeSxNwKsonoyahk+P3GoX+b0OA5OqBiIvvnNLmaGJreZw64bUH1mcWt3/erRcQ/1nTp h1htcu5VxZi/Prce4oSQkWjDtPJsENNKx22OwkwhQIWv5KQOnnbTajd6VG2kvrNpb1hu cQWi2WXaJVCoK8hx2Fj+b+EHOSI9B5I441vhbBACfOuZdy14ntHxPxJH7l/kNqgkqsQo /hg/UPosS90W28qZQHWWElF7HlXjc1vbYmH+UZ3CBsfR5XFrXTh1O/Z/CUvUi8qLBOn5 IOtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce9si811628ejc.139.2020.05.06.02.38.23; Wed, 06 May 2020 02:38:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729089AbgEFJgs (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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