All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Fabio Estevam <festevam@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	alsa-devel@alsa-project.org
Subject: Re: [PATCH 2/3] ASoC: davinci-mcasp: Use 'snd_pcm_format_t' type
Date: Wed, 9 May 2018 17:34:12 +0900	[thread overview]
Message-ID: <20180509083412.GT13402@sirena.org.uk> (raw)
In-Reply-To: <1525621665-11022-2-git-send-email-festevam@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1222 bytes --]

On Sun, May 06, 2018 at 12:47:44PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> 'snd_pcm_format_t' type is better suited for iterating through the
> SNDRV_PCM_FORMAT members.
> 
> Also, use SNDRV_PCM_FORMAT_FIRST for the first element.

Adding Peter.

> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---
>  sound/soc/davinci/davinci-mcasp.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
> index 03ba218..bde2252 100644
> --- a/sound/soc/davinci/davinci-mcasp.c
> +++ b/sound/soc/davinci/davinci-mcasp.c
> @@ -1214,11 +1214,12 @@ static int davinci_mcasp_hw_rule_format(struct snd_pcm_hw_params *params,
>  	struct snd_mask nfmt;
>  	int rate = params_rate(params);
>  	int slots = rd->mcasp->tdm_slots;
> -	int i, count = 0;
> +	snd_pcm_format_t i;
> +	int count = 0;
>  
>  	snd_mask_none(&nfmt);
>  
> -	for (i = 0; i <= SNDRV_PCM_FORMAT_LAST; i++) {
> +	for (i = SNDRV_PCM_FORMAT_FIRST; i <= SNDRV_PCM_FORMAT_LAST; i++) {
>  		if (snd_mask_test(fmt, i)) {
>  			uint sbits = snd_pcm_format_width(i);
>  			int ppm;
> -- 
> 2.7.4
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  parent reply	other threads:[~2018-05-09 16:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-06 15:47 [PATCH 1/3] ASoC: pcm_native: Use 'snd_pcm_format_t' type Fabio Estevam
2018-05-06 15:47 ` [PATCH 2/3] ASoC: davinci-mcasp: " Fabio Estevam
2018-05-06 20:30   ` kbuild test robot
2018-05-09  8:34   ` Mark Brown [this message]
2018-05-09 14:14     ` Fabio Estevam
2018-05-09 20:49   ` Peter Ujfalusi
2018-05-06 15:47 ` [PATCH 3/3] ASoC: omap-pcm: " Fabio Estevam
2018-05-09  8:33   ` Mark Brown
2018-05-06 20:05 ` [PATCH 1/3] ASoC: pcm_native: " kbuild test robot
2018-05-09 17:42 ` Takashi Sakamoto

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=20180509083412.GT13402@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=fabio.estevam@nxp.com \
    --cc=festevam@gmail.com \
    --cc=peter.ujfalusi@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.