Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1554439ybi; Sat, 25 May 2019 04:43:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqztgQSCt8+26iRmWDSUVVuwgwWM34Pp6SFhRCBM0/8LHl9jmlexzd4O6xJaOBoM0wV8ifTc X-Received: by 2002:a17:90a:b111:: with SMTP id z17mr15736232pjq.58.1558784619359; Sat, 25 May 2019 04:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558784619; cv=none; d=google.com; s=arc-20160816; b=wkij1wCwl7X2OVxnuznRfQQxxr3VM9h4yT2mCnYrC983Y3bRod9vL3SbwpoTIHENJH JreLA3C0B4uSxKVNp75QX5tFrq9yMeg3KUkDMdDLCNlKD/1SPoQ1wItJocz5vTigTOVg vs3Zrg+gAxqxk7R49vi3KUnBIXLMOEHjQZB/7knggKbKKp+XnvmdgvMu1HpMy0gw+TdF cZY4DN8jFKUC1ywRHHu58XGgLCjr1Dpe+VzX3cbBPtdegJMo9EbqtS7Nv8yM6Glaml3E rkfkX9UkV3Bs259tniKpQu7P7eocKi9s0PNhwJshcKjJKGEzzt3LVBwhYFdsmOOHxpo3 lEUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ILqQaYu5jFI+pKwIZfubTTi0bHH9J0kRVlpJFNgKVz0=; b=x3ZjfEf9zN5kuQM3lYzUQUBytk71iYX9AtDLVP95iazkPCkzKCuIidVgH3nrEDaXBu Tl7lBVc4cPW9is+5YWkUtJn2KOGzyj6Us7jRAx4c2WFqp9rbPorpWB9JJB3RqJ1h+9J9 y2huaLJR/QO1k/fjMCpysaKNdF5L0eAprZFKh/X3nqbshFiOLNFTvkl2fKV5kGVyRA1a L7UqgBIXmZ8a4sQhYuA6GmvD/CSwOT78S96DKSAxDbhjV7VD2x9pkg4qCJg6yw6UlXWx D6evp9BNuBN/vtFW+at6cTgfQnTspE/XUyTalbs+qT97W2jkVNr7ksmKHvvMHhoYA/TA SEYQ== 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 r19si8489028pfr.231.2019.05.25.04.43.23; Sat, 25 May 2019 04:43:39 -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 S1726791AbfEYLk5 (ORCPT + 99 others); Sat, 25 May 2019 07:40:57 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:44247 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726585AbfEYLk5 (ORCPT ); Sat, 25 May 2019 07:40:57 -0400 Received: from localhost (lfbn-1-3034-80.w90-66.abo.wanadoo.fr [90.66.53.80]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 6D48A20000C; Sat, 25 May 2019 11:40:52 +0000 (UTC) Date: Sat, 25 May 2019 13:40:52 +0200 From: Alexandre Belloni To: Hariprasad Kelam Cc: Alessandro Zummo , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rtc: ds1347: fix warning PTR_ERR_OR_ZERO can be used Message-ID: <20190525114052.GI3274@piout.net> References: <20190525095322.GA26245@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190525095322.GA26245@hari-Inspiron-1545> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 25/05/2019 15:23:22+0530, Hariprasad Kelam wrote: > fix below warning reported by coccicheck > > ./drivers/rtc/rtc-ds1347.c:158:1-3: WARNING: PTR_ERR_OR_ZERO can be used > Could you elaborate on what is the exact improvement? > Signed-off-by: Hariprasad Kelam > --- > 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 938512c..b97b67f 100644 > --- a/drivers/rtc/rtc-ds1347.c > +++ b/drivers/rtc/rtc-ds1347.c > @@ -155,10 +155,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 = { > -- > 2.7.4 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com