![](https://secure.gravatar.com/avatar/d28dfe03ea754ea1153719f4ced12649.jpg?s=120&d=mm&r=g)
22 Jul
2009
22 Jul
'09
2:19 p.m.
On Wed, Jul 22, 2009 at 01:39:22PM +0200, Takashi Iwai wrote:
Mark Brown wrote:
- /* Setup pins after corresponding bits if changed */
- if ((bool)snd_soc_dapm_get_pin_status(codec, "Speaker") !=
(bool)(function & (1 << AMS_DELTA_SPEAKER))) {
Don't like these casts... why are they needed?
Because the right side is the bit operation?
Ick, yes.
The cast doesn't look nice, though...
Indeed. I'd suggest rewriting to try to do less in the if statement - a helper function seems to be in order here since the same code is repeated several times with different pins and bitmasks.