diff options
author | Johan Hovold <johan@kernel.org> | 2019-11-05 09:41:51 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-07 11:17:55 +0100 |
commit | 3c84f4bbe33f1f83a217499248a9f7dc20764040 (patch) | |
tree | 57600c96b58941dcf9b90bb08e8c6f98b210ecef /drivers/usb/misc | |
parent | a0cd1df9d3e2de949379738b9e2e06172494c5d8 (diff) | |
download | linux-stable-3c84f4bbe33f1f83a217499248a9f7dc20764040.tar.gz linux-stable-3c84f4bbe33f1f83a217499248a9f7dc20764040.tar.bz2 linux-stable-3c84f4bbe33f1f83a217499248a9f7dc20764040.zip |
USB: legousbtower: drop superfluous brackets
Drop superfluous brackets around single-line blocks.
Also add missing white space around operators in a for-expression being
modified.
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20191105084152.16322-14-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r-- | drivers/usb/misc/legousbtower.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index 6f34b3802332..6b7ea80d5876 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c @@ -481,12 +481,10 @@ static __poll_t tower_poll(struct file *file, poll_table *wait) poll_wait(file, &dev->write_wait, wait); tower_check_for_read_packet(dev); - if (dev->read_packet_length > 0) { + if (dev->read_packet_length > 0) mask |= EPOLLIN | EPOLLRDNORM; - } - if (!dev->interrupt_out_busy) { + if (!dev->interrupt_out_busy) mask |= EPOLLOUT | EPOLLWRNORM; - } return mask; } @@ -532,9 +530,8 @@ static ssize_t tower_read(struct file *file, char __user *buffer, size_t count, goto unlock_exit; } - if (read_timeout) { + if (read_timeout) timeout = jiffies + msecs_to_jiffies(read_timeout); - } /* wait for data */ tower_check_for_read_packet(dev); @@ -544,9 +541,8 @@ static ssize_t tower_read(struct file *file, char __user *buffer, size_t count, goto unlock_exit; } retval = wait_event_interruptible_timeout(dev->read_wait, dev->interrupt_in_done, dev->packet_timeout_jiffies); - if (retval < 0) { + if (retval < 0) goto unlock_exit; - } /* reset read timeout during read or write activity */ if (read_timeout @@ -572,9 +568,8 @@ static ssize_t tower_read(struct file *file, char __user *buffer, size_t count, spin_lock_irq(&dev->read_buffer_lock); dev->read_buffer_length -= bytes_to_read; dev->read_packet_length -= bytes_to_read; - for (i=0; i<dev->read_buffer_length; i++) { + for (i = 0; i < dev->read_buffer_length; i++) dev->read_buffer[i] = dev->read_buffer[i+bytes_to_read]; - } spin_unlock_irq(&dev->read_buffer_lock); retval = bytes_to_read; @@ -625,9 +620,8 @@ static ssize_t tower_write(struct file *file, const char __user *buffer, size_t } retval = wait_event_interruptible(dev->write_wait, !dev->interrupt_out_busy); - if (retval) { + if (retval) goto unlock_exit; - } } /* write the data into interrupt_out_buffer from userspace */ |