Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: alsa-devel@alsa-project.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Takashi Iwai <tiwai@suse.de>,
	patches@opensource.wolfsonmicro.com,
	kernel-janitors@vger.kernel.org,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [patch] ASoC: wm8994: missing break in wm8994_aif3_hw_params()
Date: Tue, 30 Apr 2013 09:49:34 +0200	[thread overview]
Message-ID: <517F778E.3020700@bfs.de> (raw)
In-Reply-To: <20130430072441.GB7237@elgon.mountain>



Am 30.04.2013 09:24, schrieb Dan Carpenter:
> The missing break here means that we always return early and the
> function is a no-op.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> 
> diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
> index 14094f5..1eb152c 100644
> --- a/sound/soc/codecs/wm8994.c
> +++ b/sound/soc/codecs/wm8994.c
> @@ -2882,6 +2882,7 @@ static int wm8994_aif3_hw_params(struct snd_pcm_substream *substream,
>  		default:
>  			return 0;
>  		}
> +		break;
>  	default:
>  		return 0;
>  	}


the patch seems ok, but i would question the wisdom of a nested switch here,
obviously the readability suffers and since it is only one case it seems
better to be replaced it with

if (dai->id != 3) return 0;

Please can the maintainer comment on that ?

just my 2 cents,
 wh

  reply	other threads:[~2013-04-30  7:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-30  7:24 [patch] ASoC: wm8994: missing break in wm8994_aif3_hw_params() Dan Carpenter
2013-04-30  7:49 ` walter harms [this message]
2013-04-30 18:07   ` Mark Brown
2013-04-30 18:06 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=517F778E.3020700@bfs.de \
    --to=wharms@bfs.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox