LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 11-04-2004, 04:20 AM   #1
7.e.Q
LQ Newbie
 
Registered: Nov 2003
Posts: 25

Rep: Reputation: 15
wait_event_interruptible - invalid lvalue in unary `&'


Hello,

I need your help. GCC gives me the errormessage

Code:
invalid lvalue in unary `&'
inside this function:

Code:
static int dpn_stop(struct net_device *dev)
{
	init_waitqueue_head(&dpn_wq_term);

	ioctl_disable_vme_int(3+(sgd->ctrl.un.diu_switch & 3));
	free_irq(sgd->ctrl.un.irq, 0);

	cli();
	dpn_run = 0;
	wait_event_interruptible(&dpn_wq_term, dpn_run == 0);

	return 0;
}
at the line with wait_event_interruptible... We can't find the mistake we made. What did we do wrong regarding syntax?

We are translating a driver from an old Linux Kernel 2.2.14 to the new architecture of the Kernel 2.6. And this is one of the problems we run into.

Thanks a lot

Hendrik

Last edited by 7.e.Q; 11-04-2004 at 05:08 AM.
 
Old 11-04-2004, 05:13 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
The problem is probably with the way you're using dpn_wq_term, which you have not defined in the above snippet.

I tried googling for wait_event_interruptible as I can't remember the syntax off-hand (I must get back into kernel hacking!) but I couldn't find anywhere that used an ampusand in the first parameter, so you might try ignoring it.

That's about as much help as I can give without seeing the declarations.
 
Old 11-04-2004, 05:21 AM   #3
7.e.Q
LQ Newbie
 
Registered: Nov 2003
Posts: 25

Original Poster
Rep: Reputation: 15
dpn_wq_term is defined globally. We use it inside several functions. Is this the problem?
 
Old 11-05-2004, 02:00 PM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
It's quite normal to use global variables inside kernel modules. The question is what kind of variable is it?

As a thought, you may want to remove the ampusand (&) from the call to the macro; the macro may well be inserting one itself.
 
Old 11-08-2004, 03:00 AM   #5
7.e.Q
LQ Newbie
 
Registered: Nov 2003
Posts: 25

Original Poster
Rep: Reputation: 15
Well, I removed the '&' and now it translates... Who can read is clearly in the advantage:

Code:
error: invalid lvalue in unary `&'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
question about wait_event_interruptible lordofring Programming 5 08-26-2005 04:04 AM
wait_event_interruptible with timeout lordofring Programming 1 08-17-2005 11:10 PM
RealPlayer10 & Invalid Metafile herkdrvr Linux - Software 1 09-21-2004 02:31 PM
ext3 & invalid unicode mfehr Fedora - Installation 1 06-05-2004 03:48 PM
Unary expressions loke137 Programming 1 08-17-2003 03:12 AM


All times are GMT -5. The time now is 10:14 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration