tty: tty_ldisc: Remove the ret variable
authorLi zeming <zeming@nfschina.com>
Wed, 22 Feb 2023 20:23:03 +0000 (04:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Mar 2023 16:11:18 +0000 (17:11 +0100)
The int variable ret does not receive the return value in this function.
It should be removed and returned 0 directly.

Signed-off-by: Li zeming <zeming@nfschina.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230222202303.3195-1-zeming@nfschina.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_ldisc.c

index e758f44729e7e54d00ea79461adeefab59f1efee..3f68e213df1f70853ee19480a522ecaaaf420e33 100644 (file)
@@ -58,7 +58,6 @@ static struct tty_ldisc_ops *tty_ldiscs[NR_LDISCS];
 int tty_register_ldisc(struct tty_ldisc_ops *new_ldisc)
 {
        unsigned long flags;
-       int ret = 0;
 
        if (new_ldisc->num < N_TTY || new_ldisc->num >= NR_LDISCS)
                return -EINVAL;
@@ -67,7 +66,7 @@ int tty_register_ldisc(struct tty_ldisc_ops *new_ldisc)
        tty_ldiscs[new_ldisc->num] = new_ldisc;
        raw_spin_unlock_irqrestore(&tty_ldiscs_lock, flags);
 
-       return ret;
+       return 0;
 }
 EXPORT_SYMBOL(tty_register_ldisc);