Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3456025pxf; Mon, 29 Mar 2021 02:44:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcyf9I+TWUdEuODHhwV2up+B4AuxJ+gG6svbGxTLV0lBIUnqsg45UgVNrHv9ynGkwOLubY X-Received: by 2002:aa7:dd97:: with SMTP id g23mr27333468edv.154.1617011050591; Mon, 29 Mar 2021 02:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617011050; cv=none; d=google.com; s=arc-20160816; b=C6svN/f/71dCUl7Xt1n9HVryPJFp3SOg7mKcHKUY1pEcQ9pMowaLo3We52KTe4mc1g +oD+VBbP0ASbWmWKpBxUDav87QXzbUYoceqSiZgcQCcODFMwK12DLQycXB/Yskb+X95L cjMO41ZuR7G2OavH6pV5J3fjRM2JEwSBXL4zcCLGHP/DY0qB2iLafnxbx33vmi4HNHt2 bRBSqToCxOpbSfDAv4Pqxr0+a0ihIF732cvIIyIoWfZCwibNHUd5b2kvseW1qxp1f7Fk +o8TW5fFbyxABMfnM+pgaFwUB4xDMjut+HmILgMQ4IAPfBn8thRcsKfrXHvi6sRti/9V 9+Ww== 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=uyJa/CBt3lcAzLE7EJXpgzIwDvoicx+ZwYReZKpxSLo=; b=p5L/0Jea1OGGPeyyB/InEEuinaYAFPOBR4T7/6LMPKc/tFgdD9pnL24GKfre3m6H7q nf1ChPJJz0ZXoxB4qfMBZFegfE9bFpDzEk9KbNCaASLNsjf5jUN8I8xDvQk/5kQWro8a Rk4CV7VxCLoScLZgfXwkd+N3V3YZPkBJ4rhJ4b6Br2oWHJrUNlYGN9tSA+1rYdionpSy I7kzCA4v1AKB/btT0xsSL+kQ7eCMPwIZjTFNPBYx4OekzrodYB9nhKu+slWt4/6f42Op h8xBY+MIuFTfNP5qeTsVYqPL27dWFsSLEN1jysiIAXv8LdGmFvT//BBQsCVhnnHzSW6n Ws7Q== 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 p16si12273247edu.606.2021.03.29.02.43.48; Mon, 29 Mar 2021 02:44:10 -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 S232291AbhC2Jk7 (ORCPT + 99 others); Mon, 29 Mar 2021 05:40:59 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:14182 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231933AbhC2Jkj (ORCPT ); Mon, 29 Mar 2021 05:40:39 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4F86vD4ChrzmZYX; Mon, 29 Mar 2021 17:38:00 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Mon, 29 Mar 2021 17:40:29 +0800 From: Shixin Liu To: Karsten Keil CC: , , Shixin Liu Subject: [PATCH -next 1/2] mISDN: Use DEFINE_SPINLOCK() for spinlock Date: Mon, 29 Mar 2021 17:40:17 +0800 Message-ID: <20210329094018.66993-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/isdn/hardware/mISDN/hfcmulti.c | 7 ++----- drivers/isdn/mISDN/dsp_core.c | 3 +-- drivers/isdn/mISDN/l1oip_core.c | 3 +-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c index 14092152b786..4f7eaa17fb27 100644 --- a/drivers/isdn/hardware/mISDN/hfcmulti.c +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c @@ -173,13 +173,13 @@ #define MAX_FRAGS (32 * MAX_CARDS) static LIST_HEAD(HFClist); -static spinlock_t HFClock; /* global hfc list lock */ +static DEFINE_SPINLOCK(HFClock); /* global hfc list lock */ static void ph_state_change(struct dchannel *); static struct hfc_multi *syncmaster; static int plxsd_master; /* if we have a master card (yet) */ -static spinlock_t plx_lock; /* may not acquire other lock inside */ +static DEFINE_SPINLOCK(plx_lock); /* may not acquire other lock inside */ #define TYP_E1 1 #define TYP_4S 4 @@ -5480,9 +5480,6 @@ HFCmulti_init(void) printk(KERN_DEBUG "%s: IRQ_DEBUG IS ENABLED!\n", __func__); #endif - spin_lock_init(&HFClock); - spin_lock_init(&plx_lock); - if (debug & DEBUG_HFCMULTI_INIT) printk(KERN_DEBUG "%s: init entered\n", __func__); diff --git a/drivers/isdn/mISDN/dsp_core.c b/drivers/isdn/mISDN/dsp_core.c index 4946ea14bf74..8766095cd6e7 100644 --- a/drivers/isdn/mISDN/dsp_core.c +++ b/drivers/isdn/mISDN/dsp_core.c @@ -176,7 +176,7 @@ MODULE_LICENSE("GPL"); /*int spinnest = 0;*/ -spinlock_t dsp_lock; /* global dsp lock */ +DEFINE_SPINLOCK(dsp_lock); /* global dsp lock */ struct list_head dsp_ilist; struct list_head conf_ilist; int dsp_debug; @@ -1169,7 +1169,6 @@ static int __init dsp_init(void) printk(KERN_INFO "mISDN_dsp: DSP clocks every %d samples. This equals " "%d jiffies.\n", dsp_poll, dsp_tics); - spin_lock_init(&dsp_lock); INIT_LIST_HEAD(&dsp_ilist); INIT_LIST_HEAD(&conf_ilist); diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c index facbd886ee1c..62fad8f1fc42 100644 --- a/drivers/isdn/mISDN/l1oip_core.c +++ b/drivers/isdn/mISDN/l1oip_core.c @@ -229,7 +229,7 @@ static const char *l1oip_revision = "2.00"; static int l1oip_cnt; -static spinlock_t l1oip_lock; +static DEFINE_SPINLOCK(l1oip_lock); static struct list_head l1oip_ilist; #define MAX_CARDS 16 @@ -1441,7 +1441,6 @@ l1oip_init(void) l1oip_revision); INIT_LIST_HEAD(&l1oip_ilist); - spin_lock_init(&l1oip_lock); if (l1oip_4bit_alloc(ulaw)) return -ENOMEM; -- 2.25.1