On Mon, Mar 16, 2015 at 11:08:29AM +0800, Peter Hung wrote:
Could you rewrite this as
if (status < 0)
status = usb_translate_errors(status);
else
status = 0;
In my definition the return value of set/getregister(), 0 is success,
negative values are errors. The function usb_control_msg() return value
is success transmited/received byte. It's maybe return 0. I want to
treat 0 with error(-EIO). But if pass 0 to usb_translate_errors(), It
will return 0 back. So I need especially handle with status == 0.
I meant to write
if (status < 0)
status = usb_translate_errors(status);
else
status = -EIO;
which I think is more readable.