mpparse.c:231: warning: comparison is always false
PATCH 1/1 mpparse.c:231: warning: comparison is always false
Hello,
Probably after 2.6.18-rc6-git1 there is this cc warning:
"arch/i386/kernel/mpparse.c:231: warning: comparison is always false due to limited range of data type". Maybe this patch will be helpful.
Jarek P.
arch/i386/kernel/mpparse.c +2 -0
@@ -228,12 +228,14 @@ static void __init MP_bus_info (struct mmpc_oem_bus_info (m, str, translation_table[mpc_record]); +#if 0xFF >=MAX_MP_BUSSES if (m->mpc_busid >=MAX_MP_BUSSES ) {printk (KERN_WARNING "MP table busid value (%d) for bustype %s " " is too large, max. supported is %d\n" , m->mpc_busid, str,MAX_MP_BUSSES -1 );return ; } +#endif if (strncmp (str,BUSTYPE_ISA ,sizeof (BUSTYPE_ISA )-1 ) ==0 ) { mp_bus_id_to_type[m->mpc_busid] =MP_BUS_ISA ;
Quoted 10 lines · Jarek Poplawski
Probably after 2.6.18-rc6-git1 there is this cc warning:
"arch/i386/kernel/mpparse.c:231: warning: comparison is always false due to limited range of data type". Maybe this patch will be helpful.diff -Nurp
linux-2.6.18-rc6-git4-/arch/i386/kernel/mpparse.clinux-2.6.18-rc6-git4/arch/i386/kernel/mpparse.carch/i386/kernel/mpparse.c +0
-0@@ -228,12 +228,14 @@ static void __init MP_bus_info (struct m
arch/i386/kernel/mpparse.c static void __init MP_bus_info (struct m · line 238
Quoted 10 lines
arch/i386/kernel/mpparse.c +2
-0mpc_oem_bus_info (m, str, translation_table[mpc_record]); +#if 0xFF >=MAX_MP_BUSSES if (m->mpc_busid >=MAX_MP_BUSSES ) {printk (KERN_WARNING "MP table busid value (%d) for bustype %s " " is too large, max. supported is %d\n" , m->mpc_busid, str,MAX_MP_BUSSES -1 );return ; } +#endif
mpc_busid is a uchar. I don't see how this can ever be > 0xff, yet mach-summit and mach-generic have MAX_MP_BUSSES set to 260.
I don't see how this can possibly work.
Dave
Quoted 1 line · Dave Jones
On Wed, Sep 13, 2006 at 08:50:10AM +0200, Jarek Poplawski wrote:
...
Quoted 12 lines
arch/i386/kernel/mpparse.c static void __init MP_bus_info (struct m · line 238
Quoted 8 lines
arch/i386/kernel/mpparse.c +2
-0+#if 0xFF >=MAX_MP_BUSSES if (m->mpc_busid >=MAX_MP_BUSSES ) {printk (KERN_WARNING "MP table busid value (%d) for bustype %s " " is too large, max. supported is %d\n" , m->mpc_busid, str,MAX_MP_BUSSES -1 );return ; } +#endif
mpc_busidis a uchar. I don't see how this can ever be >0xff, yet mach-summit and mach-generic haveMAX_MP_BUSSESset to 260.
Quoted 4 lines
I don't see how this can possibly work.
Dave
0xFF >= 260 is false so the block is not compiled and the warning is gone (+ several bytes of useless code).
Jarek P.
Quoted 12 lines · Jarek Poplawski
Quoted 1 line · Dave Jones
On Wed, Sep 13, 2006 at 08:50:10AM +0200, Jarek Poplawski wrote:
...
Quoted 9 lines
Quoted 8 lines
arch/i386/kernel/mpparse.c +2
-0+#if 0xFF >=MAX_MP_BUSSES if (m->mpc_busid >=MAX_MP_BUSSES ) {printk (KERN_WARNING "MP table busid value (%d) for bustype %s " " is too large, max. supported is %d\n" , m->mpc_busid, str,MAX_MP_BUSSES -1 );return ; } +#endif
Quoted 7 lines
Quoted 4 lines
mpc_busidis a uchar. I don't see how this can ever be >0xff, yet mach-summit and mach-generic haveMAX_MP_BUSSESset to 260.I don't see how this can possibly work.
0xFF>= 260 is false so the block is not compiled and the warning is gone (+ several bytes of useless code).
Yes, I understand your patch. What I don't understand is why summit/generic have this set so high in the first place.
Dave
On Thu, Sep 14, 2006 at 02:35:42AM -0400, Dave Jones wrote:
...
Quoted 2 lines
Yes, I understand your patch. What I don't understand is why summit/generic have this set so high in the first place.
Sorry for misunderstanding your understanding...
I simply tried to understand another question (how this warning could be tolerated for all those gits?).
Jarek P.
Quoted 6 lines · Dave Jones
Quoted 5 lines · Jarek Poplawski
Probably after 2.6.18-rc6-git1 there is this cc warning:
"arch/i386/kernel/mpparse.c:231: warning: comparison is always false due to limited range of data type". Maybe this patch will be helpful.
It's already fixed.
-Andi
Quoted 11 lines · Andi Kleen
Quoted 6 lines · Dave Jones
Quoted 5 lines · Jarek Poplawski
Probably after 2.6.18-rc6-git1 there is this cc warning:
"arch/i386/kernel/mpparse.c:231: warning: comparison is always false due to limited range of data type". Maybe this patch will be helpful.It's already fixed.
-Andi
Still looks busted to me in 2.6.18rc7
Dave
Quoted 15 lines · Andrew Morton
Quoted 7 lines · On Wed, 13 Sep 2006 08:50:10 +0200 Jarek Poplawski <[email protected]> wrote:
Hello,
Probably after 2.6.18-rc6-git1 there is this cc warning:
"arch/i386/kernel/mpparse.c:231: warning: comparison is always false due to limited range of data type". Maybe this patch will be helpful.Thanks. Andi has already queued a similar patch.
Andi, you might as well scoot that upstream, otherwise we'll get lots of emails about it.
...
Quoted 2 lines
arch/i386/kernel/mpparse.c static void __init MP_bus_info (struct m · line 232
Quoted 2 lines
arch/i386/kernel/mpparse.c +1
-0+#if 0xFF >=MAX_MP_BUSSES if (m->mpc_busid >=MAX_MP_BUSSES ) {
As a matter of fact today I think my patch is wrong.
I don't know how Andi has fixed it, but after rethinking the question of Dave Jones I see it's fixing the result instead of the source of a problem (char or not char).
So it's more serious problem just for really serious guys like you.
Thanks for response,
Jarek P.
Quoted 14 lines · On Fri, 15 Sep 2006 10:11:23 +0200 Jarek Poplawski <[email protected]> wrote:
Quoted 13 lines · Andrew Morton
Quoted 7 lines · On Wed, 13 Sep 2006 08:50:10 +0200 Jarek Poplawski <[email protected]> wrote:
Hello,
Probably after 2.6.18-rc6-git1 there is this cc warning:
"arch/i386/kernel/mpparse.c:231: warning: comparison is always false due to limited range of data type". Maybe this patch will be helpful.Thanks. Andi has already queued a similar patch.
Quoted 7 lines
Quoted 2 lines
Andi, you might as well scoot that upstream, otherwise we'll get lots of emails about it.
...
Quoted 2 lines
arch/i386/kernel/mpparse.c static void __init MP_bus_info (struct m · line 232
Quoted 2 lines
arch/i386/kernel/mpparse.c +1
-0+#if 0xFF >=MAX_MP_BUSSES if (m->mpc_busid >=MAX_MP_BUSSES ) {As a matter of fact today I think my patch is wrong.
No, I think it's OK. Well, you had an off-by-one...
Quoted 1 line
I don't know how Andi has fixed it,
Same thing. (He has `#if MAX_MP_BUSSES < 256').
Quoted 3 lines
but after rethinking
the question of Dave Jones I see it's fixing the result instead of the source of a problem (char or not char).
The mpc_busid field is set to eight-bits by BIOS; there's nothing we can do about that...
Quoted 8 lines · Dave Jones
Quoted 7 lines · Andi Kleen
Quoted 5 lines · Dave Jones
Quoted 4 lines · Jarek Poplawski
Probably after 2.6.18-rc6-git1 there is this cc warning:
"arch/i386/kernel/mpparse.c:231: warning: comparison is always false due to limited range of data type". Maybe this patch will be helpful.
Quoted 5 lines
Quoted 3 lines
It's already fixed.
-Andi
Still looks busted to me in 2.6.18rc7
Fixed in the queued for 2.6.19 tree. I didn't consider it important enough to move up.
-Andi
Quoted 3 lines · Andrew Morton
Quoted 1 line · On Fri, 15 Sep 2006 10:11:23 +0200 Jarek Poplawski <[email protected]> wrote:
As a matter of fact today I think my patch is wrong.
...
Quoted 1 line
No, I think it's OK. Well, you had an off-by-one...
just like the source:
Quoted 2 lines
arch/i386/kernel/mpparse.c +1
-0+#if 0xFF >=MAX_MP_BUSSES if (m->mpc_busid >=MAX_MP_BUSSES ) {
...
Quoted 6 lines
Quoted 3 lines
but after rethinking
the question of Dave Jones I see it's fixing the result instead of the source of a problem (char or not char).The
mpc_busidfield is set to eight-bits by BIOS; there's nothing we can do about that...
So IMHO maybe: if we can know this only by BIOS it should be eight-bits - if there is another way to get this: shouln't you add second constant? Now it's unlogical for me (and it induces this strange #ifs in the code instead of headers).
Jarek P.
Quoted 9 lines · Andrew Morton
Quoted 8 lines
Quoted 4 lines
Thanks. Andi has already queued a similar patch.
Andi, you might as well scoot that upstream, otherwise we'll get lots of emails about it.
...
Quoted 2 lines
arch/i386/kernel/mpparse.c static void __init MP_bus_info (struct m · line 232
Quoted 2 lines
arch/i386/kernel/mpparse.c +1
-0+#if 0xFF >=MAX_MP_BUSSES if (m->mpc_busid >=MAX_MP_BUSSES ) {I don't know how Andi has fixed it,
Same thing. (He has `#if
MAX_MP_BUSSES< 256').
How can this be the right the right thing to do ?
It should *never* be >=256. mach-summit/mach-generic need fixing to be 255, not this ridiculous band-aid. Where did 260 come from anyway?
Dave
Quoted 7 lines · On Fri, 15 Sep 2006 11:23:49 -0400 Dave Jones <[email protected]> wrote:
Quoted 5 lines · Andrew Morton
Quoted 5 lines
Quoted 4 lines
Thanks. Andi has already queued a similar patch.
Andi, you might as well scoot that upstream, otherwise we'll get lots of emails about it.
...
Quoted 9 lines
Quoted 4 lines
Quoted 3 lines
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +1
-0+#if 0xFF >= MAX_MP_BUSSES if (m->mpc_busid >= MAX_MP_BUSSES) {I don't know how Andi has fixed it,
Same thing. (He has `#if
MAX_MP_BUSSES< 256').How can this be the right the right thing to do ?
It should *never* be >=256. mach-summit/mach-generic need fixing to be 255, not this ridiculous band-aid. Where did 260 come from anyway?
commit f0bacaf5cec4e677a00b5ab06d95664d03a30f7a
Author: akpm <akpm> Date: Mon Apr 12 20:06:32 2004 +0000
[PATCH] summmit: increase MAX_MP_BUSSES
From: James Cleverdon <[email protected]>
Bump up MAX_MP_BUSSES for summit/generic subarch to cope with big IBM x440 systems.
BKrev: 407af6c8l8rvwRmEU-JHTS98MurIZA
include/asm-i386/mach-generic/mach_mpspec.h +3 -1
@@ -8,6 +8,8 @@ #define MAX_APICS 256#define MAX_IRQ_SOURCES 256 -#define MAX_MP_BUSSES 32 +/* Summit or generic (i.e. installer) kernels need lots of bus entries. */ +/* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. */ +#define MAX_MP_BUSSES 260#endif /* __ASM_MACH_MPSPEC_H */
include/asm-i386/mach-summit/mach_mpspec.h +2 -1
@@ -8,6 +8,7 @@ #define MAX_APICS 256#define MAX_IRQ_SOURCES 256 -#define MAX_MP_BUSSES 32 +/* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. */ +#define MAX_MP_BUSSES 260#endif /* __ASM_MACH_MPSPEC_H */
Quoted 24 lines · Andrew Morton
Quoted 7 lines · On Fri, 15 Sep 2006 11:23:49 -0400 Dave Jones <[email protected]> wrote:
Quoted 5 lines · Andrew Morton
Quoted 5 lines
Quoted 4 lines
Thanks. Andi has already queued a similar patch.
Andi, you might as well scoot that upstream, otherwise we'll get lots of emails about it.
...
Quoted 9 lines
Quoted 4 lines
Quoted 3 lines
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +1
-0+#if 0xFF >= MAX_MP_BUSSES if (m->mpc_busid >= MAX_MP_BUSSES) {I don't know how Andi has fixed it,
Same thing. (He has `#if
MAX_MP_BUSSES< 256').How can this be the right the right thing to do ?
It should *never* be >=256. mach-summit/mach-generic need fixing to be 255, not this ridiculous band-aid. Where did 260 come from anyway?commit
f0bacaf5cec4e677a00b5ab06d95664d03a30f7aAuthor: akpm <akpm> Date: Mon Apr 12 20:06:32 2004 +0000
Quoted 6 lines
[PATCH] summmit: increase
MAX_MP_BUSSESFrom: James Cleverdon <[email protected]>
Bump up
MAX_MP_BUSSESfor summit/generic subarch to cope with big IBM x440 systems.
The 260 is because ACPI can create larger busses and the summit boxes only run with ACPI anyways.
-Andi