diff options
author | Xiaofei Tan | 2021-04-07 15:06:49 +0800 |
---|---|---|
committer | Greg Kroah-Hartman | 2021-04-10 10:33:00 +0200 |
commit | 408795b0252fe3b060c3c62b630f5419db415adf (patch) | |
tree | f61987708f88a10c4bdf8470b791cbd0fe68fc32 /drivers | |
parent | 72a8dcd7bb9163cbdaabbd50541e2ded2347835e (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')
-rw-r--r-- | drivers/tty/tty_ldisc.c | 3 |
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; } |