From patchwork Fri Mar 23 17:19:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 10305167 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7D69E600CC for ; Fri, 23 Mar 2018 17:20:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F8362904C for ; Fri, 23 Mar 2018 17:20:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 642B729059; Fri, 23 Mar 2018 17:20:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22F7729059 for ; Fri, 23 Mar 2018 17:20:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752180AbeCWRUY (ORCPT ); Fri, 23 Mar 2018 13:20:24 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:41849 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751836AbeCWRUW (ORCPT ); Fri, 23 Mar 2018 13:20:22 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1ezQMB-00055i-GN; Fri, 23 Mar 2018 18:19:59 +0100 Date: Fri, 23 Mar 2018 18:19:59 +0100 From: "bigeasy@linutronix.de" To: Linus Torvalds , "nab@linux-iscsi.org" Cc: Bart Van Assche , "acme@kernel.org" , "daniel@bristot.me" , "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , "rostedt@goodmis.org" , "tglx@linutronix.de" , "williams@redhat.com" , "linux-scsi@vger.kernel.org" , "lclaudio@redhat.com" , "target-devel@vger.kernel.org" , "linux-rt-users@vger.kernel.org" Subject: [PATCH 2/2] target: remove spin_lock_assert() in __target_(attach|detach)_tg_pt_gp() Message-ID: <20180323171959.7ac6klrqg4fdk3ey@linutronix.de> References: <20180321153854.GB24312@kernel.org> <20180322093745.GC4229@kernel.org> <20180323155513.dwbgvblenlji33as@linutronix.de> <1521822325.2535.5.camel@wdc.com> <20180323171736.bcyi2oiolge4l6hl@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180323171736.bcyi2oiolge4l6hl@linutronix.de> User-Agent: NeoMutt/20180223 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP __target_attach_tg_pt_gp() and __target_detach_tg_pt_gp() check if the caller holds lun_tg_pt_gp_lock(). Both functions are static, the callers are acquiring the lock before the invocation of the function so the check looks superfluous. Remove it. Signed-off-by: Sebastian Andrzej Siewior --- drivers/target/target_core_alua.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c index e46ca968009c..e5bda674bdbd 100644 --- a/drivers/target/target_core_alua.c +++ b/drivers/target/target_core_alua.c @@ -1843,8 +1843,6 @@ static void __target_attach_tg_pt_gp(struct se_lun *lun, { struct se_dev_entry *se_deve; - assert_spin_locked(&lun->lun_tg_pt_gp_lock); - spin_lock(&tg_pt_gp->tg_pt_gp_lock); lun->lun_tg_pt_gp = tg_pt_gp; list_add_tail(&lun->lun_tg_pt_gp_link, &tg_pt_gp->tg_pt_gp_lun_list); @@ -1868,8 +1866,6 @@ void target_attach_tg_pt_gp(struct se_lun *lun, static void __target_detach_tg_pt_gp(struct se_lun *lun, struct t10_alua_tg_pt_gp *tg_pt_gp) { - assert_spin_locked(&lun->lun_tg_pt_gp_lock); - spin_lock(&tg_pt_gp->tg_pt_gp_lock); list_del_init(&lun->lun_tg_pt_gp_link); tg_pt_gp->tg_pt_gp_members--;