diff options
-rw-r--r-- | usb_device.c | 16 | ||||
-rw-r--r-- | usb_device.h | 26 |
2 files changed, 21 insertions, 21 deletions
diff --git a/usb_device.c b/usb_device.c index 344c4cb90..5a468dd55 100644 --- a/usb_device.c +++ b/usb_device.c @@ -224,12 +224,12 @@ int usb_device_find(struct usb_match const *match, struct usb_device **devices) ret = LIBUSB(libusb_get_device_descriptor(list[i], &descriptor)); - if (ret != 0) { - msg_perr("USB: Failed to get device descriptor"); - free(*devices); - *devices = NULL; - return ret; - } + if (ret != 0) { + msg_perr("USB: Failed to get device descriptor"); + free(*devices); + *devices = NULL; + return ret; + } if (check_match(&match->vid, descriptor.idVendor) && check_match(&match->pid, descriptor.idProduct) && @@ -279,8 +279,8 @@ int usb_device_show(char const *prefix, struct usb_device *device) ret = usb_device_open(device); if (ret != 0) { - msg_perr("USB: Failed to open device\n"); - return ret; + msg_perr("USB: Failed to open device\n"); + return ret; } ret = LIBUSB(libusb_get_device_descriptor(device->device, &descriptor)); diff --git a/usb_device.h b/usb_device.h index 4abf751c6..8b7a80106 100644 --- a/usb_device.h +++ b/usb_device.h @@ -41,21 +41,21 @@ * flashrom recognizes. It also displays additional libusb specific * information about the failure. */ -#define LIBUSB(expression) \ - ({ \ - int libusb_error__ = (expression); \ +#define LIBUSB(expression) \ + ({ \ + int libusb_error__ = (expression); \ \ - if (libusb_error__ < 0) { \ - msg_perr("libusb error: %s:%d %s\n", \ - __FILE__, \ - __LINE__, \ - libusb_error_name(libusb_error__)); \ + if (libusb_error__ < 0) { \ + msg_perr("libusb error: %s:%d %s\n", \ + __FILE__, \ + __LINE__, \ + libusb_error_name(libusb_error__)); \ libusb_error__ = LIBUSB_ERROR(libusb_error__); \ - } else { \ - libusb_error__ = 0; \ - } \ + } else { \ + libusb_error__ = 0; \ + } \ \ - libusb_error__; \ + libusb_error__; \ }) /* @@ -64,7 +64,7 @@ */ static inline bool usb_device_is_libusb_error(int error_code) { - return (0x20000 <= error_code && error_code < 0x20064); + return (0x20000 <= error_code && error_code < 0x20064); } /* |