Commit f374a33
serial: serial_core: simplify uart_ioctl() returns
Neither uart_do_autoconfig(), nor uart_wait_modem_status() can return
-ENOIOCTLCMD. The ENOIOCTLCMD checks are there to check if 'cmd' matched
against TIOCSERCONFIG, and TIOCMIWAIT respectively. (With 0 or error in
'ret', it does not matter.)
Therefore, the code can simply return from the TIOCSERCONFIG and
TIOCMIWAIT spots immediately.
To be more explicit, use 'if' instead of switch-case for those single
values.
And return without jumping to the 'out' label -- it can be removed too.
Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://patch.msgid.link/20251119100140.830761-10-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent dee7e10 commit f374a33
1 file changed
Lines changed: 9 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1560 | 1560 | | |
1561 | 1561 | | |
1562 | 1562 | | |
1563 | | - | |
1564 | | - | |
1565 | | - | |
1566 | | - | |
1567 | | - | |
1568 | | - | |
| 1563 | + | |
| 1564 | + | |
1569 | 1565 | | |
1570 | 1566 | | |
1571 | 1567 | | |
1572 | | - | |
1573 | | - | |
1574 | | - | |
1575 | | - | |
1576 | | - | |
1577 | | - | |
1578 | | - | |
1579 | | - | |
1580 | | - | |
| 1568 | + | |
1581 | 1569 | | |
1582 | 1570 | | |
1583 | | - | |
1584 | | - | |
1585 | | - | |
1586 | | - | |
1587 | | - | |
1588 | | - | |
1589 | | - | |
1590 | | - | |
| 1571 | + | |
| 1572 | + | |
1591 | 1573 | | |
1592 | | - | |
1593 | | - | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
1594 | 1577 | | |
1595 | 1578 | | |
1596 | 1579 | | |
| |||
1638 | 1621 | | |
1639 | 1622 | | |
1640 | 1623 | | |
1641 | | - | |
| 1624 | + | |
1642 | 1625 | | |
1643 | 1626 | | |
1644 | 1627 | | |
| |||
0 commit comments