netbsd/openbsd: Remove extraneous parentheses around ioctl call

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
This commit is contained in:
Tormod Volden
2022-06-27 11:25:35 +02:00
parent 0a29e4f906
commit 9891cf2057
3 changed files with 13 additions and 13 deletions

View File

@@ -259,7 +259,7 @@ netbsd_get_config_descriptor(struct libusb_device *dev, uint8_t idx,
ufd.ufd_size = len;
ufd.ufd_data = buf;
if ((ioctl(fd, USB_GET_FULL_DESC, &ufd)) < 0) {
if (ioctl(fd, USB_GET_FULL_DESC, &ufd) < 0) {
err = errno;
if (dpriv->fd < 0)
close(fd);
@@ -476,7 +476,7 @@ _cache_active_config_descriptor(struct libusb_device *dev, int fd)
ucd.ucd_config_index = USB_CURRENT_CONFIG_INDEX;
if ((ioctl(fd, USB_GET_CONFIG_DESC, &ucd)) < 0)
if (ioctl(fd, USB_GET_CONFIG_DESC, &ucd) < 0)
return _errno_to_libusb(errno);
usbi_dbg(DEVICE_CTX(dev), "active bLength %d", ucd.ucd_desc.bLength);
@@ -492,7 +492,7 @@ _cache_active_config_descriptor(struct libusb_device *dev, int fd)
usbi_dbg(DEVICE_CTX(dev), "index %d, len %d", ufd.ufd_config_index, len);
if ((ioctl(fd, USB_GET_FULL_DESC, &ufd)) < 0) {
if (ioctl(fd, USB_GET_FULL_DESC, &ufd) < 0) {
free(buf);
return _errno_to_libusb(errno);
}
@@ -533,10 +533,10 @@ _sync_control_transfer(struct usbi_transfer *itransfer)
if ((transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) == 0)
req.ucr_flags = USBD_SHORT_XFER_OK;
if ((ioctl(dpriv->fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0)
if (ioctl(dpriv->fd, USB_SET_TIMEOUT, &transfer->timeout) < 0)
return _errno_to_libusb(errno);
if ((ioctl(dpriv->fd, USB_DO_REQUEST, &req)) < 0)
if (ioctl(dpriv->fd, USB_DO_REQUEST, &req) < 0)
return _errno_to_libusb(errno);
itransfer->transferred = req.ucr_actlen;
@@ -595,12 +595,12 @@ _sync_gen_transfer(struct usbi_transfer *itransfer)
if ((fd = _access_endpoint(transfer)) < 0)
return _errno_to_libusb(errno);
if ((ioctl(fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0)
if (ioctl(fd, USB_SET_TIMEOUT, &transfer->timeout) < 0)
return _errno_to_libusb(errno);
if (IS_XFERIN(transfer)) {
if ((transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) == 0)
if ((ioctl(fd, USB_SET_SHORT_XFER, &nr)) < 0)
if (ioctl(fd, USB_SET_SHORT_XFER, &nr) < 0)
return _errno_to_libusb(errno);
nr = read(fd, transfer->buffer, transfer->length);

View File

@@ -594,17 +594,17 @@ _sync_control_transfer(struct usbi_transfer *itransfer)
if ((fd = _bus_open(transfer->dev_handle->dev->bus_number)) < 0)
return _errno_to_libusb(errno);
if ((ioctl(fd, USB_REQUEST, &req)) < 0) {
if (ioctl(fd, USB_REQUEST, &req) < 0) {
err = errno;
close(fd);
return _errno_to_libusb(err);
}
close(fd);
} else {
if ((ioctl(dpriv->fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0)
if (ioctl(dpriv->fd, USB_SET_TIMEOUT, &transfer->timeout) < 0)
return _errno_to_libusb(errno);
if ((ioctl(dpriv->fd, USB_DO_REQUEST, &req)) < 0)
if (ioctl(dpriv->fd, USB_DO_REQUEST, &req) < 0)
return _errno_to_libusb(errno);
}
@@ -668,12 +668,12 @@ _sync_gen_transfer(struct usbi_transfer *itransfer)
if ((fd = _access_endpoint(transfer)) < 0)
return _errno_to_libusb(errno);
if ((ioctl(fd, USB_SET_TIMEOUT, &transfer->timeout)) < 0)
if (ioctl(fd, USB_SET_TIMEOUT, &transfer->timeout) < 0)
return _errno_to_libusb(errno);
if (IS_XFERIN(transfer)) {
if ((transfer->flags & LIBUSB_TRANSFER_SHORT_NOT_OK) == 0)
if ((ioctl(fd, USB_SET_SHORT_XFER, &nr)) < 0)
if (ioctl(fd, USB_SET_SHORT_XFER, &nr) < 0)
return _errno_to_libusb(errno);
nr = read(fd, transfer->buffer, transfer->length);

View File

@@ -1 +1 @@
#define LIBUSB_NANO 11804
#define LIBUSB_NANO 11805