summaryrefslogtreecommitdiff
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2017-06-09 06:37:03 +0900
committerTakashi Iwai <tiwai@suse.de>2017-06-08 23:40:34 +0200
commitd656b4a6549f0f5863b7888b25a7b20d03ecbce7 (patch)
tree9d37c23e174b36890f54cca237ea905f24b0f31e /sound/core
parent0d4e399965738bb90dcee2fd5aeb15c1ccc81b42 (diff)
ALSA: pcm: remove function local variable with alternative evaluation
A local variable is used to judge whether a parameter should be handled due to reverse dependency of the other rules. However, this can be obsoleted by check of a sentinel in dependency array. This commit removes the local variable and check the sentinel to reduce stack usage. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/pcm_native.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 41aeb6facdec..db4cdd114ed4 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -342,16 +342,13 @@ retry:
for (k = 0; k < constrs->rules_num; k++) {
struct snd_pcm_hw_rule *r = &constrs->rules[k];
unsigned int d;
- int doit = 0;
if (r->cond && !(r->cond & params->flags))
continue;
for (d = 0; r->deps[d] >= 0; d++) {
- if (vstamps[r->deps[d]] > rstamps[k]) {
- doit = 1;
+ if (vstamps[r->deps[d]] > rstamps[k])
break;
- }
}
- if (!doit)
+ if (r->deps[d] < 0)
continue;
if (trace_hw_mask_param_enabled()) {