aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty/tty_ldisc.c
diff options
context:
space:
mode:
authorXiaofei Tan2021-04-07 15:06:49 +0800
committerGreg Kroah-Hartman2021-04-10 10:33:00 +0200
commit408795b0252fe3b060c3c62b630f5419db415adf (patch)
treef61987708f88a10c4bdf8470b791cbd0fe68fc32 /drivers/tty/tty_ldisc.c
parent72a8dcd7bb9163cbdaabbd50541e2ded2347835e (diff)
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>
Diffstat (limited to 'drivers/tty/tty_ldisc.c')
-rw-r--r--drivers/tty/tty_ldisc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index 874d238236e6..56e67f770b6d 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -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;
}