]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
dma: idxd: use DEFINE_MUTEX() for mutex lock
authorZheng Yongjun <zhengyongjun3@huawei.com>
Thu, 24 Dec 2020 13:22:54 +0000 (21:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:29:41 +0000 (10:29 +0200)
[ Upstream commit e2fcd6e427c2fae92b366b24759f95d77b6f7bc7 ]

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>
Link: https://lore.kernel.org/r/20201224132254.30961-1-zhengyongjun3@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/idxd/init.c

index ababd059da6f371515cba41d269dd23f05b59fa0..d223242a34f488e9b35ca16a56637f90e392695c 100644 (file)
@@ -31,7 +31,7 @@ MODULE_AUTHOR("Intel Corporation");
 bool support_enqcmd;
 
 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 */
@@ -543,7 +543,6 @@ static int __init idxd_init_module(void)
        else
                support_enqcmd = true;
 
-       mutex_init(&idxd_idr_lock);
        for (i = 0; i < IDXD_TYPE_MAX; i++)
                idr_init(&idxd_idrs[i]);