ALSA: pcm: Correct PCM BUG error message
[cascardo/linux.git] / sound / core / pcm_lib.c
index 0032278..7b9e2fb 100644 (file)
@@ -345,7 +345,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
                        snd_pcm_debug_name(substream, name, sizeof(name));
                        xrun_log_show(substream);
                        pcm_err(substream->pcm,
-                               "XRUN: %s, pos = %ld, buffer size = %ld, period size = %ld\n",
+                               "BUG: %s, pos = %ld, buffer size = %ld, period size = %ld\n",
                                name, pos, runtime->buffer_size,
                                runtime->period_size);
                }
@@ -1113,18 +1113,20 @@ int snd_interval_list(struct snd_interval *i, unsigned int count,
 
 EXPORT_SYMBOL(snd_interval_list);
 
-static int snd_interval_step(struct snd_interval *i, unsigned int min, unsigned int step)
+static int snd_interval_step(struct snd_interval *i, unsigned int step)
 {
        unsigned int n;
        int changed = 0;
-       n = (i->min - min) % step;
+       n = i->min % step;
        if (n != 0 || i->openmin) {
                i->min += step - n;
+               i->openmin = 0;
                changed = 1;
        }
-       n = (i->max - min) % step;
+       n = i->max % step;
        if (n != 0 || i->openmax) {
                i->max -= n;
+               i->openmax = 0;
                changed = 1;
        }
        if (snd_interval_checkempty(i)) {
@@ -1427,7 +1429,7 @@ static int snd_pcm_hw_rule_step(struct snd_pcm_hw_params *params,
                                struct snd_pcm_hw_rule *rule)
 {
        unsigned long step = (unsigned long) rule->private;
-       return snd_interval_step(hw_param_interval(params, rule->var), 0, step);
+       return snd_interval_step(hw_param_interval(params, rule->var), step);
 }
 
 /**