From patchwork Sat Jun 3 06:36:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 770728 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wfrwH5jDYz9s74 for ; Sat, 3 Jun 2017 16:37:03 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750935AbdFCGgy (ORCPT ); Sat, 3 Jun 2017 02:36:54 -0400 Received: from mga04.intel.com ([192.55.52.120]:45643 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750753AbdFCGgx (ORCPT ); Sat, 3 Jun 2017 02:36:53 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jun 2017 23:36:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,287,1493708400"; d="scan'208";a="864139581" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by FMSMGA003.fm.intel.com with ESMTP; 02 Jun 2017 23:36:51 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1dH2jg-000UXh-Qu; Sat, 03 Jun 2017 14:40:32 +0800 Date: Sat, 3 Jun 2017 14:36:42 +0800 From: kbuild test robot To: Paul Burton Cc: kbuild-all@01.org, netdev@vger.kernel.org, Tobias Klauser , "David S . Miller" , Jarod Wilson , linux-mips@linux-mips.org, Eric Dumazet , Paul Burton Subject: [PATCH] net: pch_gbe: fix err_cast.cocci warnings Message-ID: <20170603063642.GA10389@lkp-wsm-ep2> References: <201706031442.vYKOKOkq%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170602234042.22782-5-paul.burton@imgtec.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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2587:9-16: WARNING: ERR_CAST can be used with gpio Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) Generated by: scripts/coccinelle/api/err_cast.cocci CC: Paul Burton Signed-off-by: Fengguang Wu --- pch_gbe_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c @@ -2584,7 +2584,7 @@ pch_gbe_get_priv(struct pci_dev *pdev, c if (!IS_ERR(gpio)) pdata->phy_reset_gpio = gpio; else if (PTR_ERR(gpio) != -ENOENT) - return ERR_PTR(PTR_ERR(gpio)); + return ERR_CAST(gpio); return pdata; }