* Re: [PATCH] tty: tty_ldisc: Remove the ret variable
2023-02-22 20:23 [PATCH] tty: tty_ldisc: Remove the ret variable Li zeming
@ 2023-02-22 7:30 ` Jiri Slaby
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2023-02-22 7:30 UTC (permalink / raw)
To: Li zeming, gregkh; +Cc: linux-kernel
On 22. 02. 23, 21:23, Li zeming wrote:
> 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>
--
js
suse labs
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] tty: tty_ldisc: Remove the ret variable
@ 2023-02-22 20:23 Li zeming
2023-02-22 7:30 ` Jiri Slaby
0 siblings, 1 reply; 2+ messages in thread
From: Li zeming @ 2023-02-22 20:23 UTC (permalink / raw)
To: gregkh, jirislaby; +Cc: linux-kernel, Li zeming
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>
---
drivers/tty/tty_ldisc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index e758f44729e7..3f68e213df1f 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -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);
--
2.18.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-22 7:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22 20:23 [PATCH] tty: tty_ldisc: Remove the ret variable Li zeming
2023-02-22 7:30 ` Jiri Slaby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®