tty: tty_ldisc: Do not use assignment in if condition

Do not use assignment in if condition following the advice of
checkpatch.pl.

Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
Link: https://lore.kernel.org/r/1617779210-51576-10-git-send-email-tanxiaofei@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Xiaofei Tan 2021-04-07 15:06:49 +08:00 committed by Greg Kroah-Hartman
parent 72a8dcd7bb
commit 408795b025
1 changed files with 2 additions and 1 deletions

View File

@ -508,7 +508,8 @@ static int tty_ldisc_failto(struct tty_struct *tty, int ld)
return PTR_ERR(disc);
tty->ldisc = disc;
tty_set_termios_ldisc(tty, ld);
if ((r = tty_ldisc_open(tty, disc)) < 0)
r = tty_ldisc_open(tty, disc);
if (r < 0)
tty_ldisc_put(disc);
return r;
}