Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754286AbdG3QoI (ORCPT ); Sun, 30 Jul 2017 12:44:08 -0400 Received: from mga04.intel.com ([192.55.52.120]:10853 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754239AbdG3QoH (ORCPT ); Sun, 30 Jul 2017 12:44:07 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,437,1496127600"; d="scan'208";a="133757752" Date: Mon, 31 Jul 2017 00:43:30 +0800 From: kbuild test robot To: codekipper@gmail.com Cc: kbuild-all@01.org, maxime.ripard@free-electrons.com, alsa-devel@alsa-project.org, Marcus Cooper , lgirdwood@gmail.com, linux-kernel@vger.kernel.org, be17068@iperbole.bo.it, linux-sunxi@googlegroups.com, broonie@kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ASoC: sun4i-i2s: fix ptr_ret.cocci warnings Message-ID: <20170730164329.GA26670@intel17.lkp.intel.com> References: <201707310016.RARC8ov7%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170729141753.20174-6-codekipper@gmail.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: 874 Lines: 29 sound/soc/sunxi/sun4i-i2s.c:740: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 Fixes: 298207690de9 ("ASoC: sun4i-i2s: Add regmap fields for channels") CC: Marcus Cooper Signed-off-by: Fengguang Wu --- sun4i-i2s.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -737,10 +737,7 @@ static int sun4i_i2s_init_regmap_fields( i2s->field_rxchansel = devm_regmap_field_alloc(dev, i2s->regmap, i2s->variant->field_rxchansel); - if (IS_ERR(i2s->field_rxchansel)) - return PTR_ERR(i2s->field_rxchansel); - - return 0; + return PTR_ERR_OR_ZERO(i2s->field_rxchansel); } static int sun4i_i2s_probe(struct platform_device *pdev)