All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rogier Wolff <R.E.Wolff@BitWizard.nl>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Miles Bader <miles@gnu.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH]  Make `hash_long' function work if bits parameter is 0.
Date: Sun, 8 Dec 2002 18:23:03 +0100	[thread overview]
Message-ID: <20021208182303.A10485@bitwizard.nl> (raw)
In-Reply-To: <Pine.LNX.4.44.0212060836170.23118-100000@home.transmeta.com>

On Fri, Dec 06, 2002 at 08:37:26AM -0800, Linus Torvalds wrote:
> On Fri, 6 Dec 2002, Miles Bader wrote:
> >
> > If the bits parameter of hash_long (in <linux/hash.h>) is 0, then it
> > ends up right-shifting by BITS_PER_LONG, which is undefined in C (and
> > often is a nop).
> 
> I would much rather just add a comment saying that "bits" had better be in
> a valid range. There are no valid uses for a 0-bit hash table that I can
> see, and undefined behaviour for undefined operations is fine with me.

Wouldn't it be nice to have a memory-for-speed tradeoff by being able
to set the bits-in-the-hash-table to zero?

			Roger. 

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* The Worlds Ecosystem is a stable system. Stable systems may experience *
* excursions from the stable situation. We are currently in such an      * 
* excursion: The stable situation does not include humans. ***************

      parent reply	other threads:[~2002-12-08 17:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-06  9:33 [PATCH] Make `hash_long' function work if bits parameter is 0 Miles Bader
2002-12-06 16:37 ` Linus Torvalds
2002-12-06 17:58   ` Miles Bader
2002-12-06 18:16     ` Linus Torvalds
2002-12-08 17:23   ` Rogier Wolff [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=20021208182303.A10485@bitwizard.nl \
    --to=r.e.wolff@bitwizard.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miles@gnu.org \
    --cc=torvalds@transmeta.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.