From: Dave Jiang <dave.jiang@intel.com>
To: Zheng Yongjun <zhengyongjun3@huawei.com>
Cc: <vkoul@kernel.org>, <dmaengine@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <dan.j.williams@intel.com>
Subject: Re: [PATCH v2 -next] dma: idxd: use DEFINE_MUTEX() for mutex lock
Date: Thu, 24 Dec 2020 09:25:29 -0700 [thread overview]
Message-ID: <20201224092529.00006a63@intel.com> (raw)
In-Reply-To: <20201224132254.30961-1-zhengyongjun3@huawei.com>
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]);
>
next prev parent reply other threads:[~2020-12-24 16:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-24 13:22 Zheng Yongjun
2020-12-24 16:25 ` Dave Jiang [this message]
2021-01-06 6:26 ` Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201224092529.00006a63@intel.com \
--to=dave.jiang@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vkoul@kernel.org \
--cc=zhengyongjun3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome