Skip to content

Commit

Permalink
net: slcan, slip -- no need for goto when if () will do
Browse files Browse the repository at this point in the history
No need to play with gotos to jump over single statement.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Machek authored and David S. Miller committed Mar 12, 2020
1 parent c7211ff commit dacf470
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 2 additions & 5 deletions drivers/net/can/slcan.c
Original file line number Diff line number Diff line change
@@ -348,11 +348,8 @@ static void slcan_write_wakeup(struct tty_struct *tty)

rcu_read_lock();
sl = rcu_dereference(tty->disc_data);
if (!sl)
goto out;

schedule_work(&sl->tx_work);
out:
if (sl)
schedule_work(&sl->tx_work);
rcu_read_unlock();
}

7 changes: 2 additions & 5 deletions drivers/net/slip/slip.c
Original file line number Diff line number Diff line change
@@ -456,11 +456,8 @@ static void slip_write_wakeup(struct tty_struct *tty)

rcu_read_lock();
sl = rcu_dereference(tty->disc_data);
if (!sl)
goto out;

schedule_work(&sl->tx_work);
out:
if (sl)
schedule_work(&sl->tx_work);
rcu_read_unlock();
}

0 comments on commit dacf470

Please sign in to comment.