Skip to content

Commit

Permalink
dma: idxd: use DEFINE_MUTEX() for mutex lock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zheng Yongjun authored and Vinod Koul committed Jan 8, 2021
1 parent 33cb6d1 commit e2fcd6e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/dma/idxd/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -544,7 +544,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]);

Expand Down

0 comments on commit e2fcd6e

Please sign in to comment.