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 2f5c287eac95761f1a57110078875f6615b944f4..686d853fc2495ce39914fbbbc02dd3b98e606518 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 babb01888b786c2e77c9d7b4844f44d31b9c7bce..f81fb0b13a944f6a51d2b5be6135b14055b9f9db 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();
 }