views:

51

answers:

1

hello i want to work with 2 queue in the module where i change my pointer to them therefore i need to use :

//declartion
wait_queue_head_t **currentQ;
DECLARE_WAIT_QUEUE_HEAD (readWaitQ1);
DECLARE_WAIT_QUEUE_HEAD (readWaitQ2);

if(condition){
    currentQ = &readWaitQ1;
}else{
    currentQ = &readWaitQ2;
}

but i get incorrect type for wake_up an other stuff using the queue. even thought i google it i couldnt find an answer can someone just give me the prototype needed?...

+1  A: 

Since the macro is (see here):

#define DECLARE_WAIT_QUEUE_HEAD(name) \
    wait_queue_head_t name = __WAIT_QUEUE_HEAD_INITIALIZER(name)

that means that:

DECLARE_WAIT_QUEUE_HEAD (readWaitQ1);

translates to:

wait_queue_head_t readWaitQ1 = ...;

Now with your current code:

wait_queue_head_t **currentQ;
currentQ = &readWaitQ1;

you have one too many indirections on currentQ. You should try:

wait_queue_head_t *currentQ;

instead.

paxdiablo
thanks , i used other functiones where the compiler didnt yelled at me and that got me confused
yoavstr