|
@@ -297,7 +297,7 @@ void line6_unlink_audio_out_urbs(struct snd_line6_pcm *line6pcm)
|
|
{
|
|
{
|
|
unsigned int i;
|
|
unsigned int i;
|
|
|
|
|
|
- for (i = LINE6_ISO_BUFFERS; i--;) {
|
|
|
|
|
|
+ for (i = 0; i < LINE6_ISO_BUFFERS; i++) {
|
|
if (test_bit(i, &line6pcm->active_urb_out)) {
|
|
if (test_bit(i, &line6pcm->active_urb_out)) {
|
|
if (!test_and_set_bit(i, &line6pcm->unlink_urb_out)) {
|
|
if (!test_and_set_bit(i, &line6pcm->unlink_urb_out)) {
|
|
struct urb *u = line6pcm->urb_audio_out[i];
|
|
struct urb *u = line6pcm->urb_audio_out[i];
|
|
@@ -320,7 +320,7 @@ void line6_wait_clear_audio_out_urbs(struct snd_line6_pcm *line6pcm)
|
|
|
|
|
|
do {
|
|
do {
|
|
alive = 0;
|
|
alive = 0;
|
|
- for (i = LINE6_ISO_BUFFERS; i--;) {
|
|
|
|
|
|
+ for (i = 0; i < LINE6_ISO_BUFFERS; i++) {
|
|
if (test_bit(i, &line6pcm->active_urb_out))
|
|
if (test_bit(i, &line6pcm->active_urb_out))
|
|
alive++;
|
|
alive++;
|
|
}
|
|
}
|
|
@@ -366,14 +366,14 @@ static void audio_out_callback(struct urb *urb)
|
|
line6pcm->last_frame_out = urb->start_frame;
|
|
line6pcm->last_frame_out = urb->start_frame;
|
|
|
|
|
|
/* find index of URB */
|
|
/* find index of URB */
|
|
- for (index = LINE6_ISO_BUFFERS; index--;)
|
|
|
|
|
|
+ for (index = 0; index < LINE6_ISO_BUFFERS; index++)
|
|
if (urb == line6pcm->urb_audio_out[index])
|
|
if (urb == line6pcm->urb_audio_out[index])
|
|
break;
|
|
break;
|
|
|
|
|
|
- if (index < 0)
|
|
|
|
|
|
+ if (index >= LINE6_ISO_BUFFERS)
|
|
return; /* URB has been unlinked asynchronously */
|
|
return; /* URB has been unlinked asynchronously */
|
|
|
|
|
|
- for (i = LINE6_ISO_PACKETS; i--;)
|
|
|
|
|
|
+ for (i = 0; i < LINE6_ISO_PACKETS; i++)
|
|
length += urb->iso_frame_desc[i].length;
|
|
length += urb->iso_frame_desc[i].length;
|
|
|
|
|
|
spin_lock_irqsave(&line6pcm->lock_audio_out, flags);
|
|
spin_lock_irqsave(&line6pcm->lock_audio_out, flags);
|
|
@@ -390,7 +390,7 @@ static void audio_out_callback(struct urb *urb)
|
|
|
|
|
|
clear_bit(index, &line6pcm->active_urb_out);
|
|
clear_bit(index, &line6pcm->active_urb_out);
|
|
|
|
|
|
- for (i = LINE6_ISO_PACKETS; i--;)
|
|
|
|
|
|
+ for (i = 0; i < LINE6_ISO_PACKETS; i++)
|
|
if (urb->iso_frame_desc[i].status == -EXDEV) {
|
|
if (urb->iso_frame_desc[i].status == -EXDEV) {
|
|
shutdown = 1;
|
|
shutdown = 1;
|
|
break;
|
|
break;
|