From patchwork Wed Feb 15 00:26:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9573113 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 85422600F6 for ; Wed, 15 Feb 2017 00:26:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7947A205D6 for ; Wed, 15 Feb 2017 00:26:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DFC227E5A; Wed, 15 Feb 2017 00:26:59 +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 10336205D6 for ; Wed, 15 Feb 2017 00:26:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751356AbdBOA06 (ORCPT ); Tue, 14 Feb 2017 19:26:58 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:61609 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751210AbdBOA0z (ORCPT ); Tue, 14 Feb 2017 19:26:55 -0500 X-IronPort-AV: E=Sophos;i="5.33,348,1477929600"; d="scan'208";a="86867933" Received: from unknown (HELO milsmgep14.sandisk.com) ([63.163.107.225]) by ob1.hgst.iphmx.com with ESMTP; 15 Feb 2017 08:26:22 +0800 Received: from MILHUBIP04.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 43.FB.18895.E20A3A85; Tue, 14 Feb 2017 16:26:22 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Tue, 14 Feb 2017 16:26:16 -0800 X-AuditID: 0ac94371-0fadb980000049cf-42-58a3a02ed27f Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 83.8D.11415.720A3A85; Tue, 14 Feb 2017 16:26:15 -0800 (PST) From: Bart Van Assche To: "Nicholas A . Bellinger" CC: , Bart Van Assche , Christoph Hellwig , Andy Grover , David Disseldorp Subject: [PATCH v6 30/33] target: Change return type of transport_wait_for_tasks() into void Date: Tue, 14 Feb 2017 16:26:09 -0800 Message-ID: <20170215002612.14566-31-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170215002612.14566-1-bart.vanassche@sandisk.com> References: <20170215002612.14566-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRmVeSWpSXmKPExsXCddJ5ka7egsURBm17dS32z3rGZPH1/3QW i5WrjzJZtK0+w2jRuvQtkwOrx/3tR5g8dt9sYPN4v+8qm8fm09UenzfJBbBGcdmkpOZklqUW 6dslcGVcPtvMVLBEquJh8yPmBsapYl2MnBwSAiYSLe1XmEBsIYGlTBJLD2p0MXIB2TsYJVrP /WaDKWo6s4kNIrGRUeL32fUsIAk2ASOJb+9ngtkiQPbqnmVMIEXMIN0TV+5mB0kIC8RI/JjV yQpiswioSuyZ8IIRxOYVcJD4OmEvM8QGeYldbRfBajiB4jN2nAQaygG0zV7i0RlrkJkSAn2s EnNnHGaH6BWUODnzCdhiZgEJiYMvXjBDvKAucXLJfKYJjEKzkJTNQlK2gJFpFaNYbmZOcW56 aoGhiV5xYl5KZnG2XnJ+7iZGSLAX7mB8fdv7EKMAB6MSD+8J2cURQqyJZcWVuYcYJTiYlUR4 2eqBQrwpiZVVqUX58UWlOanFhxilOViUxHmzZKdGCAmkJ5akZqemFqQWwWSZODilGhgDfycG bNLPu6ArljNL7DT/0jezGrzv2J39fir2SNuG2MMV3BlPuSq++0YJta94vnLK26B2hUUc6v9e xrSts/fKib0muvrP1PK2ddsEvs0VO+5c4Bd6ef7+aw/j/54yTnjhN4vvw0KBS1+T87aoscc1 cP4Wlb2Z+YBXtb1+ef6SmZKXu1bFPdVVYinOSDTUYi4qTgQAIJOh+XICAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPJMWRmVeSWpSXmKPExsXCtZGTTVd9weIIg8nNJhb7Zz1jsjj4s43R 4uv/6SwWK1cfZbJoW32G0aJ16VsmBzaP+9uPMHnsvtnA5vF+31U2j2lrzjN5bD5d7fF5k1wA WxSXTUpqTmZZapG+XQJXxuWzzUwFS6QqHjY/Ym5gnCrWxcjJISFgItF0ZhNbFyMXh5DAekaJ hdNfs4Ak2ASMJL69nwlmiwDZq3uWMYEUMQvsYpSYPOEEWEJYIEbix6xOVhCbRUBVYs+EF4wg Nq+Ag8S1X6tZITbIS+xquwhmcwLFZ+w4CdTLAbTNXuLRGesJjNwLGBlWMYrlZuYU56ZnFhga 6hUn5qVkFmfrJefnbmKEBEnkDsanE80PMTJxcEo1MIruLvXImB68xdD5t71VcPz52GZxtt1L +uPqFcV7nrLZdjAlXZ0/UZS92KGps9TWSSxc4PSMe+9UjzotXzI5NnLycfm30zsnJvctq2Fb uvJsWMIe79VyDKeitxrHSCxN7hfc9jlTeIWe79zr7p/rFtzVUqnvbnWU9Ln6xSTvm9uh1ckH b0z1UmIpzkg01GIuKk4EALY9Eq/CAQAA MIME-Version: 1.0 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 None of the callers of this function uses the returned value. Hence change the return type into void. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp --- drivers/target/target_core_transport.c | 21 ++++++++------------- include/target/target_core_fabric.h | 2 +- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 4293a693e8a4..2d9de8802889 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -2503,7 +2503,7 @@ static void transport_write_pending_qf(struct se_cmd *cmd) } } -static bool +static void __transport_wait_for_tasks(struct se_cmd *, bool, unsigned long *flags); static void target_wait_free_cmd(struct se_cmd *cmd) @@ -2782,7 +2782,7 @@ void transport_clear_lun_ref(struct se_lun *lun) wait_for_completion(&lun->lun_ref_comp); } -static bool __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, +static void __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, unsigned long *flags) __releases(&cmd->t_state_lock) __acquires(&cmd->t_state_lock) @@ -2796,17 +2796,17 @@ static bool __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, if (!(cmd->se_cmd_flags & SCF_SE_LUN_CMD) && !(cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)) - return false; + return; if (!(cmd->se_cmd_flags & SCF_SUPPORTED_SAM_OPCODE) && !(cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)) - return false; + return; if (!(cmd->transport_state & CMD_T_ACTIVE)) - return false; + return; if (fabric_stop && (cmd->transport_state & CMD_T_ABORTED)) - return false; + return; cmd->transport_state |= CMD_T_STOP; @@ -2825,24 +2825,19 @@ static bool __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, pr_debug("wait_for_tasks: Stopped wait_for_completion(&cmd->" "t_transport_stop_comp) for ITT: 0x%08llx\n", cmd->tag); - - return true; } /** * transport_wait_for_tasks - set CMD_T_STOP and wait for t_transport_stop_comp * @cmd: command to wait on */ -bool transport_wait_for_tasks(struct se_cmd *cmd) +void transport_wait_for_tasks(struct se_cmd *cmd) { unsigned long flags; - bool ret; spin_lock_irqsave(&cmd->t_state_lock, flags); - ret = __transport_wait_for_tasks(cmd, false, &flags); + __transport_wait_for_tasks(cmd, false, &flags); spin_unlock_irqrestore(&cmd->t_state_lock, flags); - - return ret; } EXPORT_SYMBOL(transport_wait_for_tasks); diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 25bfdd0d24b0..1e0b4cbd6580 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -151,7 +151,7 @@ void target_execute_cmd(struct se_cmd *cmd); int transport_generic_free_cmd(struct se_cmd *, int); -bool transport_wait_for_tasks(struct se_cmd *); +void transport_wait_for_tasks(struct se_cmd *); int transport_send_check_condition_and_sense(struct se_cmd *, sense_reason_t, int); int target_get_sess_cmd(struct se_cmd *, bool);