linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Zheng Yongjun <zhengyongjun3@huawei.com>,
	valentina.manea.m@gmail.com, shuah@kernel.org,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH -next] usb: usbip: Use DEFINE_SPINLOCK() for spinlock
Date: Fri, 15 Jan 2021 10:57:23 -0700	[thread overview]
Message-ID: <de699446-4f00-ce6a-4dfb-1f95669325f1@linuxfoundation.org> (raw)
In-Reply-To: <20201223141431.835-1-zhengyongjun3@huawei.com>

On 12/23/20 7:14 AM, Zheng Yongjun wrote:
> spinlock can be initialized automatically with DEFINE_SPINLOCK()
> rather than explicitly calling spin_lock_init().
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
>   drivers/usb/usbip/stub_main.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/usbip/stub_main.c b/drivers/usb/usbip/stub_main.c
> index c1c0bbc9f8b1..77a5b3f8736a 100644
> --- a/drivers/usb/usbip/stub_main.c
> +++ b/drivers/usb/usbip/stub_main.c
> @@ -23,7 +23,7 @@ struct kmem_cache *stub_priv_cache;
>    */
>   #define MAX_BUSID 16
>   static struct bus_id_priv busid_table[MAX_BUSID];
> -static spinlock_t busid_table_lock;
> +static DEFINE_SPINLOCK(busid_table_lock);
>   
>   static void init_busid_table(void)
>   {
> @@ -35,8 +35,6 @@ static void init_busid_table(void)
>   	 */
>   	memset(busid_table, 0, sizeof(busid_table));
>   
> -	spin_lock_init(&busid_table_lock);
> -
>   	for (i = 0; i < MAX_BUSID; i++)
>   		spin_lock_init(&busid_table[i].busid_lock);
>   }
> 


Sorry for the delay on this.

Looks good to me.

Acked-by: Shuah Khan <skhan@linuxfoundation.org>

thanks,
-- Shuah

      reply	other threads:[~2021-01-15 17:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 14:14 [PATCH -next] usb: usbip: Use DEFINE_SPINLOCK() for spinlock Zheng Yongjun
2021-01-15 17:57 ` Shuah Khan [this message]

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=de699446-4f00-ce6a-4dfb-1f95669325f1@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=valentina.manea.m@gmail.com \
    --cc=zhengyongjun3@huawei.com \
    /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;
as well as URLs for NNTP newsgroup(s).