All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] scsi: megaraid_sas: Use DEFINE_SPINLOCK() for spinlock
@ 2021-03-29  9:45 Shixin Liu
  2021-04-14 11:46 ` Sumit Saxena
  2021-05-11  3:25 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Shixin Liu @ 2021-03-29  9:45 UTC (permalink / raw)
  To: Kashyap Desai, Sumit Saxena, Shivasharan S, James E.J. Bottomley,
	Martin K. Petersen
  Cc: megaraidlinux.pdl, linux-scsi, linux-kernel, Shixin Liu

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

Signed-off-by: Shixin Liu <liushixin2@huawei.com>
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 4d4e9dbe5193..8ed347eebf07 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -213,7 +213,7 @@ static bool support_nvme_encapsulation;
 static bool support_pci_lane_margining;
 
 /* define lock for aen poll */
-static spinlock_t poll_aen_lock;
+static DEFINE_SPINLOCK(poll_aen_lock);
 
 extern struct dentry *megasas_debugfs_root;
 extern int megasas_blk_mq_poll(struct Scsi_Host *shost, unsigned int queue_num);
@@ -8934,8 +8934,6 @@ static int __init megasas_init(void)
 	 */
 	pr_info("megasas: %s\n", MEGASAS_VERSION);
 
-	spin_lock_init(&poll_aen_lock);
-
 	support_poll_for_event = 2;
 	support_device_change = 1;
 	support_nvme_encapsulation = true;
-- 
2.25.1


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

* Re: [PATCH -next] scsi: megaraid_sas: Use DEFINE_SPINLOCK() for spinlock
  2021-03-29  9:45 [PATCH -next] scsi: megaraid_sas: Use DEFINE_SPINLOCK() for spinlock Shixin Liu
@ 2021-04-14 11:46 ` Sumit Saxena
  2021-05-11  3:25 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Sumit Saxena @ 2021-04-14 11:46 UTC (permalink / raw)
  To: Shixin Liu
  Cc: Kashyap Desai, Shivasharan S, James E.J. Bottomley,
	Martin K. Petersen, PDL,MEGARAIDLINUX, Linux SCSI List, LKML

[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]

On Mon, Mar 29, 2021 at 2:45 PM Shixin Liu <liushixin2@huawei.com> wrote:
>
> spinlock can be initialized automatically with DEFINE_SPINLOCK()
> rather than explicitly calling spin_lock_init().
Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
>
> Signed-off-by: Shixin Liu <liushixin2@huawei.com>
> ---
>  drivers/scsi/megaraid/megaraid_sas_base.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
> index 4d4e9dbe5193..8ed347eebf07 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -213,7 +213,7 @@ static bool support_nvme_encapsulation;
>  static bool support_pci_lane_margining;
>
>  /* define lock for aen poll */
> -static spinlock_t poll_aen_lock;
> +static DEFINE_SPINLOCK(poll_aen_lock);
>
>  extern struct dentry *megasas_debugfs_root;
>  extern int megasas_blk_mq_poll(struct Scsi_Host *shost, unsigned int queue_num);
> @@ -8934,8 +8934,6 @@ static int __init megasas_init(void)
>          */
>         pr_info("megasas: %s\n", MEGASAS_VERSION);
>
> -       spin_lock_init(&poll_aen_lock);
> -
>         support_poll_for_event = 2;
>         support_device_change = 1;
>         support_nvme_encapsulation = true;
> --
> 2.25.1
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* Re: [PATCH -next] scsi: megaraid_sas: Use DEFINE_SPINLOCK() for spinlock
  2021-03-29  9:45 [PATCH -next] scsi: megaraid_sas: Use DEFINE_SPINLOCK() for spinlock Shixin Liu
  2021-04-14 11:46 ` Sumit Saxena
@ 2021-05-11  3:25 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-05-11  3:25 UTC (permalink / raw)
  To: Sumit Saxena, Kashyap Desai, James E.J. Bottomley, Shivasharan S,
	Shixin Liu
  Cc: Martin K . Petersen, linux-scsi, linux-kernel, megaraidlinux.pdl

On Mon, 29 Mar 2021 17:45:32 +0800, Shixin Liu wrote:

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

Applied to 5.14/scsi-queue, thanks!

[1/1] scsi: megaraid_sas: Use DEFINE_SPINLOCK() for spinlock
      https://git.kernel.org/mkp/scsi/c/311e87b70913

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2021-05-11  3:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29  9:45 [PATCH -next] scsi: megaraid_sas: Use DEFINE_SPINLOCK() for spinlock Shixin Liu
2021-04-14 11:46 ` Sumit Saxena
2021-05-11  3:25 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.