[PATCH 1/2] drivers: staging: wilc1000: Replace message queue with standard Linux lists

Dan Carpenter dan.carpenter at oracle.com
Wed Sep 30 13:22:07 UTC 2015


On Wed, Sep 30, 2015 at 06:12:50PM +0530, Chandra Gorentla wrote:
> > >  	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



More information about the devel mailing list