Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1699572

[PATCH] ASoC: sun4i-i2s: fix ptr_ret.cocci warnings

From kbuild test robot <lkp@intel.com>
Newsgroups linux.kernel
Subject [PATCH] ASoC: sun4i-i2s: fix ptr_ret.cocci warnings
Date 2017-07-30 18:50 +0200
Message-ID <u8ZzI-2LG-15@gated-at.bofh.it> (permalink)
References <u8ZzI-2LG-11@gated-at.bofh.it> <u8AL0-3qk-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <codekipper@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 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)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 00/12] ASoC: Add I2S support for Allwinner H3 SoCs codekipper@gmail.com - 2017-07-29 16:20 +0200
  [PATCH v3 05/12] ASoC: sun4i-i2s: Add regmap fields for channels codekipper@gmail.com - 2017-07-29 16:20 +0200
    Re: [alsa-devel] [PATCH v3 05/12] ASoC: sun4i-i2s: Add regmap fields  for channels kbuild test robot <lkp@intel.com> - 2017-07-30 18:50 +0200
    [PATCH] ASoC: sun4i-i2s: fix ptr_ret.cocci warnings kbuild test robot <lkp@intel.com> - 2017-07-30 18:50 +0200
    Re: [linux-sunxi] [PATCH v3 05/12] ASoC: sun4i-i2s: Add regmap fields  for channels Chen-Yu Tsai <wens@csie.org> - 2017-08-01 10:40 +0200
      Re: [linux-sunxi] [PATCH v3 05/12] ASoC: sun4i-i2s: Add regmap fields  for channels Code Kipper <codekipper@gmail.com> - 2017-08-07 09:50 +0200
  [PATCH v3 03/12] ASoC: sun4i-i2s: Add regmap config to quirks codekipper@gmail.com - 2017-07-29 16:30 +0200
    Re: [linux-sunxi] [PATCH v3 03/12] ASoC: sun4i-i2s: Add regmap config  to quirks Chen-Yu Tsai <wens@csie.org> - 2017-08-01 10:20 +0200
  [PATCH v3 01/12] ASoC: sun4i-i2s: Extend quirks scope codekipper@gmail.com - 2017-07-29 16:30 +0200
    Re: [linux-sunxi] [PATCH v3 01/12] ASoC: sun4i-i2s: Extend quirks scope Chen-Yu Tsai <wens@csie.org> - 2017-08-01 05:00 +0200
    Applied "ASoC: sun4i-i2s: Extend quirks scope" to the asoc tree Mark Brown <broonie@kernel.org> - 2017-08-01 16:20 +0200
  Re: [linux-sunxi] [PATCH v3 00/12] ASoC: Add I2S support for  Allwinner H3 SoCs Olliver Schinagl <oliver+list@schinagl.nl> - 2017-07-31 09:10 +0200
    Re: [linux-sunxi] [PATCH v3 00/12] ASoC: Add I2S support for  Allwinner H3 SoCs Code Kipper <codekipper@gmail.com> - 2017-07-31 16:30 +0200

csiph-web