Re: [PATCH] fix msecs_to_jiffies() to not return values greater than MAX_JIFFY_OFFSET

From: Rolf Eike Beer
Date: Tue Mar 29 2011 - 17:04:29 EST


Am Dienstag, 29. März 2011, 21:42:59 schrieb Thomas Gleixner:
> On Tue, 29 Mar 2011, Rolf Eike Beer wrote:

> > @@ -467,9 +468,10 @@ unsigned long msecs_to_jiffies(const unsigned int m)
> >
> > if (HZ > MSEC_PER_SEC && m > jiffies_to_msecs(MAX_JIFFY_OFFSET))
> >
> > return MAX_JIFFY_OFFSET;
>
> Hmm, this check is silly. MUL32 is chosen, so that we cannot overflow.

IMHO the second part of the check should be enough, no? If m is greater than
j2m(MAX) then it's irrelevant what's up else, it's too big. Period.

Eike

Attachment: signature.asc
Description: This is a digitally signed message part.