From: Jiri Slaby <jirislaby@kernel.org>
To: Huang Guobin <huangguobin4@huawei.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] tty: n_gsm: use DEFINE_SPINLOCK() for spinlock
Date: Wed, 7 Apr 2021 07:23:16 +0200 [thread overview]
Message-ID: <d6776a2e-15da-162d-5732-364dfda0a3b6@kernel.org> (raw)
In-Reply-To: <1617710163-48158-1-git-send-email-huangguobin4@huawei.com>
On 06. 04. 21, 13:56, Huang Guobin wrote:
> From: Guobin Huang <huangguobin4@huawei.com>
>
> spinlock can be initialized automatically with DEFINE_SPINLOCK()
> rather than explicitly calling spin_lock_init().
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Guobin Huang <huangguobin4@huawei.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
> ---
> drivers/tty/n_gsm.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
> index 9e12f9cb1a98..d60cffc70a0c 100644
> --- a/drivers/tty/n_gsm.c
> +++ b/drivers/tty/n_gsm.c
> @@ -266,7 +266,7 @@ struct gsm_mux {
>
> #define MAX_MUX 4 /* 256 minors */
> static struct gsm_mux *gsm_mux[MAX_MUX]; /* GSM muxes */
> -static spinlock_t gsm_mux_lock;
> +static DEFINE_SPINLOCK(gsm_mux_lock);
>
> static struct tty_driver *gsm_tty_driver;
>
> @@ -3257,8 +3257,6 @@ static int __init gsm_init(void)
> gsm_tty_driver->init_termios.c_lflag &= ~ECHO;
> tty_set_operations(gsm_tty_driver, &gsmtty_ops);
>
> - spin_lock_init(&gsm_mux_lock);
> -
> if (tty_register_driver(gsm_tty_driver)) {
> put_tty_driver(gsm_tty_driver);
> tty_unregister_ldisc(N_GSM0710);
>
--
js
next prev parent reply other threads:[~2021-04-07 5:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 11:56 Huang Guobin
2021-04-07 5:23 ` Jiri Slaby [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-12-23 14:14 [PATCH -next] tty: n_gsm: Use " Zheng Yongjun
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=d6776a2e-15da-162d-5732-364dfda0a3b6@kernel.org \
--to=jirislaby@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=huangguobin4@huawei.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®