linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] pnp: pnpbios: Use DEFINE_SPINLOCK() for spinlock
@ 2020-12-28 13:50 Zheng Yongjun
  2021-01-22 15:24 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Zheng Yongjun @ 2020-12-28 13:50 UTC (permalink / raw)
  To: rafael.j.wysocki, linux-acpi, linux-kernel; +Cc: Zheng Yongjun

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

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/pnp/pnpbios/bioscalls.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
index ba5cfc3dbe11..ddc6f2163c8e 100644
--- a/drivers/pnp/pnpbios/bioscalls.c
+++ b/drivers/pnp/pnpbios/bioscalls.c
@@ -72,7 +72,7 @@ __visible u32 pnp_bios_fault_esp;
 __visible u32 pnp_bios_fault_eip;
 __visible u32 pnp_bios_is_utter_crap = 0;
 
-static spinlock_t pnp_bios_lock;
+static DEFINE_SPINLOCK(pnp_bios_lock);
 
 /*
  * Support Functions
@@ -473,7 +473,6 @@ void pnpbios_calls_init(union pnp_bios_install_struct *header)
 {
 	int i;
 
-	spin_lock_init(&pnp_bios_lock);
 	pnp_bios_callpoint.offset = header->fields.pm16offset;
 	pnp_bios_callpoint.segment = PNP_CS16;
 
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] pnp: pnpbios: Use DEFINE_SPINLOCK() for spinlock
  2020-12-28 13:50 [PATCH -next] pnp: pnpbios: Use DEFINE_SPINLOCK() for spinlock Zheng Yongjun
@ 2021-01-22 15:24 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2021-01-22 15:24 UTC (permalink / raw)
  To: Zheng Yongjun
  Cc: Rafael Wysocki, ACPI Devel Maling List, Linux Kernel Mailing List

On Mon, Dec 28, 2020 at 2:50 PM Zheng Yongjun <zhengyongjun3@huawei.com> 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/pnp/pnpbios/bioscalls.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
> index ba5cfc3dbe11..ddc6f2163c8e 100644
> --- a/drivers/pnp/pnpbios/bioscalls.c
> +++ b/drivers/pnp/pnpbios/bioscalls.c
> @@ -72,7 +72,7 @@ __visible u32 pnp_bios_fault_esp;
>  __visible u32 pnp_bios_fault_eip;
>  __visible u32 pnp_bios_is_utter_crap = 0;
>
> -static spinlock_t pnp_bios_lock;
> +static DEFINE_SPINLOCK(pnp_bios_lock);
>
>  /*
>   * Support Functions
> @@ -473,7 +473,6 @@ void pnpbios_calls_init(union pnp_bios_install_struct *header)
>  {
>         int i;
>
> -       spin_lock_init(&pnp_bios_lock);
>         pnp_bios_callpoint.offset = header->fields.pm16offset;
>         pnp_bios_callpoint.segment = PNP_CS16;
>
> --

Applied as 5.12 material, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-22 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-28 13:50 [PATCH -next] pnp: pnpbios: Use DEFINE_SPINLOCK() for spinlock Zheng Yongjun
2021-01-22 15:24 ` Rafael J. Wysocki

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).