lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <m38s63muni.fsf@t19.piap.pl>
Date:   Wed, 31 Mar 2021 13:26:09 +0200
From:   Krzysztof Hałasa <khalasa@...p.pl>
To:     Yang Yingliang <yangyingliang@...wei.com>
Cc:     <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] soc: ixp4xx: qmgr: Use DEFINE_SPINLOCK() for
 spinlock

Yang Yingliang <yangyingliang@...wei.com> writes:

> spinlock can be initialized automatically with DEFINE_SPINLOCK()
> rather than explicitly calling spin_lock_init().

That's right.

> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>

Acked-by: Krzysztof Halasa <khalasa@...p.pl>

> ---
>  drivers/soc/ixp4xx/ixp4xx-qmgr.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/soc/ixp4xx/ixp4xx-qmgr.c b/drivers/soc/ixp4xx/ixp4xx-qmgr.c
> index 8c968382cea7..dde3b668eb40 100644
> --- a/drivers/soc/ixp4xx/ixp4xx-qmgr.c
> +++ b/drivers/soc/ixp4xx/ixp4xx-qmgr.c
> @@ -16,7 +16,7 @@
>  static struct qmgr_regs __iomem *qmgr_regs;
>  static int qmgr_irq_1;
>  static int qmgr_irq_2;
> -static spinlock_t qmgr_lock;
> +static DEFINE_SPINLOCK(qmgr_lock);
>  static u32 used_sram_bitmap[4]; /* 128 16-dword pages */
>  static void (*irq_handlers[QUEUES])(void *pdev);
>  static void *irq_pdevs[QUEUES];
> @@ -434,7 +434,6 @@ static int ixp4xx_qmgr_probe(struct platform_device *pdev)
>  	}
>  
>  	used_sram_bitmap[0] = 0xF; /* 4 first pages reserved for config */
> -	spin_lock_init(&qmgr_lock);
>  
>  	dev_info(dev, "IXP4xx Queue Manager initialized.\n");
>  	return 0;

-- 
Krzysztof Hałasa

Sieć Badawcza Łukasiewicz
Przemysłowy Instytut Automatyki i Pomiarów PIAP
Al. Jerozolimskie 202, 02-486 Warszawa

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ