From: SF Markus Elfring <elfring@users.sourceforge.net>
To: kernel-janitors@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 4/4] char/snsc: Delete unnecessary braces in five functions
Date: Mon, 16 Oct 2017 15:07:29 +0000 [thread overview]
Message-ID: <f9000a51-3629-bb5e-efd2-048200543793@users.sourceforge.net> (raw)
In-Reply-To: <cbedda27-97e7-7b11-b888-39e09f7deaa1@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 16 Oct 2017 16:48:24 +0200
Do not use curly brackets at some source code places
where a single statement should be sufficient.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/char/snsc.c | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c
index bec3bd966b1f..aea0ee083511 100644
--- a/drivers/char/snsc.c
+++ b/drivers/char/snsc.c
@@ -47,9 +47,9 @@ scdrv_interrupt(int irq, void *subch_data)
status = ia64_sn_irtr_intr(sd->sd_nasid, sd->sd_subch);
if (status > 0) {
- if (status & SAL_IROUTER_INTR_RECV) {
+ if (status & SAL_IROUTER_INTR_RECV)
wake_up(&sd->sd_rq);
- }
+
if (status & SAL_IROUTER_INTR_XMIT) {
ia64_sn_irtr_intr_disable
(sd->sd_nasid, sd->sd_subch,
@@ -165,14 +165,13 @@ scdrv_read(struct file *file, char __user *buf, size_t count, loff_t *f_pos)
/* somebody else has it now;
* if we're non-blocking, then exit...
*/
- if (file->f_flags & O_NONBLOCK) {
+ if (file->f_flags & O_NONBLOCK)
return -EAGAIN;
- }
+
/* ...or if we want to block, then do so here */
- if (down_interruptible(&sd->sd_rbs)) {
+ if (down_interruptible(&sd->sd_rbs))
/* something went wrong with wait */
return -ERESTARTSYS;
- }
}
/* anything to read? */
@@ -257,14 +256,13 @@ scdrv_write(struct file *file, const char __user *buf,
/* somebody else has it now;
* if we're non-blocking, then exit...
*/
- if (file->f_flags & O_NONBLOCK) {
+ if (file->f_flags & O_NONBLOCK)
return -EAGAIN;
- }
+
/* ...or if we want to block, then do so here */
- if (down_interruptible(&sd->sd_wbs)) {
+ if (down_interruptible(&sd->sd_wbs))
/* something went wrong with wait */
return -ERESTARTSYS;
- }
}
count = min((int) count, CHUNKSIZE);
@@ -336,12 +334,11 @@ scdrv_poll(struct file *file, struct poll_table_struct *wait)
spin_unlock_irqrestore(&sd->sd_rlock, flags);
if (status > 0) {
- if (status & SAL_IROUTER_INTR_RECV) {
+ if (status & SAL_IROUTER_INTR_RECV)
mask |= POLLIN | POLLRDNORM;
- }
- if (status & SAL_IROUTER_INTR_XMIT) {
+
+ if (status & SAL_IROUTER_INTR_XMIT)
mask |= POLLOUT | POLLWRNORM;
- }
}
return mask;
@@ -450,9 +447,8 @@ scdrv_init(void)
/* on the console nasid, prepare to receive
* system controller environmental events
*/
- if(scd->scd_nasid = event_nasid) {
+ if (scd->scd_nasid = event_nasid)
scdrv_event_init(scd);
- }
}
return 0;
}
--
2.14.2
next prev parent reply other threads:[~2017-10-16 15:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-16 15:02 [PATCH 0/4] char-SNSC: Adjustments for six function implementations SF Markus Elfring
2017-10-16 15:04 ` [PATCH 1/4] char/snsc: Adjust one function call together with a variable assignment SF Markus Elfring
2017-10-16 15:05 ` [PATCH 2/4] char/snsc: Delete three error messages for a failed memory allocation SF Markus Elfring
2017-10-16 15:06 ` [PATCH 3/4] char/snsc: Improve a size determination in two functions SF Markus Elfring
2017-10-16 15:07 ` SF Markus Elfring [this message]
2017-10-17 8:49 ` [PATCH 4/4] char/snsc: Delete unnecessary braces in five functions Dan Carpenter
2017-10-17 9:11 ` SF Markus Elfring
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=f9000a51-3629-bb5e-efd2-048200543793@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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