Skip to content

Commit ea595e7

Browse files
Dominique van den Broeckgregkh
authored andcommitted
fwserial: (coding style) if/else bracket matching
Style-only modifications to make checkpatch.pl --file --strict a bit happier. if/else bracket matching (either none or both options should be bracketed). Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 340bb3d commit ea595e7

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

‎drivers/staging/fwserial/fwserial.c‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,9 @@ static void fwtty_port_handler(struct fw_card *card,
638638

639639
switch (tcode) {
640640
case TCODE_WRITE_QUADLET_REQUEST:
641-
if (addr != port->rx_handler.offset || len != 4)
641+
if (addr != port->rx_handler.offset || len != 4) {
642642
rcode = RCODE_ADDRESS_ERROR;
643-
else {
643+
} else {
644644
fwtty_update_port_status(port, *(unsigned *)data);
645645
rcode = RCODE_COMPLETE;
646646
}
@@ -756,11 +756,11 @@ static int fwtty_tx(struct fwtty_port *port, bool drain)
756756

757757
if (n < 0) {
758758
kmem_cache_free(fwtty_txn_cache, txn);
759-
if (n == -EAGAIN)
759+
if (n == -EAGAIN) {
760760
++port->stats.tx_stall;
761-
else if (n == -ENODATA)
761+
} else if (n == -ENODATA) {
762762
fwtty_profile_data(port->stats.txns, 0);
763-
else {
763+
} else {
764764
++port->stats.fifo_errs;
765765
fwtty_err_ratelimited(port, "fifo err: %d\n",
766766
n);
@@ -1264,8 +1264,9 @@ static int set_serial_info(struct fwtty_port *port,
12641264
if (((tmp.flags & ~ASYNC_USR_MASK) !=
12651265
(port->port.flags & ~ASYNC_USR_MASK)))
12661266
return -EPERM;
1267-
} else
1267+
} else {
12681268
port->port.close_delay = tmp.close_delay * HZ / 100;
1269+
}
12691270

12701271
return 0;
12711272
}
@@ -1308,9 +1309,9 @@ static void fwtty_set_termios(struct tty_struct *tty, struct ktermios *old)
13081309
spin_lock_bh(&port->lock);
13091310
baud = set_termios(port, tty);
13101311

1311-
if ((baud == 0) && (old->c_cflag & CBAUD))
1312+
if ((baud == 0) && (old->c_cflag & CBAUD)) {
13121313
port->mctrl &= ~(TIOCM_DTR | TIOCM_RTS);
1313-
else if ((baud != 0) && !(old->c_cflag & CBAUD)) {
1314+
} else if ((baud != 0) && !(old->c_cflag & CBAUD)) {
13141315
if (C_CRTSCTS(tty) || !test_bit(TTY_THROTTLED, &tty->flags))
13151316
port->mctrl |= TIOCM_DTR | TIOCM_RTS;
13161317
else
@@ -1733,8 +1734,9 @@ static inline int fwserial_send_mgmt_sync(struct fwtty_peer *peer,
17331734
rcode == RCODE_GENERATION) {
17341735
fwtty_dbg(&peer->unit, "mgmt write error: %d\n", rcode);
17351736
continue;
1736-
} else
1737+
} else {
17371738
break;
1739+
}
17381740
} while (--tries > 0);
17391741
return rcode;
17401742
}
@@ -2744,9 +2746,9 @@ static int fwserial_parse_mgmt_write(struct fwtty_peer *peer,
27442746
break;
27452747

27462748
case FWSC_VIRT_CABLE_UNPLUG_RSP:
2747-
if (peer->state != FWPS_UNPLUG_PENDING)
2749+
if (peer->state != FWPS_UNPLUG_PENDING) {
27482750
rcode = RCODE_CONFLICT_ERROR;
2749-
else {
2751+
} else {
27502752
if (be16_to_cpu(pkt->hdr.code) & FWSC_RSP_NACK)
27512753
fwtty_notice(&peer->unit, "NACK unplug?\n");
27522754
port = peer_revert_state(peer);

0 commit comments

Comments
 (0)