Skip to content

Commit 18de712

Browse files
can: slcan: clean up if/else
Remove braces after if() for single statement blocks, also remove else after return() in if() block. Link: https://lore.kernel.org/all/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent 69a6539 commit 18de712

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/net/can/slcan/slcan-core.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -469,19 +469,19 @@ static void slcan_unesc(struct slcan *sl, unsigned char s)
469469
{
470470
if ((s == '\r') || (s == '\a')) { /* CR or BEL ends the pdu */
471471
if (!test_and_clear_bit(SLF_ERROR, &sl->flags) &&
472-
(sl->rcount > 4)) {
472+
sl->rcount > 4)
473473
slc_bump(sl);
474-
}
474+
475475
sl->rcount = 0;
476476
} else {
477477
if (!test_bit(SLF_ERROR, &sl->flags)) {
478478
if (sl->rcount < SLC_MTU) {
479479
sl->rbuff[sl->rcount++] = s;
480480
return;
481-
} else {
482-
sl->dev->stats.rx_over_errors++;
483-
set_bit(SLF_ERROR, &sl->flags);
484481
}
482+
483+
sl->dev->stats.rx_over_errors++;
484+
set_bit(SLF_ERROR, &sl->flags);
485485
}
486486
}
487487
}
@@ -1104,9 +1104,8 @@ static void __exit slcan_exit(void)
11041104
continue;
11051105

11061106
sl = netdev_priv(dev);
1107-
if (sl->tty) {
1107+
if (sl->tty)
11081108
netdev_err(dev, "tty discipline still running\n");
1109-
}
11101109

11111110
slc_close(dev);
11121111
unregister_candev(dev);

0 commit comments

Comments
 (0)