Welcome! Log In Create A New Profile

Advanced

Compiling error: "error: void value not ignored as it ought to be"

Posted by chihau 
Compiling error: "error: void value not ignored as it ought to be"
November 16, 2009 05:55PM
Hi everybody,

I am trying to compile a example from "The Linux Kernel Module Programming Guide" to create a file in the /proc file system, but I have the following error message when I trying to compile.

root@chihau-desktop:/home/chihau/Escritorio/kernel# make
make -C /lib/modules/2.6.27-14-generic/build M=/home/chihau/Escritorio/kernel modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.27-14-generic'
  CC [M]  /home/chihau/Escritorio/kernel/chardev.o
/home/chihau/Escritorio/kernel/chardev.c: In function ‘cleanup_module’:
/home/chihau/Escritorio/kernel/chardev.c:75: error: void value not ignored as it ought to be
make[2]: *** [/home/chihau/Escritorio/kernel/chardev.o] Error 1
make[1]: *** [_module_/home/chihau/Escritorio/kernel] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-14-generic'
make: *** [all] Error 2

The source code of the example is in http://www.tldp.org/LDP/lkmpg/2.6/html/x569.html#AEN687
unregister_chrdev() has no returns if new kernel, see also:
[linux.derkeiler.com]

-Pat
The Effo Staff
Effo Project, [effo.sourceforge.net]
Re: Compiling error: "error: void value not ignored as it ought to be"
November 18, 2009 11:38AM
Oh Thanks Pat,

How I could know if the unregister_chrdev() has a error when I call it?
If the unregister_chrdev() has an error, in general it means there's no such a char device so just ignore it.
If the device exists but unregister_chrdev() leads error(s), it means the kernel is in the unexpected status - maybe your code put the kernel in an unexpected status (e.g. operated invalid pointers); maybe others code did that - and you could do nothing.

Anyway all that you should do is just call unregister_chrdev() in your case.

-Pat
The Effo Staff
Effo Project, [effo.sourceforge.net]
Re: Compiling error: "error: void value not ignored as it ought to be"
December 04, 2009 08:26AM
There are better resources than what are you studing on
mr.chaka Wrote:
-------------------------------------------------------
> There are better resources than what are you
> studing on


wich ones?

jlmuniz.linux@gmail.com
Re: Compiling error: "error: void value not ignored as it ought to be"
February 08, 2018 08:45AM
JLmunix,

I agree with mr.chaka
For example, SameDayPapers service gives much more answers and is very useful for students.



Edited 1 time(s). Last edit at 02/08/2018 08:46AM by Catt Robertson.
Author:

Your Email:


Subject:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 22 plus 25?
Message: