From 9891cf205746ca0c7c997f555bc993153ba82e31 Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Mon, 27 Jun 2022 11:25:35 +0200 Subject: [PATCH] netbsd/openbsd: Remove extraneous parentheses around ioctl call Signed-off-by: Tormod Volden --- libusb/os/netbsd_usb.c | 14 +++++++------- libusb/os/openbsd_usb.c | 10 +++++----- libusb/version_nano.h | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libusb/os/netbsd_usb.c b/libusb/os/netbsd_usb.c index d8f37ea61..fe716f422 100644 --- a/libusb/os/netbsd_usb.c +++ b/libusb/os/netbsd_usb.c @@ -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); diff --git a/libusb/os/openbsd_usb.c b/libusb/os/openbsd_usb.c index 3e660996f..2a85d1f9b 100644 --- a/libusb/os/openbsd_usb.c +++ b/libusb/os/openbsd_usb.c @@ -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); diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 4f6f04474..83cb882e3 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11804 +#define LIBUSB_NANO 11805