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 <[email protected]>
Acked-by: Oliver Hartkopp <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
pavelmachek authored and davem330 committed Mar 12, 2020
1 parent c7211ff commit dacf470
Show file tree
Hide file tree
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
Expand Up @@ -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();
}

Expand Down
7 changes: 2 additions & 5 deletions drivers/net/slip/slip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit dacf470

Please sign in to comment.