From patchwork Mon Oct 26 18:26:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 7491531 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C9B51BEEA4 for ; Mon, 26 Oct 2015 18:27:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0D2EF206B6 for ; Mon, 26 Oct 2015 18:27:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 228872063F for ; Mon, 26 Oct 2015 18:26:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751746AbbJZS06 (ORCPT ); Mon, 26 Oct 2015 14:26:58 -0400 Received: from mga14.intel.com ([192.55.52.115]:13795 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750790AbbJZS06 (ORCPT ); Mon, 26 Oct 2015 14:26:58 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 26 Oct 2015 11:26:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,201,1444719600"; d="scan'208";a="672116433" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga003.jf.intel.com with ESMTP; 26 Oct 2015 11:26:55 -0700 Received: from kbuild by bee with local (Exim 4.83) (envelope-from ) id 1ZqmTj-000HkJ-Cg; Tue, 27 Oct 2015 02:26:43 +0800 Date: Tue, 27 Oct 2015 02:26:11 +0800 From: kbuild test robot To: Bjorn Andersson Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, Lee Jones , Jingoo Han , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , linux-fbdev@vger.kernel.org Subject: [PATCH] backlight: pm8941-wled: fix ptr_ret.cocci warnings Message-ID: <20151026182611.GA14761@roam> References: <201510270209.ZSHdZKp5%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201510270209.ZSHdZKp5%fengguang.wu@intel.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-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/video/backlight/pm8941-wled.c:404: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: Bjorn Andersson Signed-off-by: Fengguang Wu Acked-by: Bjorn Andersson --- pm8941-wled.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/video/backlight/pm8941-wled.c +++ b/drivers/video/backlight/pm8941-wled.c @@ -401,10 +401,7 @@ static int pm8941_wled_probe(struct plat bl = devm_backlight_device_register(&pdev->dev, wled->name, &pdev->dev, wled, &pm8941_wled_ops, &props); - if (IS_ERR(bl)) - return PTR_ERR(bl); - - return 0; + return PTR_ERR_OR_ZERO(bl); }; static const struct of_device_id pm8941_wled_match_table[] = {