From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Juergen Stuber <starblue@users.sourceforge.net>,
legousb-devel@lists.sourceforge.net, linux-usb@vger.kernel.org,
Johan Hovold <johan@kernel.org>
Subject: [PATCH 13/14] USB: legousbtower: drop superfluous brackets
Date: Tue, 5 Nov 2019 09:41:51 +0100 [thread overview]
Message-ID: <20191105084152.16322-14-johan@kernel.org> (raw)
In-Reply-To: <20191105084152.16322-1-johan@kernel.org>
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>
---
drivers/usb/misc/legousbtower.c | 18 ++++++------------
1 file 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 */
--
2.23.0
next prev parent reply other threads:[~2019-11-05 8:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-05 8:41 [PATCH 00/14] USB: legousbtower: misc cleanups Johan Hovold
2019-11-05 8:41 ` [PATCH 01/14] USB: legousbtower: drop redundant MODULE_LICENSE ifdef Johan Hovold
2019-11-05 8:41 ` [PATCH 02/14] USB: legousbtower: drop redundant NULL check Johan Hovold
2019-11-05 8:41 ` [PATCH 03/14] USB: legousbtower: zero driver data at allocation Johan Hovold
2019-11-05 8:41 ` [PATCH 04/14] USB: legousbtower: drop redundant open_count check Johan Hovold
2019-11-05 8:41 ` [PATCH 05/14] USB: legousbtower: drop noisy disconnect messages Johan Hovold
2019-11-05 8:41 ` [PATCH 06/14] USB: legousbtower: drop redundant interrupt-in running flag Johan Hovold
2019-11-05 8:41 ` [PATCH 07/14] USB: legousbtower: stop interrupt-out URB unconditionally Johan Hovold
2019-11-05 8:41 ` [PATCH 08/14] USB: legousbtower: remove tower_abort_transfers() Johan Hovold
2019-11-05 8:41 ` [PATCH 09/14] USB: legousbtower: clean up pointer declarations in driver data Johan Hovold
2019-11-05 8:41 ` [PATCH 10/14] USB: legousbtower: drop unnecessary packed attributes Johan Hovold
2019-11-05 8:41 ` [PATCH 11/14] USB: legousbtower: drop redundant endianness comments Johan Hovold
2019-11-05 8:41 ` [PATCH 12/14] USB: legousbtower: clean up runaway white space Johan Hovold
2019-11-05 8:41 ` Johan Hovold [this message]
2019-11-05 8:41 ` [PATCH 14/14] USB: legousbtower: drop superfluous newlines Johan Hovold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191105084152.16322-14-johan@kernel.org \
--to=johan@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=legousb-devel@lists.sourceforge.net \
--cc=linux-usb@vger.kernel.org \
--cc=starblue@users.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).