PATCH 2.4.21-pre: sb_mixer fix

From: Jeff Garzik (jgarzik@pobox.com)
Date: Fri Jan 10 2003 - 20:23:12 EST


While writing als4000.c (SB16++ on PCI), I was using sb_mixer.c
[now... don't laugh]. I found what I think is a silly.

When building the recmask, the code loops from zero to
SOUND_MIXER_NRDEVICES, building up a bitmask to then write to the card.
Due to what I feel is an obvious scoping error, the present[buggy] code
writes the left and right recmask SOUND_MIXER_NRDEVICES times! And with
an ever-changing bitmask, too...

Since the bitmask is eventually correct, this code works, but is really
stupid. This patch corrects the scoping error. Completely untested.

===== drivers/sound/sb_mixer.c 1.3 vs edited =====
--- 1.3/drivers/sound/sb_mixer.c Tue Feb 5 02:49:26 2002
+++ edited/drivers/sound/sb_mixer.c Wed Jan 8 17:31:25 2003
@@ -479,9 +479,9 @@
                                                 regimageL |= sb16_recmasks_L[i];
                                                 regimageR |= sb16_recmasks_R[i];
                                         }
- sb_setmixer (devc, SB16_IMASK_L, regimageL);
- sb_setmixer (devc, SB16_IMASK_R, regimageR);
                                 }
+ sb_setmixer (devc, SB16_IMASK_L, regimageL);
+ sb_setmixer (devc, SB16_IMASK_R, regimageR);
                         }
                         break;
         }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jan 15 2003 - 22:00:35 EST