[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.02.1302210003380.22263@ionos>
Date: Thu, 21 Feb 2013 00:09:46 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Andrew Morton <akpm@...ux-foundation.org>
cc: Tejun Heo <tj@...nel.org>, Sasha Levin <sasha.levin@...cle.com>,
linux-kernel@...r.kernel.org
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@...nel.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
--
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