aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2014-09-07 15:43:07 -0400
committerTakashi Iwai <tiwai@suse.de>2014-09-08 04:54:18 -0400
commit0f519b622151339b7754d0406ddc40940063572a (patch)
tree08047b74f8082d6b3ee1b041b5e9950b2a1c6a0b
parentd89c6c0c91af0344b52dd21ca48dd29821fee677 (diff)
ALSA: pcm: snd_interval_step: drop the min parameter
The min parameter was not used by any caller. And if it were used, underflows in the calculations could lead to incorrect results. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/core/pcm_lib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 9acc77eae487..6fd5e1ce5462 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -1113,16 +1113,16 @@ int snd_interval_list(struct snd_interval *i, unsigned int count,
1113 1113
1114EXPORT_SYMBOL(snd_interval_list); 1114EXPORT_SYMBOL(snd_interval_list);
1115 1115
1116static int snd_interval_step(struct snd_interval *i, unsigned int min, unsigned int step) 1116static int snd_interval_step(struct snd_interval *i, unsigned int step)
1117{ 1117{
1118 unsigned int n; 1118 unsigned int n;
1119 int changed = 0; 1119 int changed = 0;
1120 n = (i->min - min) % step; 1120 n = i->min % step;
1121 if (n != 0 || i->openmin) { 1121 if (n != 0 || i->openmin) {
1122 i->min += step - n; 1122 i->min += step - n;
1123 changed = 1; 1123 changed = 1;
1124 } 1124 }
1125 n = (i->max - min) % step; 1125 n = i->max % step;
1126 if (n != 0 || i->openmax) { 1126 if (n != 0 || i->openmax) {
1127 i->max -= n; 1127 i->max -= n;
1128 changed = 1; 1128 changed = 1;
@@ -1427,7 +1427,7 @@ static int snd_pcm_hw_rule_step(struct snd_pcm_hw_params *params,
1427 struct snd_pcm_hw_rule *rule) 1427 struct snd_pcm_hw_rule *rule)
1428{ 1428{
1429 unsigned long step = (unsigned long) rule->private; 1429 unsigned long step = (unsigned long) rule->private;
1430 return snd_interval_step(hw_param_interval(params, rule->var), 0, step); 1430 return snd_interval_step(hw_param_interval(params, rule->var), step);
1431} 1431}
1432 1432
1433/** 1433/**