Re: [PATCH 1/2] drivers: staging: wilc1000: Replace message queue with standard Linux lists
From: Dan Carpenter <hidden>
Date: 2015-09-30 13:22:47
Also in:
lkml
From: Dan Carpenter <hidden>
Date: 2015-09-30 13:22:47
Also in:
lkml
On Wed, Sep 30, 2015 at 06:12:50PM +0530, Chandra Gorentla wrote:
quoted
quoted
while (1) { - wilc_mq_recv(&gMsgQHostIF, &msg, sizeof(struct host_if_msg), &u32Ret); + ret = wilc_mq_recv(&gMsgQHostIF, &msg, + sizeof(struct host_if_msg), &u32Ret); + if (ret) + continue; +I asked before if this was a forever loop and never got a response. Also what does this have to do with list macros?The only exit condition of this loop is to receive a message 'HOST_IF_MSG_EXIT'. If this check is not there and 'wilc_mq_recv' returns an error, the switch case below it will be executed for the previously received message.
Oh, hm... It looks like wilc_mq_recv() can return -EFAULT, -EOVERFLOW or success here. If it returns -EFUALT is calling wilc_mq_recv() again really the right thing? I suspect we should break in that case. We should probably at least sleep for a bit intsead of looping so tightly if it returns -EOVERFLOW? I'm not sure. regards, dan carpenter