* [PATCH v2 -next] dma: idxd: use DEFINE_MUTEX() for mutex lock
@ 2020-12-24 13:22 Zheng Yongjun
2020-12-24 16:25 ` Dave Jiang
2021-01-06 6:26 ` Vinod Koul
0 siblings, 2 replies; 3+ messages in thread
From: Zheng Yongjun @ 2020-12-24 13:22 UTC (permalink / raw)
To: vkoul, dmaengine, linux-kernel; +Cc: dave.jiang, dan.j.williams, Zheng Yongjun
mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
drivers/dma/idxd/init.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index 0a4432b063b5..2297c93dd527 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -27,7 +27,7 @@ MODULE_AUTHOR("Intel Corporation");
#define DRV_NAME "idxd"
static struct idr idxd_idrs[IDXD_TYPE_MAX];
-static struct mutex idxd_idr_lock;
+static DEFINE_MUTEX(idxd_idr_lock);
static struct pci_device_id idxd_pci_tbl[] = {
/* DSA ver 1.0 platforms */
@@ -481,7 +481,6 @@ static int __init idxd_init_module(void)
pr_info("%s: Intel(R) Accelerator Devices Driver %s\n",
DRV_NAME, IDXD_DRIVER_VERSION);
- mutex_init(&idxd_idr_lock);
for (i = 0; i < IDXD_TYPE_MAX; i++)
idr_init(&idxd_idrs[i]);
--
2.22.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 -next] dma: idxd: use DEFINE_MUTEX() for mutex lock
2020-12-24 13:22 [PATCH v2 -next] dma: idxd: use DEFINE_MUTEX() for mutex lock Zheng Yongjun
@ 2020-12-24 16:25 ` Dave Jiang
2021-01-06 6:26 ` Vinod Koul
1 sibling, 0 replies; 3+ messages in thread
From: Dave Jiang @ 2020-12-24 16:25 UTC (permalink / raw)
To: Zheng Yongjun; +Cc: vkoul, dmaengine, linux-kernel, dan.j.williams
On Thu, 24 Dec 2020 21:22:54 +0800
Zheng Yongjun <zhengyongjun3@huawei.com> wrote:
> mutex lock can be initialized automatically with DEFINE_MUTEX()
> rather than explicitly calling mutex_init().
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Acked-by: Dave Jiang <dave.jiang@intel.com>
> ---
> drivers/dma/idxd/init.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
> index 0a4432b063b5..2297c93dd527 100644
> --- a/drivers/dma/idxd/init.c
> +++ b/drivers/dma/idxd/init.c
> @@ -27,7 +27,7 @@ MODULE_AUTHOR("Intel Corporation");
> #define DRV_NAME "idxd"
>
> static struct idr idxd_idrs[IDXD_TYPE_MAX];
> -static struct mutex idxd_idr_lock;
> +static DEFINE_MUTEX(idxd_idr_lock);
>
> static struct pci_device_id idxd_pci_tbl[] = {
> /* DSA ver 1.0 platforms */
> @@ -481,7 +481,6 @@ static int __init idxd_init_module(void)
> pr_info("%s: Intel(R) Accelerator Devices Driver %s\n",
> DRV_NAME, IDXD_DRIVER_VERSION);
>
> - mutex_init(&idxd_idr_lock);
> for (i = 0; i < IDXD_TYPE_MAX; i++)
> idr_init(&idxd_idrs[i]);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 -next] dma: idxd: use DEFINE_MUTEX() for mutex lock
2020-12-24 13:22 [PATCH v2 -next] dma: idxd: use DEFINE_MUTEX() for mutex lock Zheng Yongjun
2020-12-24 16:25 ` Dave Jiang
@ 2021-01-06 6:26 ` Vinod Koul
1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2021-01-06 6:26 UTC (permalink / raw)
To: Zheng Yongjun; +Cc: dmaengine, linux-kernel, dave.jiang, dan.j.williams
On 24-12-20, 21:22, Zheng Yongjun wrote:
> mutex lock can be initialized automatically with DEFINE_MUTEX()
> rather than explicitly calling mutex_init().
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-06 6:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-24 13:22 [PATCH v2 -next] dma: idxd: use DEFINE_MUTEX() for mutex lock Zheng Yongjun
2020-12-24 16:25 ` Dave Jiang
2021-01-06 6:26 ` Vinod Koul
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).