mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
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/20220704125954.1587880-6-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
69a6539632
commit
18de712a58
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user