[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130220220823.GH3570@htj.dyndns.org>
Date: Wed, 20 Feb 2013 14:08:23 -0800
From: Tejun Heo <tj@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Sasha Levin <sasha.levin@...cle.com>, linux-kernel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists