Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753144AbdGHTxN (ORCPT ); Sat, 8 Jul 2017 15:53:13 -0400 Received: from mga14.intel.com ([192.55.52.115]:59540 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753057AbdGHTxM (ORCPT ); Sat, 8 Jul 2017 15:53:12 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,330,1496127600"; d="scan'208";a="124248649" Date: Sun, 9 Jul 2017 03:52:27 +0800 From: kbuild test robot To: sathyanarayanan.kuppuswamy@linux.intel.com Cc: kbuild-all@01.org, peda@axentia.se, linux-kernel@vger.kernel.org, sathyaosid@gmail.com, Kuppuswamy Sathyanarayanan Subject: [PATCH] mux: fix err_cast.cocci warnings Message-ID: <20170708195227.GA79324@lkp-wsx02> References: <201707090345.hNncIqtF%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 825 Lines: 26 drivers/mux/mux-core.c:491:9-16: WARNING: ERR_CAST can be used with mux_chip Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) Generated by: scripts/coccinelle/api/err_cast.cocci Fixes: 1203d8a531ed ("mux: Add new API to get mux_control ref by device name.") CC: Kuppuswamy Sathyanarayanan Signed-off-by: Fengguang Wu --- mux-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mux/mux-core.c +++ b/drivers/mux/mux-core.c @@ -488,7 +488,7 @@ struct mux_control *mux_control_get_by_i mux_chip = mux_chip_get_by_index(devname, chip_index); if (IS_ERR(mux_chip)) - return ERR_PTR(PTR_ERR(mux_chip)); + return ERR_CAST(mux_chip); if (ctrl_index >= mux_chip->controllers) { dev_err(&mux_chip->dev,