arch: m68k: math-emu: unsigned issue, 'unsigned long' will never be less than zero.
Subsystems (2)
PATCH 1/1 arch: m68k: math-emu: unsigned issue, 'unsigned long' will never be less than zero.
'oldmant.m32[1]' is 'unsigned long' which never '< 0', and the original author wanted to check the highest bit whether set.
So need type cast form 'unsigned long' to 'long'.
The related warning: (with EXTRA_CFLAGS=-W ARCH=m68k for allmodconfig)
arch/m68k/math-emu/fp_arith.c:522:4: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
--- arch/m68k/math-emu/fp_arith.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/m68k/math-emu/fp_arith.c +1 -1
@@ -519,7 +519,7 @@ static void fp_roundint(struct fp_ext *dest, int mode)return ;break ;case 0x401e : -if (!(oldmant.m32[1 ] >=0 )) +if (!((long )oldmant.m32[1 ] >=0 ))return ;if (oldmant.m32[0 ] &1 )break ;
Signature · 1 line
1.7.7.6
Quoted 4 lines · Chen Gang
'oldmant.m32[1]' is 'unsigned long' which never '< 0', and the original author wanted to check the highest bit whether set.
So need type cast form 'unsigned long' to 'long'.
Better to make the bit test explicit, since it is not a sign bit.
arch/m68k/math-emu/fp_arith.c static void fp_roundint(struct fp_ext *dest, int mode) · line 522
Quoted 10 lines
arch/m68k/math-emu/fp_arith.c +1
-1@@ -519,7 +519,7 @@ static void fp_roundint(struct fp_ext *dest, int mode)return ;break ;case 0x401e : -if (!(oldmant.m32[1 ] >=0 )) +if (!((long )oldmant.m32[1 ] >=0 ))
if (oldmant.m32[1] & 0x80000000)
Andreas.
Signature · 3 lines
Andreas Schwab, [email protected] GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Quoted 4 lines · Chen Gang
'oldmant.m32[1]' is 'unsigned long' which never '< 0', and the original author wanted to check the highest bit whether set.
So need type cast form 'unsigned long' to 'long'.
Better to make the bit test explicit, since it is not a sign bit.
arch/m68k/math-emu/fp_arith.c static void fp_roundint(struct fp_ext *dest, int mode) · line 522
Quoted 10 lines
arch/m68k/math-emu/fp_arith.c +1
-1@@ -519,7 +519,7 @@ static void fp_roundint(struct fp_ext *dest, int mode)return ;break ;case 0x401e : -if (!(oldmant.m32[1 ] >=0 )) +if (!((long )oldmant.m32[1 ] >=0 ))
if (oldmant.m32[1] & 0x80000000)
Andreas.
Signature · 3 lines
Andreas Schwab, [email protected] GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Quoted 8 lines · Andreas Schwab
Quoted 4 lines · Chen Gang
Quoted 4 lines
'oldmant.m32[1]' is 'unsigned long' which never '< 0', and the original author wanted to check the highest bit whether set.
So need type cast form 'unsigned long' to 'long'.
Better to make the bit test explicit, since it is not a sign bit.
That sounds good.
Quoted 11 lines
Quoted 10 lines
arch/m68k/math-emu/fp_arith.c static void fp_roundint(struct fp_ext *dest, int mode) · line 522
Quoted 10 lines
arch/m68k/math-emu/fp_arith.c +1
-1@@ -519,7 +519,7 @@ static void fp_roundint(struct fp_ext *dest, int mode)return ;break ;case 0x401e : -if (!(oldmant.m32[1 ] >=0 )) +if (!((long )oldmant.m32[1 ] >=0 ))if (oldmant.m32[1] & 0x80000000)
OK, I will send patch v2.
Thanks.
Signature · 3 lines
Chen Gang Asianux Corporation
PATCH v2 1/1 arch: m68k: math-emu: unsigned issue, 'unsigned long' will never be less than zero
In reply to Andreas Schwab'oldmant.m32[1]' is 'unsigned long' which never '< 0', and the original author wanted to check the highest bit whether set.
So need make the bit test explicit (which is better than type cast form 'unsigned long' to 'long').
The related warning: (with EXTRA_CFLAGS=-W ARCH=m68k for allmodconfig)
arch/m68k/math-emu/fp_arith.c:522:4: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
--- arch/m68k/math-emu/fp_arith.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/m68k/math-emu/fp_arith.c +1 -1
@@ -519,7 +519,7 @@ static void fp_roundint(struct fp_ext *dest, int mode)return ;break ;case 0x401e : -if (!(oldmant.m32[1 ] >=0 )) +if (oldmant.m32[1 ] &0x80000000 )return ;if (oldmant.m32[0 ] &1 )break ;
Signature · 1 line
1.7.7.6
Re: [PATCH v2] arch: m68k: math-emu: unsigned issue, 'unsigned long' will never be less than zero
Quoted 10 lines · Chen Gang
'oldmant.m32[1]' is 'unsigned long' which never '< 0', and the original author wanted to check the highest bit whether set.
So need make the bit test explicit (which is better than type cast form 'unsigned long' to 'long').
The related warning: (with EXTRA_CFLAGS=-W ARCH=m68k for allmodconfig)
arch/m68k/math-emu/fp_arith.c:522:4: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]Signed-off-by Chen Gang <[email protected]>
Thanks, applied and queued for 3.11!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH v2] arch: m68k: math-emu: unsigned issue, 'unsigned long' will never be less than zero
In reply to Chen GangQuoted 10 lines · Chen Gang
'oldmant.m32[1]' is 'unsigned long' which never '< 0', and the original author wanted to check the highest bit whether set.
So need make the bit test explicit (which is better than type cast form 'unsigned long' to 'long').
The related warning: (with EXTRA_CFLAGS=-W ARCH=m68k for allmodconfig)
arch/m68k/math-emu/fp_arith.c:522:4: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]Signed-off-by Chen Gang <[email protected]>
Thanks, applied and queued for 3.11!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH v2] arch: m68k: math-emu: unsigned issue, 'unsigned long' will never be less than zero
Quoted 7 lines · Geert Uytterhoeven
Quoted 6 lines · Chen Gang
'oldmant.m32[1]' is 'unsigned long' which never '< 0', and the original author wanted to check the highest bit whether set.
So need make the bit test explicit (which is better than type cast form 'unsigned long' to 'long').
Quoted 7 lines
Quoted 4 lines
The related warning: (with EXTRA_CFLAGS=-W ARCH=m68k for allmodconfig)
arch/m68k/math-emu/fp_arith.c:522:4: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]Signed-off-by Chen Gang <[email protected]>Thanks, applied and queued for 3.11!
Thank you too, and pardon: what is '3.11' ? :-)
Thanks.
Signature · 3 lines
Chen Gang Asianux Corporation
Re: [PATCH v2] arch: m68k: math-emu: unsigned issue, 'unsigned long' will never be less than zero
In reply to Geert UytterhoevenQuoted 7 lines · Geert Uytterhoeven
Quoted 6 lines · Chen Gang
'oldmant.m32[1]' is 'unsigned long' which never '< 0', and the original author wanted to check the highest bit whether set.
So need make the bit test explicit (which is better than type cast form 'unsigned long' to 'long').
Quoted 7 lines
Quoted 4 lines
The related warning: (with EXTRA_CFLAGS=-W ARCH=m68k for allmodconfig)
arch/m68k/math-emu/fp_arith.c:522:4: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]Signed-off-by Chen Gang <[email protected]>Thanks, applied and queued for 3.11!
Thank you too, and pardon: what is '3.11' ? :-)
Thanks.
Signature · 3 lines
Chen Gang Asianux Corporation
Geert Uytterhoeven
maintainerRe: [PATCH v2] arch: m68k: math-emu: unsigned issue, 'unsigned long' will never be less than zero
Quoted 4 lines · Chen Gang
Quoted 2 lines
Thanks, applied and queued for 3.11!
Thank you too, and pardon: what is '3.11' ? :-)
Linux v3.11.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Geert Uytterhoeven
maintainerRe: [PATCH v2] arch: m68k: math-emu: unsigned issue, 'unsigned long' will never be less than zero
In reply to Chen GangQuoted 4 lines · Chen Gang
Quoted 2 lines
Thanks, applied and queued for 3.11!
Thank you too, and pardon: what is '3.11' ? :-)
Linux v3.11.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH v2] arch: m68k: math-emu: unsigned issue, 'unsigned long' will never be less than zero
Quoted 6 lines · Geert Uytterhoeven
Quoted 4 lines · Chen Gang
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
Thanks, applied and queued for 3.11!
Thank you too, and pardon: what is '3.11' ? :-)
Linux v3.11.
OK, thanks.
Signature · 3 lines
Chen Gang Asianux Corporation
Re: [PATCH v2] arch: m68k: math-emu: unsigned issue, 'unsigned long' will never be less than zero
In reply to Geert UytterhoevenQuoted 6 lines · Geert Uytterhoeven
Quoted 4 lines · Chen Gang
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
Thanks, applied and queued for 3.11!
Thank you too, and pardon: what is '3.11' ? :-)
Linux v3.11.
OK, thanks.
Signature · 3 lines
Chen Gang Asianux Corporation