lkml.org 
[lkml]   [2013]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] posix-timer: don't call idr_find() w/ negative ID
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


\
 
 \ /
  Last update: 2013-02-21 02:22    [W:0.080 / U:1.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site