net: slcan, slip -- no need for goto when if () will do
authorPavel Machek <pavel@ucw.cz>
Mon, 9 Mar 2020 22:33:23 +0000 (23:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Mar 2020 06:15:26 +0000 (23:15 -0700)
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>
drivers/net/can/slcan.c
drivers/net/slip/slip.c

index 2f5c287..686d853 100644 (file)
@@ -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();
 }
 
index babb018..f81fb0b 100644 (file)
@@ -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();
 }