Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757483AbdCUO7d (ORCPT ); Tue, 21 Mar 2017 10:59:33 -0400 Received: from mail-lf0-f52.google.com ([209.85.215.52]:35799 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756464AbdCUO7R (ORCPT ); Tue, 21 Mar 2017 10:59:17 -0400 MIME-Version: 1.0 In-Reply-To: <20170317144809.GA103304@lkp-hsx03.lkp.intel.com> References: <201703172233.osJjGFrP%fengguang.wu@intel.com> <1489607133-7870-3-git-send-email-olimpiu@arcticsand.com> <20170317144809.GA103304@lkp-hsx03.lkp.intel.com> From: Olimpiu Dejeu Date: Tue, 21 Mar 2017 10:58:24 -0400 Message-ID: Subject: Re: [PATCH] fix ptr_ret.cocci warnings To: kbuild test robot , fengguang.wu@intel.com Cc: kbuild-all@01.org, Rob Herring , Lee Jones , linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, jingoohan1@gmail.com, Brian Dodge , joe@perches.com, "Matthew D'Asaro" , Daniel Thompson Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1018 Lines: 31 On Fri, Mar 17, 2017 at 10:48 AM, kbuild test robot wrote: > drivers/video/backlight/arcxcnn_bl.c:183: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 > > CC: Olimpiu Dejeu > Signed-off-by: Fengguang Wu > --- > > arcxcnn_bl.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > --- a/drivers/video/backlight/arcxcnn_bl.c > +++ b/drivers/video/backlight/arcxcnn_bl.c > @@ -180,10 +180,7 @@ static int arcxcnn_backlight_register(st > > lp->bl = devm_backlight_device_register(lp->dev, name, lp->dev, lp, > &arcxcnn_bl_ops, props); > - if (IS_ERR(lp->bl)) > - return PTR_ERR(lp->bl); > - > - return 0; > + return PTR_ERR_OR_ZERO(lp->bl); > } > > static void arcxcnn_parse_dt(struct arcxcnn *lp) Acked-by: Olimpiu Dejeu