From: Tom Rix <trix@redhat.com>
To: Zheng Yongjun <zhengyongjun3@huawei.com>,
mdf@kernel.org, linux-fpga@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] fpga: Use DEFINE_SPINLOCK() for spinlock
Date: Sat, 9 Jan 2021 14:08:53 -0800 [thread overview]
Message-ID: <58fed6b1-dbab-7696-1086-c8d84cff0379@redhat.com> (raw)
In-Reply-To: <20201228135135.28788-1-zhengyongjun3@huawei.com>
On 12/28/20 5:51 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>
This looks fine.
Reviewed-by: Tom Rix <trix@redhat.com>
> ---
> drivers/fpga/fpga-bridge.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
> index 2deccacc3aa7..e9266b2a357f 100644
> --- a/drivers/fpga/fpga-bridge.c
> +++ b/drivers/fpga/fpga-bridge.c
> @@ -17,7 +17,7 @@ static DEFINE_IDA(fpga_bridge_ida);
> static struct class *fpga_bridge_class;
>
> /* Lock for adding/removing bridges to linked lists*/
> -static spinlock_t bridge_list_lock;
> +static DEFINE_SPINLOCK(bridge_list_lock);
>
> /**
> * fpga_bridge_enable - Enable transactions on the bridge
> @@ -479,8 +479,6 @@ static void fpga_bridge_dev_release(struct device *dev)
>
> static int __init fpga_bridge_dev_init(void)
> {
> - spin_lock_init(&bridge_list_lock);
> -
> fpga_bridge_class = class_create(THIS_MODULE, "fpga_bridge");
> if (IS_ERR(fpga_bridge_class))
> return PTR_ERR(fpga_bridge_class);
next prev parent reply other threads:[~2021-01-09 22:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-28 13:51 [PATCH -next] fpga: Use DEFINE_SPINLOCK() for spinlock Zheng Yongjun
2021-01-09 22:08 ` Tom Rix [this message]
2021-01-10 19:07 ` Moritz Fischer
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=58fed6b1-dbab-7696-1086-c8d84cff0379@redhat.com \
--to=trix@redhat.com \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdf@kernel.org \
--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).