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


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to