[PATCH] MIPS: Check BITS_PER_LONG instead of __SIZEOF_LONG__

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] MIPS: Check BITS_PER_LONG instead of __SIZEOF_LONG__

Geert Uytterhoeven
When building a 32-bit kernel for RBTX4927 with gcc version 4.1.2 20061115
(prerelease) (Ubuntu 4.1.1-21), I get:

arch/mips/lib/delay.c:24:5: warning: "__SIZEOF_LONG__" is not defined

As a consequence, __delay() always uses the 64-bit "dsubu" instruction.

Replace the check for "__SIZEOF_LONG__ == 4" by "BITS_PER_LONG == 32" to
fix this.

Introduced by commit 5210edcd527773c227465ad18e416a894966324f ("MIPS: Make
__{,n,u}delay declarations match definitions and generic delay.h")

Signed-off-by: Geert Uytterhoeven <[hidden email]>
--
Untested on real hardware.
Ralf, is this sufficient to prevent you from nuking RBTX4927 support? ;-)
---
 arch/mips/lib/delay.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/lib/delay.c b/arch/mips/lib/delay.c
index dc81ca8..288f795 100644
--- a/arch/mips/lib/delay.c
+++ b/arch/mips/lib/delay.c
@@ -21,7 +21,7 @@ void __delay(unsigned long loops)
  " .set noreorder \n"
  " .align 3 \n"
  "1: bnez %0, 1b \n"
-#if __SIZEOF_LONG__ == 4
+#if BITS_PER_LONG == 32
  " subu %0, 1 \n"
 #else
  " dsubu %0, 1 \n"
--
1.7.0.4


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] MIPS: Check BITS_PER_LONG instead of __SIZEOF_LONG__

David Daney-4
On 12/06/2012 11:12 AM, Geert Uytterhoeven wrote:

> When building a 32-bit kernel for RBTX4927 with gcc version 4.1.2 20061115
> (prerelease) (Ubuntu 4.1.1-21), I get:
>
> arch/mips/lib/delay.c:24:5: warning: "__SIZEOF_LONG__" is not defined
>
> As a consequence, __delay() always uses the 64-bit "dsubu" instruction.
>
> Replace the check for "__SIZEOF_LONG__ == 4" by "BITS_PER_LONG == 32" to
> fix this.
>
> Introduced by commit 5210edcd527773c227465ad18e416a894966324f ("MIPS: Make
> __{,n,u}delay declarations match definitions and generic delay.h")
>
> Signed-off-by: Geert Uytterhoeven <[hidden email]>

Acked-by: David Daney <[hidden email]>

> --
> Untested on real hardware.
> Ralf, is this sufficient to prevent you from nuking RBTX4927 support? ;-)
> ---
>   arch/mips/lib/delay.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/mips/lib/delay.c b/arch/mips/lib/delay.c
> index dc81ca8..288f795 100644
> --- a/arch/mips/lib/delay.c
> +++ b/arch/mips/lib/delay.c
> @@ -21,7 +21,7 @@ void __delay(unsigned long loops)
>   " .set noreorder \n"
>   " .align 3 \n"
>   "1: bnez %0, 1b \n"
> -#if __SIZEOF_LONG__ == 4
> +#if BITS_PER_LONG == 32
>   " subu %0, 1 \n"
>   #else
>   " dsubu %0, 1 \n"
>



Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] MIPS: Check BITS_PER_LONG instead of __SIZEOF_LONG__

David Daney-5
In reply to this post by Geert Uytterhoeven
On 12/06/2012 11:12 AM, Geert Uytterhoeven wrote:
> When building a 32-bit kernel for RBTX4927 with gcc version 4.1.2 20061115
> (prerelease) (Ubuntu 4.1.1-21), I get:
>
> arch/mips/lib/delay.c:24:5: warning: "__SIZEOF_LONG__" is not defined

Sorry, looks like it may have been added in GCC-4.3.  I didn't check any
earlier versions when I made the original patch.



>
> As a consequence, __delay() always uses the 64-bit "dsubu" instruction.
>
> Replace the check for "__SIZEOF_LONG__ == 4" by "BITS_PER_LONG == 32" to
> fix this.
>
> Introduced by commit 5210edcd527773c227465ad18e416a894966324f ("MIPS: Make
> __{,n,u}delay declarations match definitions and generic delay.h")
>
> Signed-off-by: Geert Uytterhoeven <[hidden email]>
> --
> Untested on real hardware.
> Ralf, is this sufficient to prevent you from nuking RBTX4927 support? ;-)
> ---
>   arch/mips/lib/delay.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/mips/lib/delay.c b/arch/mips/lib/delay.c
> index dc81ca8..288f795 100644
> --- a/arch/mips/lib/delay.c
> +++ b/arch/mips/lib/delay.c
> @@ -21,7 +21,7 @@ void __delay(unsigned long loops)
>   " .set noreorder \n"
>   " .align 3 \n"
>   "1: bnez %0, 1b \n"
> -#if __SIZEOF_LONG__ == 4
> +#if BITS_PER_LONG == 32
>   " subu %0, 1 \n"
>   #else
>   " dsubu %0, 1 \n"
>