On Wed, Feb 20, 2013 at 02:05:51PM -0800, Andrew Morton wrote: > Sure, it's unlikely to cause a problem in practice. Maybe five years > from now, after idr has been cleaned up and switched to 64-bit, we've > left a little hand grenade for someone. It would be good to > future-safe it in some fashion. > > I wonder if we should add some generic facility to handle this: > > /* > * Query whether an unsigned type is `negative' when we don't know its size > */ > #define msb_is_set(v) { implementation goes here ;) } > > Maybe not justified, dunno...
The thing is it's not only about MSB. Any bits beyond 1 << 31 are problematic, so we want a range test. Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/