All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: pcm_native: Use 'snd_pcm_format_t' type
@ 2018-05-06 15:47 Fabio Estevam
  2018-05-06 15:47 ` [PATCH 2/3] ASoC: davinci-mcasp: " Fabio Estevam
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Fabio Estevam @ 2018-05-06 15:47 UTC (permalink / raw)
  To: broonie; +Cc: Fabio Estevam, alsa-devel

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.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 sound/core/pcm_native.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 7585444..5d62b7c 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -2051,13 +2051,13 @@ static int snd_pcm_hw_rule_mulkdiv(struct snd_pcm_hw_params *params,
 static int snd_pcm_hw_rule_format(struct snd_pcm_hw_params *params,
 				  struct snd_pcm_hw_rule *rule)
 {
-	unsigned int k;
+	snd_pcm_format_t k;
 	const struct snd_interval *i =
 				hw_param_interval_c(params, rule->deps[0]);
 	struct snd_mask m;
 	struct snd_mask *mask = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
 	snd_mask_any(&m);
-	for (k = 0; k <= SNDRV_PCM_FORMAT_LAST; ++k) {
+	for (k = SNDRV_PCM_FORMAT_FIRST; k <= SNDRV_PCM_FORMAT_LAST; ++k) {
 		int bits;
 		if (! snd_mask_test(mask, k))
 			continue;
@@ -2074,12 +2074,12 @@ static int snd_pcm_hw_rule_sample_bits(struct snd_pcm_hw_params *params,
 				       struct snd_pcm_hw_rule *rule)
 {
 	struct snd_interval t;
-	unsigned int k;
+	snd_pcm_format_t k;
 	t.min = UINT_MAX;
 	t.max = 0;
 	t.openmin = 0;
 	t.openmax = 0;
-	for (k = 0; k <= SNDRV_PCM_FORMAT_LAST; ++k) {
+	for (k = SNDRV_PCM_FORMAT_FIRST; k <= SNDRV_PCM_FORMAT_LAST; ++k) {
 		int bits;
 		if (! snd_mask_test(hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT), k))
 			continue;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-05-09 20:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.