Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: Drop (un)likely before IS_ERR(_OR_NULL)

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>

authored by

viresh kumar and committed by
Alexandre Belloni
e7cba884 74000eb1

+3 -3
+1 -1
drivers/rtc/interface.c
··· 564 564 void rtc_update_irq(struct rtc_device *rtc, 565 565 unsigned long num, unsigned long events) 566 566 { 567 - if (unlikely(IS_ERR_OR_NULL(rtc))) 567 + if (IS_ERR_OR_NULL(rtc)) 568 568 return; 569 569 570 570 pm_stay_awake(rtc->dev.parent);
+1 -1
drivers/rtc/rtc-bfin.c
··· 361 361 /* Register our RTC with the RTC framework */ 362 362 rtc->rtc_dev = devm_rtc_device_register(dev, pdev->name, &bfin_rtc_ops, 363 363 THIS_MODULE); 364 - if (unlikely(IS_ERR(rtc->rtc_dev))) 364 + if (IS_ERR(rtc->rtc_dev)) 365 365 return PTR_ERR(rtc->rtc_dev); 366 366 367 367 /* Grab the IRQ and init the hardware */
+1 -1
drivers/rtc/rtc-gemini.c
··· 148 148 149 149 rtc->rtc_dev = rtc_device_register(pdev->name, dev, 150 150 &gemini_rtc_ops, THIS_MODULE); 151 - if (likely(IS_ERR(rtc->rtc_dev))) 151 + if (IS_ERR(rtc->rtc_dev)) 152 152 return PTR_ERR(rtc->rtc_dev); 153 153 154 154 return 0;