Skip to contentSkip to conversation

PATCH 2.4.21-pre: sb_mixer fix

PATCH Jeff Garzik 1 participant 1 message Jan 11, 2003

lore
Share & tools
lore
#0 lore raw

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 =====

drivers/sound/sb_mixer.c +2 -2
@@ -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;
 	}