Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d656b4a6 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai
Browse files

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: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 0d4e3999
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -342,16 +342,13 @@ static int constrain_params_by_rules(struct snd_pcm_substream *substream,
	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];
		struct snd_pcm_hw_rule *r = &constrs->rules[k];
		unsigned int d;
		unsigned int d;
		int doit = 0;
		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++) {
			if (vstamps[r->deps[d]] > rstamps[k]) {
			if (vstamps[r->deps[d]] > rstamps[k])
				doit = 1;
				break;
				break;
		}
		}
		}
		if (r->deps[d] < 0)
		if (!doit)
			continue;
			continue;


		if (trace_hw_mask_param_enabled()) {
		if (trace_hw_mask_param_enabled()) {