On Mon, 2010-12-13 at 11:52 +0100, Christian Lamparter wrote: > > + return !!(mask & BIT(0)) + !!(mask & BIT(1)) + !!(mask & BIT(2)); > > +} > > + > I think there's a generic library function for that: > hweight[8|16|32]. but note the !!, which makes this return 0, 1, 2 or 3 only, not the bit weight. johannes -- 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