Skip to content

Commit

Permalink
can: slcan: clean up if/else
Browse files Browse the repository at this point in the history
Remove braces after if() for single statement blocks, also remove else
after return() in if() block.

Link: https://lore.kernel.org/all/20220704125954.1587880-6-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Marc Kleine-Budde committed Jul 19, 2022
1 parent 69a6539 commit 18de712
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/net/can/slcan/slcan-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,19 +469,19 @@ static void slcan_unesc(struct slcan *sl, unsigned char s)
{
if ((s == '\r') || (s == '\a')) { /* CR or BEL ends the pdu */
if (!test_and_clear_bit(SLF_ERROR, &sl->flags) &&
(sl->rcount > 4)) {
sl->rcount > 4)
slc_bump(sl);
}

sl->rcount = 0;
} else {
if (!test_bit(SLF_ERROR, &sl->flags)) {
if (sl->rcount < SLC_MTU) {
sl->rbuff[sl->rcount++] = s;
return;
} else {
sl->dev->stats.rx_over_errors++;
set_bit(SLF_ERROR, &sl->flags);
}

sl->dev->stats.rx_over_errors++;
set_bit(SLF_ERROR, &sl->flags);
}
}
}
Expand Down Expand Up @@ -1104,9 +1104,8 @@ static void __exit slcan_exit(void)
continue;

sl = netdev_priv(dev);
if (sl->tty) {
if (sl->tty)
netdev_err(dev, "tty discipline still running\n");
}

slc_close(dev);
unregister_candev(dev);
Expand Down

0 comments on commit 18de712

Please sign in to comment.