mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	John Stultz <johnstul@us.ibm.com>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] fix msecs_to_jiffies() to not return values greater than MAX_JIFFY_OFFSET
Date: Tue, 29 Mar 2011 23:03:47 +0200	[thread overview]
Message-ID: <6206394.oTpczxkaEM@donald.sf-tec.de> (raw)
In-Reply-To: <alpine.LFD.2.00.1103292103070.2774@localhost6.localdomain6>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="US-ASCII", Size: 543 bytes --]

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 #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2011-03-29 21:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29 16:38 Rolf Eike Beer
2011-03-29 19:42 ` Thomas Gleixner
2011-03-29 21:03   ` Rolf Eike Beer [this message]
2011-05-08 18:46   ` Rolf Eike Beer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6206394.oTpczxkaEM@donald.sf-tec.de \
    --to=eike-kernel@sf-tec.de \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®