Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3447403pxf; Mon, 29 Mar 2021 02:25:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAaVGqaYDljy7tLMH/JHmp7e5wVgm9E6rIrvwL1LtTFEh+0rIfH26n/00usL84KtjsbZw6 X-Received: by 2002:aa7:c6d2:: with SMTP id b18mr27434922eds.183.1617009937322; Mon, 29 Mar 2021 02:25:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617009937; cv=none; d=google.com; s=arc-20160816; b=QDX6bwvVe0krqvu155KaN9gpXIKU0EVfWmkfcKIOD2ZjYvRGpV00PhYHBempzStGr0 jyOTMdMEoqW/8XZvEjpgNjAJy0eqy3N0+hIn8Z9417FXaSG7R3MWG8g0MaYboLMwK/sZ VTL7elGswVxAxpToJRzZHd6FN29MoHRczCYBetUJhQjxHBqI/fPC9zZo7oWfvHyBdlmg oLpYY227RNXI3NHWZA/qV0kycFKfwH4+ORGVpJ5+U1n8Tlm6rEWtQ1T7nvxc2UibcIi7 NkKc9EacwPxoLO4XDyrTZub/RpFfpw7vtjN0BTwpu0d3daQUMyiezOsaeXVblZdw5tNy uI+A== 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=5CslfOxfOyIhK3EzHVShrZdEydWiO9Xw6ahqMcUd+P4=; b=fyK5Zwtu+McDOtzpkNsWIFXHxXqLKOdr5SeUw42KqFc+p5IfpTa0J3AjNxiPkjCio9 DTYPYXkKznNY8qdDdHblyw30Ez43DUf7wPY45Ry6ed8Rg/HGEdNgXuVx4TB0xKbsHcWV h5SdUruPTdzzc2zMkWgrH3NX//upp1twCU0epGCUn7+Xv0i+YBtgwfoGJpZACKxRDrRD t6NGAfLFcLWJF1R+Cl0aqUFRTF2Xek68kbNbH7SjCYOadBihWv0OjPo8Hp9W5QyVjt0a 7xD8LABnkLxT8guQ5s4VmkJGHeB3SRm/4AgyrkFXBQdjMo15ls+HSix5IRXpXDz1rwnb SFwg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d21si12620794ejw.331.2021.03.29.02.25.15; Mon, 29 Mar 2021 02:25:37 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231761AbhC2JXu (ORCPT + 99 others); Mon, 29 Mar 2021 05:23:50 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:15088 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231635AbhC2JXm (ORCPT ); Mon, 29 Mar 2021 05:23:42 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4F86XJ58KXz19JwG; Mon, 29 Mar 2021 17:21:36 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Mon, 29 Mar 2021 17:23:33 +0800 From: Shixin Liu To: Jens Axboe CC: , , Shixin Liu Subject: [PATCH -next 1/2] mtip32xx: use DEFINE_SPINLOCK() for spinlock Date: Mon, 29 Mar 2021 17:53:48 +0800 Message-ID: <20210329095349.4170870-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org spinlock can be initialized automatically with DEFINE_SPINLOCK() rather than explicitly calling spin_lock_init(). Signed-off-by: Shixin Liu --- drivers/block/mtip32xx/mtip32xx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 3be0dbc674bd..39e3280030d6 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -97,7 +97,7 @@ static int instance; static struct list_head online_list; static struct list_head removing_list; -static spinlock_t dev_lock; +static DEFINE_SPINLOCK(dev_lock); /* * Global variable used to hold the major block device number @@ -4363,8 +4363,6 @@ static int __init mtip_init(void) pr_info(MTIP_DRV_NAME " Version " MTIP_DRV_VERSION "\n"); - spin_lock_init(&dev_lock); - INIT_LIST_HEAD(&online_list); INIT_LIST_HEAD(&removing_list); -- 2.25.1