2011-04-26 12:21:50     simple_driver.c Error

Document created by Aaronwu Employee on Aug 26, 2013
Version 1Show Document
  • View in full screen mode

2011-04-26 12:21:50     simple_driver.c Error

Sergio Morales (COLOMBIA)

Message: 100173   

 

Hi, I'm trying to compile the code "simple_driver.c" ... but I get the following errors:

 

checho@checho-kde:~/ecb-bf532/Linux/blackfin-linux-dist/linux-2.6.x$ make

  CHK     include/linux/version.h

  CHK     include/generated/utsrelease.h

  CALL    scripts/checksyscalls.sh

  CHK     include/generated/compile.h

  CC      drivers/char/test/simple_driver.o

drivers/char/test/simple_driver.c: In function ‘scmd_exit’:

drivers/char/test/simple_driver.c:77: error: void value not ignored as it ought to be

drivers/char/test/simple_driver.c: In function ‘scmd_open’:

drivers/char/test/simple_driver.c:115: error: implicit declaration of function ‘scmd_start’

drivers/char/test/simple_driver.c: In function ‘scmd_read’:

drivers/char/test/simple_driver.c:178: warning: passing argument 1 of ‘copy_to_user’ makes integer from pointer without a cast

drivers/char/test/simple_driver.c:178: warning: passing argument 2 of ‘copy_to_user’ makes integer from pointer without a cast

drivers/char/test/simple_driver.c: In function ‘scmd_write’:

drivers/char/test/simple_driver.c:203: warning: passing argument 1 of ‘copy_from_user’ makes integer from pointer without a cast

drivers/char/test/simple_driver.c:203: warning: passing argument 2 of ‘copy_from_user’ makes integer from pointer without a cast

make[3]: *** [drivers/char/test/simple_driver.o] Error 1

make[2]: *** [drivers/char/test] Error 2

make[1]: *** [drivers/char] Error 2

make: *** [drivers] Error 2

checho@checho-kde:~/ecb-bf532/Linux/blackfin-linux-dist/linux-2.6.x$

Attached the code I'm using

thanks for any help

 

simple_driver.c

QuoteReplyEditDelete

 

 

2011-04-26 12:49:44     Re: simple_driver.c Error

Mike Frysinger (UNITED STATES)

Message: 100176   

 

the warnings are telling you the problems fairly clearly.  look at the line # each one is warning about in the source.

QuoteReplyEditDelete

 

 

2011-04-26 13:36:23     Re: simple_driver.c Error

Sergio Morales (COLOMBIA)

Message: 100178   

 

Well, I really tried to fix the errors but I am a little amateur ... if you read the simple_driver.c that I added you will see that is exactly what it says in the pages of blackfin:

 

  docs.blackfin.uclinux.org/doku.php?id=basic_char_driver

  docs.blackfin.uclinux.org/doku.php?id=basic_open_close_functions

  docs.blackfin.uclinux.org/doku.php?id=basic_read_write_functions

  docs.blackfin.uclinux.org/doku.php?id=basic_driver_completion

  docs.blackfin.uclinux.org/doku.php?id=basic_driver_configure_and_build

 

And I thought it was enough to add code and compile it, if you can fix the official documentation I would be grateful

QuoteReplyEditDelete

 

 

2011-04-26 14:17:35     Re: simple_driver.c Error

Mike Frysinger (UNITED STATES)

Message: 100179   

 

ive fixed the relevant pieces of the documentation

QuoteReplyEditDelete

 

 

2011-04-27 21:31:39     Re: simple_driver.c Error

Sergio Morales (COLOMBIA)

Message: 100217   

 

thanks mike for correct documentation, and it worked well.

 

attached the code with the corrections

 

simple_driver.c

QuoteReplyEditDelete

Outcomes