Hi all, this is my first post here on LinuxQuestions and I really hope that you guys will be able to help me. I'm very new on Linux and I hope you all can understand the newbie question that I'm posting. (After all this is the newbie section

)
Here goes: I'm compiling a char device driver for Linux. It was formerly for kernel version 2.4.20-8 on Redhat and it was compiling working properly on that version. The problem comes when I am required to upgrade the kernel version from 2.4.20-8 to 2.6.18.
Fundamentally, I understand that there are major differences when using different kernel versions. However, as I am very new to the Linux environment and the error messages during compilation has nothing to do with device related errors, more of environment mismatch types, I am quite stuck.
I hope that the following error message that I paste can make some sense and provide some clues to you guys as to what I should do.
=====================================================================
/usr/src/linux/include/asm/rwsem.h: In function ‘__down_read’:
/usr/src/linux/include/asm/rwsem.h:106: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
/usr/src/linux/include/asm/rwsem.h: In function ‘__down_write’:
/usr/src/linux/include/asm/rwsem.h:158: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
/usr/src/linux/include/asm/rwsem.h: In function ‘__up_read’:
/usr/src/linux/include/asm/rwsem.h:195: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
/usr/src/linux/include/asm/rwsem.h:189: warning: unused variable ‘tmp’
/usr/src/linux/include/asm/rwsem.h: In function ‘__up_write’:
/usr/src/linux/include/asm/rwsem.h:221: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
/usr/src/linux/include/asm/rwsem.h: In function ‘__downgrade_write’:
/usr/src/linux/include/asm/rwsem.h:246: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
In file included from /usr/src/linux/include/linux/sched.h:20,
from /usr/src/linux/include/linux/module.h:10,
from client3.c:229:
/usr/src/linux/include/asm/semaphore.h: In function ‘down’:
/usr/src/linux/include/asm/semaphore.h:105: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
/usr/src/linux/include/asm/semaphore.h: In function ‘down_interruptible’:
/usr/src/linux/include/asm/semaphore.h:130: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
/usr/src/linux/include/asm/semaphore.h: In function ‘down_trylock’:
/usr/src/linux/include/asm/semaphore.h:155: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
/usr/src/linux/include/asm/semaphore.h: In function ‘up’:
/usr/src/linux/include/asm/semaphore.h:179: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
In file included from /usr/src/linux/include/asm/smp.h:18,
=======================================================================
I have tried to look this up on the internet, but I got nothing useful as of now. Any help here will be appreciated. Thanks in advance. =)