From: Andrew Morton <akpm@osdl.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-arch@vger.kernel.org
Subject: Re: find_next_bit return type
Date: Sat, 31 Jul 2004 23:25:15 -0700 [thread overview]
Message-ID: <20040731232515.1fead83b.akpm@osdl.org> (raw)
In-Reply-To: <20040731232434.7263b50c.akpm@osdl.org>
sparc64:
diff -puN arch/sparc64/lib/find_bit.c~sparc64-bitops-fix arch/sparc64/lib/find_bit.c
--- 25-sparc64/arch/sparc64/lib/find_bit.c~sparc64-bitops-fix 2004-07-31 21:25:14.421668712 -0700
+++ 25-sparc64-akpm/arch/sparc64/lib/find_bit.c 2004-07-31 21:25:20.872688008 -0700
@@ -6,11 +6,11 @@
* @offset: The bitnumber to start searching at
* @size: The maximum size to search
*/
-unsigned long find_next_bit(const unsigned long *addr, unsigned long size,
+int find_next_bit(const unsigned long *addr, unsigned long size,
unsigned long offset)
{
const unsigned long *p = addr + (offset >> 6);
- unsigned long result = offset & ~63UL;
+ int result = offset & ~63UL;
unsigned long tmp;
if (offset >= size)
@@ -50,14 +50,15 @@ found_middle:
* on Linus's ALPHA routines, which are pretty portable BTW.
*/
-unsigned long find_next_zero_bit(unsigned long *addr, unsigned long size, unsigned long offset)
+int find_next_zero_bit(unsigned long *addr, unsigned long size,
+ unsigned long offset)
{
unsigned long *p = addr + (offset >> 6);
- unsigned long result = offset & ~63UL;
+ int result = offset & ~63;
unsigned long tmp;
if (offset >= size)
- return size;
+ return (int)size;
size -= result;
offset &= 63UL;
if (offset) {
diff -puN include/asm-sparc64/bitops.h~sparc64-bitops-fix include/asm-sparc64/bitops.h
--- 25-sparc64/include/asm-sparc64/bitops.h~sparc64-bitops-fix 2004-07-31 21:25:14.422668560 -0700
+++ 25-sparc64-akpm/include/asm-sparc64/bitops.h 2004-07-31 21:25:14.426667952 -0700
@@ -204,8 +204,7 @@ static __inline__ unsigned int hweight8(
* @offset: The bitnumber to start searching at
* @size: The maximum size to search
*/
-extern unsigned long find_next_bit(const unsigned long *, unsigned long,
- unsigned long);
+extern int find_next_bit(const unsigned long *, unsigned long, unsigned long);
/**
* find_first_bit - find the first set bit in a memory region
@@ -223,7 +222,7 @@ extern unsigned long find_next_bit(const
* on Linus's ALPHA routines, which are pretty portable BTW.
*/
-extern unsigned long find_next_zero_bit(unsigned long *, unsigned long, unsigned long);
+extern int find_next_zero_bit(unsigned long *, unsigned long, unsigned long);
#define find_first_zero_bit(addr, size) \
find_next_zero_bit((addr), (size), 0)
_
next prev parent reply other threads:[~2004-08-01 6:26 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 [this message]
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
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=20040731232515.1fead83b.akpm@osdl.org \
--to=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