From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754826AbbHLKlh (ORCPT ); Wed, 12 Aug 2015 06:41:37 -0400 Received: from down.free-electrons.com ([37.187.137.238]:57660 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754434AbbHLKlg (ORCPT ); Wed, 12 Aug 2015 06:41:36 -0400 Date: Wed, 12 Aug 2015 12:41:33 +0200 From: Alexandre Belloni To: Viresh Kumar Cc: trivial@kernel.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Hans Ulli Kroll , "moderated list:BLACKFIN RTC DRIVER" , Alessandro Zummo , "moderated list:ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE" , "open list:REAL TIME CLOCK (RTC) SUBSYSTEM" Subject: Re: [PATCH V1 Resend 06/10] drivers: rtc: Drop (un)likely before IS_ERR(_OR_NULL) Message-ID: <20150812104133.GE3411@piout.net> References: <1a92f2e1af5309ece9736f79f312e90486a98825.1439375087.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1a92f2e1af5309ece9736f79f312e90486a98825.1439375087.git.viresh.kumar@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Viresh, Why are you resending? On 12/08/2015 at 15:59:43 +0530, Viresh Kumar wrote : > IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there > is no need to do that again from its callers. Drop it. > > gemini driver was using likely() for a failure case while the rtc driver > is getting registered. That looks wrong and it should really be > unlikely. But because we are killing all the unlikely() flags, lets kill > that too. > > Acked-by: Hans Ulli Kroll (gemini) > Signed-off-by: Viresh Kumar > --- > drivers/rtc/interface.c | 2 +- > drivers/rtc/rtc-bfin.c | 2 +- > drivers/rtc/rtc-gemini.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c > index 11b639067312..5836751b8203 100644 > --- a/drivers/rtc/interface.c > +++ b/drivers/rtc/interface.c > @@ -564,7 +564,7 @@ enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer) > void rtc_update_irq(struct rtc_device *rtc, > unsigned long num, unsigned long events) > { > - if (unlikely(IS_ERR_OR_NULL(rtc))) > + if (IS_ERR_OR_NULL(rtc)) > return; > > pm_stay_awake(rtc->dev.parent); > diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c > index 3d44b11721ea..535a5f9338d0 100644 > --- a/drivers/rtc/rtc-bfin.c > +++ b/drivers/rtc/rtc-bfin.c > @@ -361,7 +361,7 @@ static int bfin_rtc_probe(struct platform_device *pdev) > /* Register our RTC with the RTC framework */ > rtc->rtc_dev = devm_rtc_device_register(dev, pdev->name, &bfin_rtc_ops, > THIS_MODULE); > - if (unlikely(IS_ERR(rtc->rtc_dev))) > + if (IS_ERR(rtc->rtc_dev)) > return PTR_ERR(rtc->rtc_dev); > > /* Grab the IRQ and init the hardware */ > diff --git a/drivers/rtc/rtc-gemini.c b/drivers/rtc/rtc-gemini.c > index 35f4486738fc..2fed93e1114a 100644 > --- a/drivers/rtc/rtc-gemini.c > +++ b/drivers/rtc/rtc-gemini.c > @@ -148,7 +148,7 @@ static int gemini_rtc_probe(struct platform_device *pdev) > > rtc->rtc_dev = rtc_device_register(pdev->name, dev, > &gemini_rtc_ops, THIS_MODULE); > - if (likely(IS_ERR(rtc->rtc_dev))) > + if (IS_ERR(rtc->rtc_dev)) > return PTR_ERR(rtc->rtc_dev); > > return 0; > -- > 2.4.0 > -- Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com