Messages in this thread | | | Date | Thu, 21 Feb 2013 00:09:46 +0100 (CET) | From | Thomas Gleixner <> | Subject | Re: [PATCH] posix-timer: don't call idr_find() w/ negative ID |
| |
On Wed, 20 Feb 2013, Andrew Morton wrote: > On Wed, 20 Feb 2013 13:37:01 -0800 > Tejun Heo <tj@kernel.org> wrote: > > hopefully with some comments. That said, if I'm grepping it right, > > all archs define timer_t as int, so maybe we're just being paranoid. > > > > 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...
First of all the compiler should warn you about the truncation. And aside of that:
+ BUILD_BUG_ON(sizeof(timer_t) != sizeof(int));
and then we can worry about that esoteric architecture when that thing triggers?
Aside of that, due to the pending checkpoint/restore stuff this user might be gone in the near future.
Thanks,
tglx
| |