LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-08-2011, 03:07 AM   #1
taousif
LQ Newbie
 
Registered: Feb 2011
Posts: 18

Rep: Reputation: 0
Kernel module - void value not ignored as it ought to be


Hi,

I have written a small character driver, in the cleanup module at the line

int a=unregister_chrdev(Major,DEVICE_NAME);

I am getting the following error
error: void value not ignored as it ought to be

If the value return by unregister_chrdev() function is not stored in any variable it is working fine...

Please help.
Thank you.

Last edited by taousif; 02-08-2011 at 03:10 AM.
 
Old 02-09-2011, 12:06 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Here is unregister_chr (from linux/fs.h):
Code:
static inline void unregister_chrdev(unsigned int major, const char *name)
{
        __unregister_chrdev(major, 0, 256, name);
}
It is a "void" function.

Meaning THERE IS NO RETURN VALUE.

Hence the message.

Trying to get the return value of a "void" function is an error.

'Hope that helps .. PSM
 
Old 02-09-2011, 11:30 PM   #3
taousif
LQ Newbie
 
Registered: Feb 2011
Posts: 18

Original Poster
Rep: Reputation: 0
Thank you very much.
 
  


Reply



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
Void kernel hard break in fifo scheduler mode bastl Programming 2 12-13-2009 12:00 PM
Inserting void function into Linux Kernel 2.6.17.14 (Where to insert?) vmt1 Programming 2 04-29-2007 08:32 PM
[Error] Kernel Module : No kernel module build environment saman007uk Debian 7 09-09-2006 06:34 PM
kernel module ignorant newbie looking for any one with kernel module knowledge cpoet Slackware 4 11-24-2003 09:37 PM
void main(void) linuxanswer Programming 4 10-26-2003 12:37 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:47 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