linux-mips
[Top] [All Lists]

Re: gcc 3.x, -ansi and "static inline"

To: Ralf Baechle <ralf@oss.sgi.com>
Subject: Re: gcc 3.x, -ansi and "static inline"
From: Jun Sun <jsun@mvista.com>
Date: Mon, 04 Feb 2002 11:28:16 -0800
Cc: linux-mips@oss.sgi.com
References: <20020201115206.A18085@mvista.com> <20020203180151.A5371@dea.linux-mips.net>
Sender: owner-linux-mips@oss.sgi.com
Ralf Baechle wrote:
> 
> On Fri, Feb 01, 2002 at 11:52:06AM -0800, Jun Sun wrote:
> 
> > BTW, the inclusion of "mipsregs.h" file in bitops.h seems unnecessary
> > and caused a bunch of similar errors.
> 
> Indeed, it was pointless and I therefore removed it.
> 

What about ffz()?  We can do:

diff -Nru include/asm-mips/bitops.h.orig include/asm-mips/bitops.h
--- include/asm-mips/bitops.h.orig      Mon Feb  4 11:07:31 2002
+++ include/asm-mips/bitops.h   Mon Feb  4 11:21:14 2002
@@ -675,7 +675,7 @@
  *
  * Undefined if no zero exists, so code should check against ~0UL first.
  */
-static inline unsigned long ffz(unsigned long word)
+static __inline__ unsigned long ffz(unsigned long word)
 {
        int b = 0, s;
 

or 

diff -Nru include/asm-mips/bitops.h.orig include/asm-mips/bitops.h
--- include/asm-mips/bitops.h.orig      Mon Feb  4 11:07:31 2002
+++ include/asm-mips/bitops.h   Mon Feb  4 11:27:55 2002
@@ -669,6 +669,8 @@
 
 #endif /* !(__MIPSEB__) */
 
+#ifdef __KERNEL__
+
 /*
  * ffz - find first zero in word.
  * @word: The word to search
@@ -689,8 +691,6 @@
        return b;
 }
 
-
-#ifdef __KERNEL__
 
 /**
  * ffs - find first bit set


Jun

<Prev in Thread] Current Thread [Next in Thread>