LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 01-18-2014, 08:19 AM   #1
915086731
Member
 
Registered: Apr 2010
Posts: 144
Blog Entries: 6

Rep: Reputation: 2
Unhappy 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.
 
Old 01-19-2014, 06:46 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,153

Rep: Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265
I don't recall seeing gcc print the source line with '|| ' at the beginning of the line. What version are you using?
 
Old 01-30-2014, 09:35 AM   #3
ianbb01
LQ Newbie
 
Registered: Jan 2014
Posts: 7

Rep: Reputation: 3
You probably have an undefined type

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

Last edited by ianbb01; 01-30-2014 at 09:36 AM.
 
  


Reply

Tags
compile error, driver, gcc, kernel



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with failed kernel compile messages. akrkhandelwal Linux - Embedded & Single-board computer 3 08-20-2012 08:10 AM
Kernel compile and upgrade failed yuchankit Slackware 9 06-06-2009 03:04 AM
Failed to compile kqemu on slack 11.0 + customized 2.6.18 kernel kite Slackware 2 10-14-2006 10:46 AM
kernel 2.6.8 compile error mkinitrd failed mcalizo Linux - Software 0 11-30-2004 01:58 AM
eth0 failed to start after kernel compile andy18 Linux - Networking 3 09-09-2003 09:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration