Skip to contentSkip to conversation

Mtd compile fails on ppc arch

DISCUSSION Li Yang 2 participants 3 messages Feb 3, 2004 Memory technology devices (MTD)

lore
Share & tools
lore

Li Yang

author
#0 lore raw

Hi,

I updated the mtd driver in kernel through the latest snapshot. I have tested kernel 2.4.20 and 2.4.22. The same parse error occurred for ppc arch. I have tried two cross toolchains, the results are the same. So it's unlikely to be cross compiler problem. Btw: i386 compiles well. I looked into some code, the problem seems to be related to headers. But I can't figure it out. Does anyone have a clue?

powerpc-linux-gcc -D__KERNEL__ -I/home/leo/beijing/project/pq27/linux-2.4.22/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -I/home/leo/beijing/project/pq27/linux-2.4.22/arch/ppc -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring -nostdinc -iwithprefix include -DKBUILD_BASENAME=sharp -c -o sharp.o sharp.c
sharp.c: In function `sharp_probe':
sharp.c:115: warning: implicit declaration of function `kmalloc' sharp.c:115: warning: assignment makes pointer from integer without a cast
sharp.c:119: warning: assignment makes pointer from integer without a cast
sharp.c:121: warning: implicit declaration of function `kfree' sharp.c: At top level:
sharp.c:577: parse error before sharp_probe_init' sharp.c:578: warning: return-type defaults to int' sharp.c:586: parse error before sharp_probe_exit' sharp.c:587: warning: return-type defaults to int'
sharp.c: In function `sharp_probe_exit':
sharp.c:589: warning: control reaches end of non-void function sharp.c: At top level:
sharp.c:591: warning: type defaults to int' in declaration of module_init'
sharp.c:591: warning: parameter names (without types) in function declaration
sharp.c:591: warning: data definition has no type or storage class sharp.c:592: warning: type defaults to int' in declaration of module_exit'
sharp.c:592: warning: parameter names (without types) in function declaration
sharp.c:592: warning: data definition has no type or storage class make[4]: *** [sharp.o] Error 1
make[4]: Leaving directory `/home/leo/beijing/project/pq27/linux-2.4.22/drivers/ mtd/chips'
make[3]: *** [first_rule] Error 2
make[3]: Leaving directory `/home/leo/beijing/project/pq27/linux-2.4.22/drivers/ mtd/chips'
make[2]: *** [_subdir_chips] Error 2
make[2]: Leaving directory `/home/leo/beijing/project/pq27/linux-2.4.22/drivers/
mtd'
make[1]: *** [_subdir_mtd] Error 2
make[1]: Leaving directory `/home/leo/beijing/project/pq27/linux-2.4.22/drivers'
make: *** [_dir_drivers] Error 2

Regards,
Leo

#1 lore raw
Quoted 8 lines · Li Yang

Hi,

I updated the mtd driver in kernel through the latest snapshot. I have tested kernel 2.4.20 and 2.4.22. The same parse error occurred for ppc arch. I have tried two cross toolchains, the results are the same. So it's unlikely to be cross compiler problem. Btw: i386 compiles well. I looked into some code, the problem seems to be related to headers. But I can't figure it out. Does anyone have a clue?

#include <linux/slab.h>

Evidently it gets included somehow on i386 via one of the other headers we _do_ include -- but not on ppc. But sharp.c is deprecated and you should be using jedec_probe and cfi_cmdset_0002 instead.

Signature · 1 line
dwmw2
author
#2 lore raw
Quoted 10 lines · David Woodhouse
Quoted 8 lines · Li Yang

Hi,

I updated the mtd driver in kernel through the latest snapshot. I have tested kernel 2.4.20 and 2.4.22. The same parse error occurred for ppc arch. I have tried two cross toolchains, the results are the same. So it's unlikely to be cross compiler problem. Btw: i386 compiles well. I looked into some code, the problem seems to be related to headers. But I can't figure it out. Does anyone have a clue?

Quoted 4 lines

#include <linux/slab.h>

Evidently it gets included somehow on i386 via one of the other headers we _do_ include -- but not on ppc. But sharp.c is deprecated and you

Yes, sharp.c need linux/slab.h and linux/init.h to compile successfully which are removed from headers in linux/mtd like linux/mtd/map.h. After adding these two includes, it can compile well.

Quoted 1 line

should be using jedec_probe and cfi_cmdset_0002 instead.

Signature · 2 lines
Thank you,
Leo