Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752858AbbGaJbX (ORCPT ); Fri, 31 Jul 2015 05:31:23 -0400 Received: from mail-pd0-f181.google.com ([209.85.192.181]:34468 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751115AbbGaJbU (ORCPT ); Fri, 31 Jul 2015 05:31:20 -0400 From: Viresh Kumar To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, kbuild test robot , Viresh Kumar , Alessandro Zummo , Alexandre Belloni , Hans Ulli Kroll , linux-arm-kernel@lists.infradead.org (moderated list:ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE), rtc-linux@googlegroups.com (open list:REAL TIME CLOCK (RTC) SUBSYSTEM) Subject: [PATCH] drivers: rtc: fix ptr_ret.cocci warnings Date: Fri, 31 Jul 2015 15:01:04 +0530 Message-Id: <20150731091703.GA140615@lkp-ib03> X-Mailer: git-send-email 2.4.0 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1134 Lines: 37 From: kbuild test robot 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 --- Got a cleanup patch from Fengguang, maybe we can apply this too. rtc-gemini.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/rtc/rtc-gemini.c +++ b/drivers/rtc/rtc-gemini.c @@ -148,10 +148,7 @@ static int gemini_rtc_probe(struct platf 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) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/