From: kbuild test robot Date: Fri, 31 Jul 2015 09:31:04 +0000 (+0530) Subject: rtc: gemini: fix ptr_ret.cocci warnings X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=202cc98acf96de1c3897194e1ed5ae1c80c8b0f3;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git rtc: gemini: fix ptr_ret.cocci warnings drivers/rtc/rtc-gemini.c:151:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Fengguang Wu Signed-off-by: Viresh Kumar Signed-off-by: Alexandre Belloni --- diff --git a/drivers/rtc/rtc-gemini.c b/drivers/rtc/rtc-gemini.c index 2fed93e1114a..e84184647d15 100644 --- a/drivers/rtc/rtc-gemini.c +++ b/drivers/rtc/rtc-gemini.c @@ -148,10 +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 (IS_ERR(rtc->rtc_dev)) - return PTR_ERR(rtc->rtc_dev); - - return 0; + return PTR_ERR_OR_ZERO(rtc->rtc_dev); } static int gemini_rtc_remove(struct platform_device *pdev)