Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3455179pxf; Mon, 29 Mar 2021 02:42:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkIXOXLlrdHsisKz1O5AA6mMES1zGOYAQfVS4rvAtj5267wnGkUFQygwfDzw42KONo4ZU4 X-Received: by 2002:a05:6402:5244:: with SMTP id t4mr27670619edd.87.1617010932970; Mon, 29 Mar 2021 02:42:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617010932; cv=none; d=google.com; s=arc-20160816; b=MILqxVdyZGVZ5A3UsH1kRJXHZsQpaIQUTvvDjbQZ+i+nM3GEfulPU3InPIkKot3FCG z3AJm+7/kHhJ66tAT6dTlTbsqwUkf1XXx8VdyRUhPt6Urdf5Tj4Orncm/OPKlySgY8kn CjSWhnafpuUPD4HL0tehZHfcPwenZ1S5eGz2uciLDRnUtes4Amd+zyW0hjkMvo0UA5vZ 1fFnF3d+6vC30atNyPwWiW5rU3cZpxYlNW8/VsczvAJnMeK4ukyWwipPMfk6n0a5hN/n gexcKt06cRtikD/1iba14E/56Ho3NlKLS/ZCX7N5D55dQNs7ou2TVujyK7hrGi/HNi2l Vsyg== 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=bzfNbS018SN9z1nsF3npKN8QWFMRG2M8+CS6X6TNcoo=; b=QDAnEwuZ6WLLgro+Be00gA181T0Y579/U2Hknc5Jl7Xt//wjiBTBjRazUfyKIvPloS bOEdYLsspKyyHund4E5IxqgR5qxBKhqiZAmOnsuF5kc1mSzDT+wRLCKrdGH7+kccyoLG iuPygbhNWyULr4o7dq0Vw+TVOwMOkbN6s8OI/44FMhTHGARsSh9VWKTBqv63j1TDUuBm /Roj3M2G+MtuPfgWCdjfOU3HI57tSjdVJC09eVgrB0EnYzLk3X7i6eeWOjvsZC9XtMTd j8AtFigIgzDt4ba0e6tj39rU+mTHuC8+6MdI/Vd2zYfRdA/uEu2mX+tUNYd+Zipe+L2D HRFQ== 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 28si13399334edw.302.2021.03.29.02.41.49; Mon, 29 Mar 2021 02:42:12 -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 S232231AbhC2Jkz (ORCPT + 99 others); Mon, 29 Mar 2021 05:40:55 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:15090 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231936AbhC2Jkj (ORCPT ); Mon, 29 Mar 2021 05:40:39 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4F86vv0T66z19Jrw; Mon, 29 Mar 2021 17:38:35 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.498.0; Mon, 29 Mar 2021 17:40:27 +0800 From: Shixin Liu To: Christian Gromm , Greg Kroah-Hartman CC: , Shixin Liu Subject: [PATCH -next 1/2] drivers: most: use DEFINE_SPINLOCK() for spinlock Date: Mon, 29 Mar 2021 17:40:14 +0800 Message-ID: <20210329094015.66942-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/most/most_cdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/most/most_cdev.c b/drivers/most/most_cdev.c index 044880760b58..8b69cf3ca60b 100644 --- a/drivers/most/most_cdev.c +++ b/drivers/most/most_cdev.c @@ -45,7 +45,7 @@ struct comp_channel { #define to_channel(d) container_of(d, struct comp_channel, cdev) static struct list_head channel_list; -static spinlock_t ch_list_lock; +static DEFINE_SPINLOCK(ch_list_lock); static inline bool ch_has_mbo(struct comp_channel *c) { @@ -495,7 +495,6 @@ static int __init mod_init(void) return PTR_ERR(comp.class); INIT_LIST_HEAD(&channel_list); - spin_lock_init(&ch_list_lock); ida_init(&comp.minor_id); err = alloc_chrdev_region(&comp.devno, 0, CHRDEV_REGION_SIZE, "cdev"); -- 2.25.1