LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Compile kernel driver failed when processing __user (https://www.linuxquestions.org/questions/linux-kernel-70/compile-kernel-driver-failed-when-processing-__user-4175491703/)

915086731 01-18-2014 08:19 AM

Compile kernel driver failed when processing __user
 
I get a compile error when compiling a kernel driver.The error info is
Code:

pxa270_gpio_led_drv.c|27 col 70| error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
||  static ssize_t SIMPLE_GPIO_LED_read ( struct file *file, char __user *buf, size_t count, loff_t *offset)

Part of the source file is:
Code:

static ssize_t SIMPLE_GPIO_LED_read ( struct file *file, char __user *buf, size_t count, loff_t *offset)
{
#ifdef OURS_GPIO_LED_DEBUG
printk ("SIMPLE_GPIO_LED_read [ --kernel--]\n");
#endif
return count;
}

The compile command is :
Code:

gcc -c -Wall -O -D__KERNEL__ -DMODULE -I/home/test/Desktop/linux-2.4.21/include  pxa270_gpio_led_drv.c -o pxa270_gpio_led_drv.o
Can anyone help me? Thanks.

smallpond 01-19-2014 06:46 PM

I don't recall seeing gcc print the source line with '|| ' at the beginning of the line. What version are you using?

ianbb01 01-30-2014 09:35 AM

You probably have an undefined type
 
You probably have an undefined type. Make sure that __user macro is properly defined.


All times are GMT -5. The time now is 04:25 PM.