rtc: Drop (un)likely before IS_ERR(_OR_NULL)
authorviresh kumar <viresh.kumar@linaro.org>
Fri, 31 Jul 2015 10:53:43 +0000 (16:23 +0530)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sat, 5 Sep 2015 11:19:09 +0000 (13:19 +0200)
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.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Hans Ulli Kroll <ulli.kroll@googlemail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/interface.c
drivers/rtc/rtc-bfin.c
drivers/rtc/rtc-gemini.c

index 11b639067312f8485454cba5f039129044d4db4f..5836751b8203eb576a7af9f049c706ba27ee8d93 100644 (file)
@@ -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);
index 3d44b11721ea03737578dc71657669cbdb195cd5..535a5f9338d026ec8f433fb4960dc7227728ddf6 100644 (file)
@@ -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 */
index 35f4486738fcef0c496a631858ce3961c6c20793..2fed93e1114a6d2cbbd550b1de573df04b0bebc0 100644 (file)
@@ -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;