* sparse and mips
@ 2005-02-27 23:24 Jeroen Vreeken
2005-02-28 12:11 ` Ralf Baechle
0 siblings, 1 reply; 7+ messages in thread
From: Jeroen Vreeken @ 2005-02-27 23:24 UTC (permalink / raw)
To: linux-mips
Hi,
I tried compiling my switch driver with sparse to see if I did some
stupid casts and got a lot of warnings.... (attached below)
Are others using sparse with mips kernels and getting the same?
Or has nobody taken the time to fix it up?
(The byteorder stuff should creap up everywhere or not?)
Jeroen
pe1rxq@laptop:~/edimax/linux-2.6.10-adm$ make vmlinuz C=1
CHK include/linux/version.h
make[1]: `arch/mips/kernel/offset.s' is up to date.
CHK include/asm-mips/offset.h
make[1]: `arch/mips/kernel/reg.s' is up to date.
CHK include/asm-mips/reg.h
CHK include/linux/compile.h
CHK usr/initramfs_list
CHECK drivers/net/adm5120sw.c
include/asm/byteorder.h:27:4: warning: "MIPS, but neither __MIPSEB__,
nor __MIPSEL__???"
include/linux/kernel.h:200:2: warning: "Please fix asm/byteorder.h"
include/linux/aio_abi.h:59:2: warning: edit for your odd byteorder.
include/linux/types.h:24:26: warning: Expected ; at end of declaration
include/linux/types.h:24:26: warning: got nlink_t
include/linux/types.h:64:26: warning: Expected ; at end of declaration
include/linux/types.h:64:26: warning: got size_t
include/linux/types.h:69:26: warning: Expected ; at end of declaration
include/linux/types.h:69:26: warning: got ssize_t
include/linux/types.h:74:28: warning: Expected ; at end of declaration
include/linux/types.h:74:28: warning: got ptrdiff_t
include/asm/bitops.h:75:9: warning: Expected ) after asm
include/asm/bitops.h:75:9: warning: got __LL
include/asm/bitops.h:83:9: warning: Expected ) after asm
include/asm/bitops.h:83:9: warning: got __LL
include/asm/bitops.h:135:9: warning: Expected ) after asm
include/asm/bitops.h:135:9: warning: got __LL
include/asm/bitops.h:143:9: warning: Expected ) after asm
include/asm/bitops.h:143:9: warning: got __LL
include/asm/bitops.h:194:9: warning: Expected ) after asm
include/asm/bitops.h:194:9: warning: got __LL
include/asm/bitops.h:205:9: warning: Expected ) after asm
include/asm/bitops.h:205:9: warning: got __LL
include/asm/bitops.h:256:9: warning: Expected ) after asm
include/asm/bitops.h:256:9: warning: got __LL
include/asm/bitops.h:275:9: warning: Expected ) after asm
include/asm/bitops.h:275:9: warning: got __LL
include/asm/bitops.h:346:9: warning: Expected ) after asm
include/asm/bitops.h:346:9: warning: got __LL
include/asm/bitops.h:366:9: warning: Expected ) after asm
include/asm/bitops.h:366:9: warning: got __LL
include/asm/bitops.h:438:9: warning: Expected ) after asm
include/asm/bitops.h:438:9: warning: got __LL
include/asm/bitops.h:457:9: warning: Expected ) after asm
include/asm/bitops.h:457:9: warning: got __LL
include/linux/kernel.h:83:40: warning: Expected ) in function declarator
include/linux/kernel.h:83:40: warning: got size
include/linux/kernel.h:85:40: warning: Expected ) in function declarator
include/linux/kernel.h:85:40: warning: got size
include/linux/kernel.h:86:41: warning: Expected ) in function declarator
include/linux/kernel.h:86:41: warning: got size
include/linux/kernel.h:88:41: warning: Expected ) in function declarator
include/linux/kernel.h:88:41: warning: got size
include/asm/string.h:44:77: warning: Expected ) in function declarator
include/asm/string.h:44:77: warning: got __n
include/asm/string.h:48:11: warning: Expected ) in function declarator
include/asm/string.h:48:11: warning: got ==
include/asm/string.h:48:3: warning: Trying to use reserved word 'if' as
identifier
make[2]: *** [drivers/net/adm5120sw.o] Error 139
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sparse and mips
2005-02-27 23:24 sparse and mips Jeroen Vreeken
@ 2005-02-28 12:11 ` Ralf Baechle
2005-02-28 12:29 ` Geert Uytterhoeven
0 siblings, 1 reply; 7+ messages in thread
From: Ralf Baechle @ 2005-02-28 12:11 UTC (permalink / raw)
To: Jeroen Vreeken; +Cc: linux-mips
On Mon, Feb 28, 2005 at 12:24:19AM +0100, Jeroen Vreeken wrote:
> I tried compiling my switch driver with sparse to see if I did some
> stupid casts and got a lot of warnings.... (attached below)
> Are others using sparse with mips kernels and getting the same?
> Or has nobody taken the time to fix it up?
> (The byteorder stuff should creap up everywhere or not?)
Not to my knowledge. I always meant to as a preventive maintenance meassure
but somehow there was always something more important to do ...
> include/asm/byteorder.h:27:4: warning: "MIPS, but neither __MIPSEB__,
> nor __MIPSEL__???"
> include/linux/kernel.h:200:2: warning: "Please fix asm/byteorder.h"
A result of sparse not knowing about MIPS yet.
> include/linux/aio_abi.h:59:2: warning: edit for your odd byteorder.
Same.
The others don't really make sense at the first look.
73,
Ralf
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sparse and mips
2005-02-28 12:11 ` Ralf Baechle
@ 2005-02-28 12:29 ` Geert Uytterhoeven
2005-02-28 14:00 ` Jeroen Vreeken
0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2005-02-28 12:29 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Jeroen Vreeken, Linux/MIPS Development
On Mon, 28 Feb 2005, Ralf Baechle wrote:
> On Mon, Feb 28, 2005 at 12:24:19AM +0100, Jeroen Vreeken wrote:
> > I tried compiling my switch driver with sparse to see if I did some
> > stupid casts and got a lot of warnings.... (attached below)
> > Are others using sparse with mips kernels and getting the same?
> > Or has nobody taken the time to fix it up?
> > (The byteorder stuff should creap up everywhere or not?)
>
> Not to my knowledge. I always meant to as a preventive maintenance meassure
> but somehow there was always something more important to do ...
>
> > include/asm/byteorder.h:27:4: warning: "MIPS, but neither __MIPSEB__,
> > nor __MIPSEL__???"
> > include/linux/kernel.h:200:2: warning: "Please fix asm/byteorder.h"
>
> A result of sparse not knowing about MIPS yet.
>
> > include/linux/aio_abi.h:59:2: warning: edit for your odd byteorder.
>
> Same.
You're using 2.6.10?
When I played with sparse on m68k (cross-compile environment), I had to make
some modifications to arch/m68k/Makefile, to pass a few additional flags to
sparse in case of cross-compilation. Later these changes were moved to the main
Makefile, since they were valid for all architectures if cross-compilation was
involved.
So I suggest to take a look at CHECKFLAGS in the main Makefile of the latest
version (2.6.11-rc5) first, and see whether it works there.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
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
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: sparse and mips
2005-02-28 12:29 ` Geert Uytterhoeven
@ 2005-02-28 14:00 ` Jeroen Vreeken
2005-03-03 10:46 ` Ralf Baechle
0 siblings, 1 reply; 7+ messages in thread
From: Jeroen Vreeken @ 2005-02-28 14:00 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Ralf Baechle, Linux/MIPS Development
Geert Uytterhoeven wrote:
>You're using 2.6.10?
>
>When I played with sparse on m68k (cross-compile environment), I had to make
>some modifications to arch/m68k/Makefile, to pass a few additional flags to
>sparse in case of cross-compilation. Later these changes were moved to the main
>Makefile, since they were valid for all architectures if cross-compilation was
>involved.
>
>So I suggest to take a look at CHECKFLAGS in the main Makefile of the latest
>version (2.6.11-rc5) first, and see whether it works there.
>
>
Adding the following few lines fixes the problems with the headers (they
are normally defined by gcc)...
I am not sure that is all that is needed (the rest might just be me
doing bad things in my driver) but since they are mips specific I think
arch/mips/Makefile would be the right place for them:
CHECKFLAGS += -D__mips__
ifdef CONFIG_MIPS32
CHECKFLAGS += -D_MIPS_SZLONG=32
else
CHECKFLAGS += -D_MIPS_SZLONG=64
endif
ifdef CONFIG_CPU_LITTLE_ENDIAN
CHECKFLAGS += -D__MIPSEL__
else
CHECKFLAGS += -D__MIPSEB__
endif
Jeroen
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sparse and mips
2005-02-28 14:00 ` Jeroen Vreeken
@ 2005-03-03 10:46 ` Ralf Baechle
2005-03-03 11:38 ` Ulrich Eckhardt
0 siblings, 1 reply; 7+ messages in thread
From: Ralf Baechle @ 2005-03-03 10:46 UTC (permalink / raw)
To: Jeroen Vreeken; +Cc: Geert Uytterhoeven, Linux/MIPS Development
On Mon, Feb 28, 2005 at 03:00:44PM +0100, Jeroen Vreeken wrote:
> Adding the following few lines fixes the problems with the headers (they
> are normally defined by gcc)...
> I am not sure that is all that is needed (the rest might just be me
> doing bad things in my driver) but since they are mips specific I think
> arch/mips/Makefile would be the right place for them:
>
> CHECKFLAGS += -D__mips__
> ifdef CONFIG_MIPS32
> CHECKFLAGS += -D_MIPS_SZLONG=32
I went for something slightly more beautyful:
CHECKFLAGS-y += -D__linux__ -D__mips__
CHECKFLAGS-$(CONFIG_MIPS32) += -D_MIPS_SZLONG=32 \
-D__PTRDIFF_TYPE__=int
CHECKFLAGS-$(CONFIG_MIPS64) += -D_MIPS_SZLONG=64 \
-D__PTRDIFF_TYPE__="long int"
CHECKFLAGS-$(CONFIG_CPU_BIG_ENDIAN) += -D__MIPSEL__
CHECKFLAGS-$(CONFIG_CPU_LITTLE_ENDIAN) += -D__MIPSEL__
Still needs a few more symbols I guess. And I fixed a few of the worst
offenders, especially uaccess.h.
Ralf
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-03-03 11:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-27 23:24 sparse and mips Jeroen Vreeken
2005-02-28 12:11 ` Ralf Baechle
2005-02-28 12:29 ` Geert Uytterhoeven
2005-02-28 14:00 ` Jeroen Vreeken
2005-03-03 10:46 ` Ralf Baechle
2005-03-03 11:38 ` Ulrich Eckhardt
2005-03-03 11:50 ` Ralf Baechle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.