Hi All, It looks like the card_type field is confusing so I renamed it to feature_mask. In this way it's clear that & should be used to check bits instead of ==.
Best regards, Hannu --------- Yair K. wrote: > On Saturday 17 May 2008 04:18:40 Alex J. Ivasyuv wrote: > >> SB_LIVE also? >> >> diff -ru oss-v4.0-build1015-src-gpl/kernel/drv/sblive/sblive.c >> oss-v4.0-build1015-src-gpl.good/kernel/drv/sblive/sblive.c >> --- oss-v4.0-build1015-src-gpl/kernel/drv/sblive/sblive.c >> 2008-03-24 07:33:06.000000000 +0200 >> +++ oss-v4.0-build1015-src-gpl.good/kernel/drv/sblive/sblive.c >> 2008-05-17 04:09:13.000000000 +0300 >> @@ -2748,14 +2748,14 @@ >> /* switch the shared SPDIF/OUT3 to DIGITAL or ANALOG mode */ >> /* depending on whether the port is SPDIF or analog */ >> >> - if (devc->card_type == SB_AUDIGY) >> + if (devc->card_type & SB_AUDIGY) >> { >> reg = INL (devc->osdev, devc->base + 0x18) & ~A_IOCFG_GPOUT0; >> val = (audigy_digital_din) ? 0x4 : 0; >> reg |= val; >> OUTL (devc->osdev, reg, devc->base + 0x18); >> } >> - if (devc->card_type == SB_LIVE) /* SBLIVE */ >> + if (devc->card_type & SB_LIVE) /* SBLIVE */ >> { >> reg = INL (devc->osdev, devc->base + 0x14) & ~HCFG_GPOUT0; >> val = (sblive_digital_din) ? HCFG_GPOUT0 : 0; >> @@ -3862,7 +3862,7 @@ >> devc->voice_busy[i * 2] = 1; >> devc->voice_busy[i * 2 + 1] = 1; >> portc->resetvol = 0; >> - if (devc->card_type == SB_LIVE) >> + if (devc->card_type & SB_LIVE) >> { >> /* >> * Do not enable vmix by default on Live! It would cause enormous >> >> _______________________________________________ >> oss-devel mailing list >> oss-devel@mailman.opensound.com >> http://mailman.opensound.com/mailman/listinfo/oss-devel >> >> > > card_type can have the following values currently: > SB_AUDIGY | SB_AUDIGY2 | SB_AUDIGY2VAL > SB_AUDIGY | SB_AUDIGY2 > SB_AUDIGY > SB_LIVE > > As you can see, checking for (devc->card_type & SB_LIVE) is the same as > checking for (devc->card_type == SB_LIVE). But it may be better practice in > case new possible values are added. > > Yours, > Yair K. > _______________________________________________ > oss-devel mailing list > oss-devel@mailman.opensound.com > http://mailman.opensound.com/mailman/listinfo/oss-devel > _______________________________________________ oss-devel mailing list oss-devel@mailman.opensound.com http://mailman.opensound.com/mailman/listinfo/oss-devel