mirror of https://gitee.com/openkylin/linux.git
net: slcan, slip -- no need for goto when if () will do
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>
This commit is contained in:
parent
c7211ff3be
commit
dacf470b26
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue