diff mbox

ASoC: fix simple_return.cocci warnings

Message ID 20150428042032.GA178218@athens (mailing list archive)
State Accepted
Commit beb9969b8a644991dbfdaf18b9f1161a39a91df8
Headers show

Commit Message

Fengguang Wu April 28, 2015, 4:20 a.m. UTC
sound/soc/codecs/ssm2518.c:521:5-8: WARNING: end returns can be simpified

 Simplify a trivial if-return sequence.  Possibly combine with a
 preceding function call.
Generated by: scripts/coccinelle/misc/simple_return.cocci

CC: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 ssm2518.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Mark Brown April 30, 2015, 8:21 p.m. UTC | #1
On Tue, Apr 28, 2015 at 12:20:32PM +0800, kbuild test robot wrote:
> sound/soc/codecs/ssm2518.c:521:5-8: WARNING: end returns can be simpified
> 
>  Simplify a trivial if-return sequence.  Possibly combine with a
>  preceding function call.
> Generated by: scripts/coccinelle/misc/simple_return.cocci

Applied, thanks.
Mark Brown April 30, 2015, 8:21 p.m. UTC | #2
On Tue, Apr 28, 2015 at 12:20:32PM +0800, kbuild test robot wrote:
> sound/soc/codecs/ssm2518.c:521:5-8: WARNING: end returns can be simpified
> 
>  Simplify a trivial if-return sequence.  Possibly combine with a
>  preceding function call.
> Generated by: scripts/coccinelle/misc/simple_return.cocci

Oops, sorry - doesn't apply against current code (fat fingered my
initial apply).
diff mbox

Patch

--- a/sound/soc/codecs/ssm2518.c
+++ b/sound/soc/codecs/ssm2518.c
@@ -518,10 +518,7 @@  static int ssm2518_set_bias_level(struct
 		break;
 	}
 
-	if (ret)
-		return ret;
-
-	return 0;
+	return ret;
 }
 
 static int ssm2518_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask,