lkml.org 
[lkml]   [2021]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -next] fpga: Use DEFINE_SPINLOCK() for spinlock
On Sat, Jan 09, 2021 at 02:08:53PM -0800, Tom Rix wrote:
>
> 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);
>

Applied,

Thanks

\
 
 \ /
  Last update: 2021-01-10 20:09    [W:0.043 / U:0.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site