From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3342AC433E6 for ; Thu, 24 Dec 2020 13:23:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE4CE224B1 for ; Thu, 24 Dec 2020 13:23:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728868AbgLXNXi (ORCPT ); Thu, 24 Dec 2020 08:23:38 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:9989 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728771AbgLXNXi (ORCPT ); Thu, 24 Dec 2020 08:23:38 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4D1rMm1hl6zhxHL; Thu, 24 Dec 2020 21:22:12 +0800 (CST) Received: from ubuntu.network (10.175.138.68) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.498.0; Thu, 24 Dec 2020 21:22:46 +0800 From: Zheng Yongjun To: , CC: , , , Zheng Yongjun Subject: [PATCH v2 -next] mlx5: use DEFINE_MUTEX() for mutex lock Date: Thu, 24 Dec 2020 21:23:23 +0800 Message-ID: <20201224132323.31126-1-zhengyongjun3@huawei.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.138.68] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org mutex lock can be initialized automatically with DEFINE_MUTEX() rather than explicitly calling mutex_init(). Signed-off-by: Zheng Yongjun --- drivers/infiniband/hw/mlx5/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 246e3cbe0b2c..8a260773722f 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -79,7 +79,7 @@ static DEFINE_MUTEX(mlx5_ib_multiport_mutex); * doesn't work on kernel modules memory */ static unsigned long xlt_emergency_page; -static struct mutex xlt_emergency_page_mutex; +static DEFINE_MUTEX(xlt_emergency_page_mutex); struct mlx5_ib_dev *mlx5_ib_get_ibdev_from_mpi(struct mlx5_ib_multiport_info *mpi) { @@ -4874,8 +4874,6 @@ static int __init mlx5_ib_init(void) if (!xlt_emergency_page) return -ENOMEM; - mutex_init(&xlt_emergency_page_mutex); - mlx5_ib_event_wq = alloc_ordered_workqueue("mlx5_ib_event_wq", 0); if (!mlx5_ib_event_wq) { free_page(xlt_emergency_page); -- 2.22.0