alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Nicolin Chen <b42378@freescale.com>
To: Mark Brown <broonie@kernel.org>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org, lgirdwood@gmail.com
Subject: Re: [PATCH] ASoC: soc-pcm: Only do snd_soc_dai_digital_mute() in hw_free()
Date: Tue, 3 Dec 2013 23:26:06 +0800	[thread overview]
Message-ID: <20131203152606.GD8609@MrMyself> (raw)
In-Reply-To: <20131203150423.GW27568@sirena.org.uk>

On Tue, Dec 03, 2013 at 03:04:23PM +0000, Mark Brown wrote:
> On Tue, Dec 03, 2013 at 05:16:06PM +0800, Nicolin Chen wrote:
> 
> > @@ -689,7 +684,7 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
> >  	struct snd_soc_platform *platform = rtd->platform;
> >  	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
> >  	struct snd_soc_dai *codec_dai = rtd->codec_dai;
> > -	struct snd_soc_codec *codec = rtd->codec;
> > +	bool playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 1 : 0;
> 
> Please don't use the ternery operator, you could've just used the result
> of the comparison directly here.

Oh, a bad habit. Thank you for teaching me this.

> 
> >  	mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);
> >  
> > @@ -707,7 +702,8 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
> >  	}
> >  
> >  	/* apply codec digital mute */
> > -	if (!codec->active)
> > +	if ((playback && codec_dai->playback_active == 1) ||
> > +			(!playback && codec_dai->capture_active == 1))
> >  		snd_soc_dai_digital_mute(codec_dai, 1, substream->stream);
> 
> This is a bit confusing to read due to the strange indentation (the
> second line is massively indented with respect to the first line for
> some reason).  This hunk also ought to be split out as a separate patch
> since it's a bug fix.

I'll refine the indentation and split the patch into two.

Thank you indeed.
Nicolin Chen

      reply	other threads:[~2013-12-03 15:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03  9:16 [PATCH] ASoC: soc-pcm: Only do snd_soc_dai_digital_mute() in hw_free() Nicolin Chen
2013-12-03 15:04 ` Mark Brown
2013-12-03 15:26   ` Nicolin Chen [this message]

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=20131203152606.GD8609@MrMyself \
    --to=b42378@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.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;
as well as URLs for NNTP newsgroup(s).