Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6546384pxu; Thu, 24 Dec 2020 05:27:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbq2+PBI1ZC0IN8dKpYQWND5q7VUyfNQb9qwoV3SYEO23qN8E2gCpN+7+cWd5IMEINVP/1 X-Received: by 2002:a17:906:3899:: with SMTP id q25mr27527424ejd.173.1608816454454; Thu, 24 Dec 2020 05:27:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608816454; cv=none; d=google.com; s=arc-20160816; b=hVP84vcxOfuAmSRBnIMBX3alCuNTEmtnobGrB6zeYonJGif+I1CS32jxKiX6ADbJ/Y 4OnJmrDoS2A8Lk7yLgILSxRYwMQTFLY7FsKt5QSD3b7pATqNnT7IjHMh6oMBcbRlt7Tr 3YqwpEh/G0698Mwm8p+g4gvyQBP9UM7f6CmFpjm234xMoV6eBXeaRpy8m4ibAkftVY/k OJ9OWD47GILHiERHnZDTO4Za3ywwN2CpsSFelAFtyR3fC8fkfA42iF6xFxUFKrZj2zvU nYEDmFbUmIcxxJSMXpG8NaAAtOTEFUpRjIkeB4wLYi7tDyorUgOWk8+BdWqkf5lP3rBy syfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=yjcyOReESee7WS7fIX7nt+anTYuecGF157Uqm+VIx9Q=; b=jaw9zMVa+8kaVF8ttF55O1HdZENEFhH++BomkZluXGNlxHTUdyVR8oE/FjdkzVYc3R 4Q/tatx4Q+6T8l1hRESeftTO9lYSAK7EhWAmdiNm0ZZwKIjhJ6qY6eWf9uk1iRO1c036 QT2fDlnJC9xnf4mS08y421JR/VvwILlDi5emrdWAgaHVX2fey+xln9nOlrK/KjhVdFuN 7y9HexpHYWyZ4pBjFAo8CbFfrQ3epv7JYkHb94vgvXhilYziNSZ8pcaGTTEFWnLbpNEn WCueecId5Gbuf6D+dBZ4WDNHABSlAGilOD3+hjyowMACw7f7JTXY8Ntnpfh00OCpn6Qh tPtw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v15si5532778eju.651.2020.12.24.05.27.12; Thu, 24 Dec 2020 05:27:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728945AbgLXNZC (ORCPT + 99 others); Thu, 24 Dec 2020 08:25:02 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:9991 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728578AbgLXNZC (ORCPT ); Thu, 24 Dec 2020 08:25:02 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4D1rPN1Rx9zhx4B; Thu, 24 Dec 2020 21:23:36 +0800 (CST) Received: from ubuntu.network (10.175.138.68) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.498.0; Thu, 24 Dec 2020 21:24:10 +0800 From: Zheng Yongjun To: , CC: , , , , Zheng Yongjun Subject: [PATCH v2 -next] misc: ocxl: use DEFINE_MUTEX() for mutex lock Date: Thu, 24 Dec 2020 21:24:46 +0800 Message-ID: <20201224132446.31286-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-kernel@vger.kernel.org mutex lock can be initialized automatically with DEFINE_MUTEX() rather than explicitly calling mutex_init(). Signed-off-by: Zheng Yongjun --- drivers/misc/ocxl/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c index 4d1b44de1492..e70525eedaae 100644 --- a/drivers/misc/ocxl/file.c +++ b/drivers/misc/ocxl/file.c @@ -15,7 +15,7 @@ static dev_t ocxl_dev; static struct class *ocxl_class; -static struct mutex minors_idr_lock; +static DEFINE_MUTEX(minors_idr_lock); static struct idr minors_idr; static struct ocxl_file_info *find_and_get_file_info(dev_t devno) @@ -588,7 +588,6 @@ int ocxl_file_init(void) { int rc; - mutex_init(&minors_idr_lock); idr_init(&minors_idr); rc = alloc_chrdev_region(&ocxl_dev, 0, OCXL_NUM_MINORS, "ocxl"); -- 2.22.0