public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Christoph Lameter <clameter@sgi.com>
Cc: Peter Lund <firefly@vax64.dk>,
	Christoph Hellwig <hch@infradead.org>,
	trivial@kernel.org, linux-kernel@vger.kernel.org,
	Momchil Velikov <velco@fadata.bg>,
	"Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: [PATCH] avoid negative (and full-width) shifts in radix-tree.c, take 3
Date: Thu, 30 Aug 2007 02:46:41 +0200	[thread overview]
Message-ID: <20070830004641.GA26580@atjola.homenet> (raw)
In-Reply-To: <Pine.LNX.4.64.0708291048250.21332@schroedinger.engr.sgi.com>

On 2007.08.29 10:49:12 -0700, Christoph Lameter wrote:
> On Wed, 29 Aug 2007, Peter Lund wrote:
> 
> >  
> > -	if (tmp >= RADIX_TREE_INDEX_BITS)
> > -		index = ~0UL;
> > -	return index;
> > +	if (shift < 0)
> > +		return ~0UL;
> > +	if (shift >= 8 * sizeof(unsigned long))
> 
> 8* sizeof(unsigned long) is the constant BITS_PER_LONG.

Or in this context: RADIX_TREE_INDEX_BITS, which happens to be the old
check, which just needed to be extended to cover negative shifts.

Björn

      reply	other threads:[~2007-08-30  0:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-29 15:44 [PATCH] avoid negative (and full-width) shifts in radix-tree.c, take 3 Peter Lund
2007-08-29 17:49 ` Christoph Lameter
2007-08-30  0:46   ` Björn Steinbrink [this message]

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=20070830004641.GA26580@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=clameter@sgi.com \
    --cc=firefly@vax64.dk \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.org \
    --cc=trivial@kernel.org \
    --cc=velco@fadata.bg \
    /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