public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-arch@vger.kernel.org
Subject: Re: find_next_bit return type
Date: 01 Aug 2004 11:05:07 -0400	[thread overview]
Message-ID: <1091372708.10972.3.camel@mulgrave> (raw)
In-Reply-To: <20040731232434.7263b50c.akpm@osdl.org>

On Sun, 2004-08-01 at 02:24, Andrew Morton wrote:
> 
> Seems that several 64-bit architectures are returning longs from
> find_next_bit(), find_next_zero_bit(), etc.  x86 returns an int.  wli sent
> me a patch which does
> 
> 	return min(NR_CPUS, find_first_bit(srcp->bits, nbits));
> 
> so these architectures now get a zillion warnings.
> 
> We should be consistent here.  Is there any reason why these functions
> cannot return integers?

This isn't just a prototype change, it would change the actual
implementation on big endian 64 bit machines.

The find_first_bit/find_next_bit macros work fine on LE because the
lowest bit is at the start of the bitmap.  on BE machines, the highest
bit is supposed to be there.  The result is that long bitmaps are
currently implemented LE in BE chunks (the chunk size being an unsigned
long).  If you change to an unsigned int, you reduce our chunk size, and
hence the actual layout of the bitmap, so we'd need to check there were
no unintended consequences of this.

Would it not be easier simply to change the prototype on x86?

James

  parent reply	other threads:[~2004-08-01 15:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-01  6:24 find_next_bit return type Andrew Morton
2004-08-01  6:25 ` Andrew Morton
2004-08-01  6:58   ` David S. Miller
2004-08-01  7:02     ` Andrew Morton
2004-08-01  7:10       ` David S. Miller
2004-08-02 10:40         ` Andi Kleen
2004-08-01  6:25 ` Andrew Morton
2004-08-01  6:26 ` Andrew Morton
2004-08-01 11:53 ` William Lee Irwin III
2004-08-01 13:51   ` William Lee Irwin III
2004-08-01 15:05 ` James Bottomley [this message]
2004-08-01 15:07   ` William Lee Irwin III
2004-08-01 22:09   ` Paul Mackerras

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=1091372708.10972.3.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=akpm@osdl.org \
    --cc=linux-arch@vger.kernel.org \
    /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