Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751358AbdCQO7x (ORCPT ); Fri, 17 Mar 2017 10:59:53 -0400 Received: from mga06.intel.com ([134.134.136.31]:26096 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751271AbdCQO6q (ORCPT ); Fri, 17 Mar 2017 10:58:46 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,177,1486454400"; d="scan'208";a="945462691" Date: Fri, 17 Mar 2017 22:48:09 +0800 From: kbuild test robot To: Olimpiu Dejeu Cc: kbuild-all@01.org, robh@kernel.org, lee.jones@linaro.org, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, jingoohan1@gmail.com, bdodge@arcticsand.com, joe@perches.com, medasaro@arcticsand.com, daniel.thompson@linaro.org, Olimpiu Dejeu Subject: [PATCH] fix ptr_ret.cocci warnings Message-ID: <20170317144809.GA103304@lkp-hsx03.lkp.intel.com> References: <201703172233.osJjGFrP%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1489607133-7870-3-git-send-email-olimpiu@arcticsand.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 783 Lines: 28 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)