On Monday 13 December 2010 08:40:54 Felix Fietkau wrote: > > diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c > index cdca4c3..69f7792 100644 > --- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c > +++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c > @@ -30,9 +30,69 @@ void ar9003_paprd_enable(struct ath_hw *ah, bool val) > + > +static int get_streams(int mask) > +{ > + return !!(mask & BIT(0)) + !!(mask & BIT(1)) + !!(mask & BIT(2)); > +} > + I think there's a generic library function for that: hweight[8|16|32]. Also, some CPUs have a special "population count" instruction and hweight* takes full advantage of that too. Regards, Chr -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html