Subject: Re: [PATCH V3 3/7] Drivers: hv: vmbus: add APIs to send/recv hvsock packet and get the r/w-ability

From: Dan Carpenter <[email-masked]>
Date: Wed, 22 Jul 2015 13:35:46 +0300

On Wed, Jul 22, 2015 at 10:09:10AM +0000, Dexuan Cui wrote:
> > I'd suggest you do something like
> > 
> >     if (ret == -EAGIAIN)
> >         return 0;
> >     else if (ret)
> >         return ret;
> > 
> > to make it future-proof (e.g. when a new error is returned by
> > hv_ringbuffer_peek). And a comment would also be useful as it is unclear
> > why we silence errors here.
> Hi Vitaly,
> Thanks! 
> I think I made a mistake here:
> the "if (ret != 0) return 0;" should be changed
> to   "if (ret != 0) return ret;"

The double negative really doesn't not make the code more complicated.
I like using a quadruple negative instead.

	if (ret != 0 != 0)
		return ret;

regards,
dan carpenter