From patchwork Fri Mar 23 17:17:36 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: 10305157 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 56E18600CC for ; Fri, 23 Mar 2018 17:18:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46F4529044 for ; Fri, 23 Mar 2018 17:18:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39AB629043; Fri, 23 Mar 2018 17:18:02 +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=ham 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 CB2EC286A1 for ; Fri, 23 Mar 2018 17:18:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751400AbeCWRSA (ORCPT ); Fri, 23 Mar 2018 13:18:00 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:41837 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751388AbeCWRR7 (ORCPT ); Fri, 23 Mar 2018 13:17:59 -0400 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1ezQJs-00052C-N5; Fri, 23 Mar 2018 18:17:36 +0100 Date: Fri, 23 Mar 2018 18:17:36 +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 1/2] target: drop spin_lock_assert() + irqs_disabled() combo checks Message-ID: <20180323171736.bcyi2oiolge4l6hl@linutronix.de> References: <20180321153854.GB24312@kernel.org> <20180322093745.GC4229@kernel.org> <20180323155513.dwbgvblenlji33as@linutronix.de> <1521822325.2535.5.camel@wdc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180223 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are a few functions which check for if the lock is held (spin_lock_assert()) and the interrupts are disabled (irqs_disabled()). From looking at the code, each function is static, the caller is near by and does spin_lock_irq|safe(). As Linus puts it: |It's not like this is some function that is exported to random users, |and we should check that the calling convention is right. | |This looks like "it may have been useful during coding to document |things, but it's not useful long-term". Remove those checks. Signed-off-by: Sebastian Andrzej Siewior --- drivers/target/target_core_tmr.c | 2 -- drivers/target/target_core_transport.c | 6 ------ 2 files changed, 8 deletions(-) diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c index 9c7bc1ca341a..3d35dad1de2c 100644 --- a/drivers/target/target_core_tmr.c +++ b/drivers/target/target_core_tmr.c @@ -114,8 +114,6 @@ static bool __target_check_io_state(struct se_cmd *se_cmd, { struct se_session *sess = se_cmd->se_sess; - assert_spin_locked(&sess->sess_cmd_lock); - WARN_ON_ONCE(!irqs_disabled()); /* * If command already reached CMD_T_COMPLETE state within * target_complete_cmd() or CMD_T_FABRIC_STOP due to shutdown, diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 74b646f165d4..2c3ddb3a4124 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -2954,9 +2954,6 @@ __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, __acquires(&cmd->t_state_lock) { - assert_spin_locked(&cmd->t_state_lock); - WARN_ON_ONCE(!irqs_disabled()); - if (fabric_stop) cmd->transport_state |= CMD_T_FABRIC_STOP; @@ -3241,9 +3238,6 @@ static int __transport_check_aborted_status(struct se_cmd *cmd, int send_status) { int ret; - assert_spin_locked(&cmd->t_state_lock); - WARN_ON_ONCE(!irqs_disabled()); - if (!(cmd->transport_state & CMD_T_ABORTED)) return 0; /*