On 2013.06.13 21:39, Hans de Goede wrote: > + switch (errno) { > + case EBUSY: > + return LIBUSB_ERROR_BUSY; > + case EINVAL: > + return LIBUSB_ERROR_INVALID_PARAM; > + case ENODEV: > + return LIBUSB_ERROR_NO_DEVICE; > + }
I seem to remember that Ludovic is using a compiler that complains when a switch is missing a default case. Maybe we want to add one? > + usbi_err(HANDLE_CTX(handle), > + "disconnect-and-claim failed errno %d", errno); > + return LIBUSB_ERROR_OTHER; It's usually nice when we can avoid ERROR_OTHER, because this is the least helpful error to return. Not sure if there's a better code we could use here, but just wanted to point that out. > + /* Fallback code for kernels which don't support the dc ioctl */ Could "dc" be replaced with "disconnect-and-claim" here? It's easy to figure out when you look at a patch that deals with disconnect-and-claim, but in n months time, when someone wants to add code to this section, it might not be so explicit what dc was about. Again, very minor issues, so ack. Regards, /Pete ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel