Commit a1c06e39 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai

ALSA: pcm: adaption of code formatting

This commit modifies current for readability in below aspects:
 - use bool type variable instead of int type variable assigned to 0/1
 - move variable definition from loop to top of the function definition
Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d656b4a6
...@@ -328,9 +328,11 @@ static int constrain_params_by_rules(struct snd_pcm_substream *substream, ...@@ -328,9 +328,11 @@ static int constrain_params_by_rules(struct snd_pcm_substream *substream,
unsigned int rstamps[constrs->rules_num]; unsigned int rstamps[constrs->rules_num];
unsigned int vstamps[SNDRV_PCM_HW_PARAM_LAST_INTERVAL + 1]; unsigned int vstamps[SNDRV_PCM_HW_PARAM_LAST_INTERVAL + 1];
unsigned int stamp = 2; unsigned int stamp = 2;
struct snd_pcm_hw_rule *r;
unsigned int d;
struct snd_mask old_mask; struct snd_mask old_mask;
struct snd_interval old_interval; struct snd_interval old_interval;
int again; bool again;
int changed; int changed;
for (k = 0; k < constrs->rules_num; k++) for (k = 0; k < constrs->rules_num; k++)
...@@ -338,10 +340,9 @@ static int constrain_params_by_rules(struct snd_pcm_substream *substream, ...@@ -338,10 +340,9 @@ static int constrain_params_by_rules(struct snd_pcm_substream *substream,
for (k = 0; k <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL; k++) for (k = 0; k <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL; k++)
vstamps[k] = (params->rmask & (1 << k)) ? 1 : 0; vstamps[k] = (params->rmask & (1 << k)) ? 1 : 0;
retry: retry:
again = 0; again = false;
for (k = 0; k < constrs->rules_num; k++) { for (k = 0; k < constrs->rules_num; k++) {
struct snd_pcm_hw_rule *r = &constrs->rules[k]; r = &constrs->rules[k];
unsigned int d;
if (r->cond && !(r->cond & params->flags)) if (r->cond && !(r->cond & params->flags))
continue; continue;
for (d = 0; r->deps[d] >= 0; d++) { for (d = 0; r->deps[d] >= 0; d++) {
...@@ -375,7 +376,7 @@ static int constrain_params_by_rules(struct snd_pcm_substream *substream, ...@@ -375,7 +376,7 @@ static int constrain_params_by_rules(struct snd_pcm_substream *substream,
if (changed && r->var >= 0) { if (changed && r->var >= 0) {
params->cmask |= (1 << r->var); params->cmask |= (1 << r->var);
vstamps[r->var] = stamp; vstamps[r->var] = stamp;
again = 1; again = true;
} }
if (changed < 0) if (changed < 0)
return changed; return changed;
...@@ -453,7 +454,6 @@ int snd_pcm_hw_refine(struct snd_pcm_substream *substream, ...@@ -453,7 +454,6 @@ int snd_pcm_hw_refine(struct snd_pcm_substream *substream,
params->rmask = 0; params->rmask = 0;
return 0; return 0;
} }
EXPORT_SYMBOL(snd_pcm_hw_refine); EXPORT_SYMBOL(snd_pcm_hw_refine);
static int snd_pcm_hw_refine_user(struct snd_pcm_substream *substream, static int snd_pcm_hw_refine_user(struct snd_pcm_substream *substream,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment