From: Xiaofei Tan <tanxiaofei@huawei.com>
To: <gregkh@linuxfoundation.org>, <jirislaby@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <linuxarm@openeuler.org>,
Xiaofei Tan <tanxiaofei@huawei.com>
Subject: [PATCH v2 09/10] tty: tty_ldisc: Do not use assignment in if condition
Date: Tue, 6 Apr 2021 19:24:47 +0800 [thread overview]
Message-ID: <1617708288-14847-10-git-send-email-tanxiaofei@huawei.com> (raw)
In-Reply-To: <1617708288-14847-1-git-send-email-tanxiaofei@huawei.com>
Do not use assignment in if condition following the advice of
checkpatch.pl.
Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
---
drivers/tty/tty_ldisc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index 874d238..56e67f7 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;
}
--
2.8.1
next prev parent reply other threads:[~2021-04-06 11:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 11:24 [PATCH v2 00/10] tty: Fix some coding style issues Xiaofei Tan
2021-04-06 11:24 ` [PATCH v2 01/10] tty/sysrq: Add a blank line after declarations Xiaofei Tan
2021-04-06 11:24 ` [PATCH v2 02/10] tty/sysrq: Fix issues of code indent should use tabs Xiaofei Tan
2021-04-06 11:24 ` [PATCH v2 03/10] tty: tty_jobctrl: Add a blank line after declarations Xiaofei Tan
2021-04-06 11:24 ` [PATCH v2 04/10] tty: tty_jobctrl: Fix coding style issues of block comments Xiaofei Tan
2021-04-07 5:26 ` Jiri Slaby
2021-04-07 6:57 ` Xiaofei Tan
2021-04-06 11:24 ` [PATCH v2 05/10] tty: tty_jobctrl: Remove spaces before tabs Xiaofei Tan
2021-04-06 11:24 ` [PATCH v2 06/10] tty: tty_ldisc: Fix an issue of code indent should use tabs Xiaofei Tan
2021-04-06 11:24 ` [PATCH v2 07/10] tty: tty_ldisc: Add a blank line after declarations Xiaofei Tan
2021-04-06 11:24 ` [PATCH v2 08/10] tty: tty_ldisc: Fix coding style issues of block comments Xiaofei Tan
2021-04-06 11:24 ` Xiaofei Tan [this message]
2021-04-06 11:24 ` [PATCH v2 10/10] tty: tty_ldisc: Remove the repeated word 'the' Xiaofei Tan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1617708288-14847-10-git-send-email-tanxiaofei@huawei.com \
--to=tanxiaofei@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@openeuler.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox