From patchwork Fri Feb 10 01:28:46 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: 9565797 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 7549D60572 for ; Fri, 10 Feb 2017 01:29:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66BB82853B for ; Fri, 10 Feb 2017 01:29:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BA572853A; Fri, 10 Feb 2017 01:29:45 +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 F0FA72853B for ; Fri, 10 Feb 2017 01:29:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751478AbdBJB3n (ORCPT ); Thu, 9 Feb 2017 20:29:43 -0500 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:36294 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751404AbdBJB3h (ORCPT ); Thu, 9 Feb 2017 20:29:37 -0500 X-IronPort-AV: E=Sophos;i="5.33,348,1477929600"; d="scan'208";a="82349556" Received: from unknown (HELO milsmgep15.sandisk.com) ([63.163.107.21]) by ob1.hgst.iphmx.com with ESMTP; 10 Feb 2017 09:29:01 +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 12.97.57638.D571D985; Thu, 9 Feb 2017 17:29:01 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Thu, 9 Feb 2017 17:28:56 -0800 X-AuditID: 0ac94369-26dee9800001e126-03-589d175de875 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id C7.9F.11415.7571D985; Thu, 9 Feb 2017 17:28:55 -0800 (PST) From: Bart Van Assche To: "Nicholas A . Bellinger" CC: , Bart Van Assche , Christoph Hellwig , Andy Grover , David Disseldorp Subject: [PATCH v5 16/22] target: Change return type of transport_wait_for_tasks() into void Date: Thu, 9 Feb 2017 17:28:46 -0800 Message-ID: <20170210012852.15735-17-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170210012852.15735-1-bart.vanassche@sandisk.com> References: <20170210012852.15735-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrALMWRmVeSWpSXmKPExsXCddJ5kW6s+NwIg76Pqhb7Zz1jsvj6fzqL xcrVR5ks2lafYbRoXfqWyYHV4/72I0weu282sHm833eVzWPz6WqPz5vkAlijuGxSUnMyy1KL 9O0SuDI69x1jK1giVTH5zAuWBsapYl2MnBwSAiYSh5fNZO1i5OIQEljKJDHxQyeUs5VRYte8 bnaYqovnz7BBJDYySjRPmAeWYBMwkvj2fiYLiC0CZK/uWcYEUsQssINRYuLK3WBFwgIxEs+P L2MFsVkEVCQm7D3NBmLzCjhInG/ZwwKxQV5iV9tFsBpOoPir2deBbA6gbfYSO3YZgMyUEOhj lZiwaB0jRK+gxMmZT8B6mQUkJA6+eMEMYgsJqEucXDKfaQKj0CwkZbOQlC1gZFrFKJabmVOc m55aYGiqV5yYl5JZnK2XnJ+7iRES7pk7GO8+8T7EKMDBqMTD+6JmToQQa2JZcWXuIUYJDmYl Ed77fHMjhHhTEiurUovy44tKc1KLDzFKc7AoifOek5kaISSQnliSmp2aWpBaBJNl4uCUamCc svu/+S6x5/V7WeQDsky51OXYo0USF60QVDG0/vI1Kvv2upR/lUd5re+dklkvEniQI71FLqW+ xGKnE9fW48sEs5j6Ku7LRcmrc6+M5+wT1Nk3b9EVi522Os0f3jdYLnw4d0nQ2isNeY1RalNs H8n+OBB8f9En5rZT/Cf2rU28ZdVqearJpl2JpTgj0VCLuag4EQAAlXI7cwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPJMWRmVeSWpSXmKPExsXCtZGTTTdcfG6EwemdShb7Zz1jsjj4s43R 4uv/6SwWK1cfZbJoW32G0aJ16VsmBzaP+9uPMHnsvtnA5vF+31U2j2lrzjN5bD5d7fF5k1wA WxSXTUpqTmZZapG+XQJXRue+Y2wFS6QqJp95wdLAOFWsi5GTQ0LAROLi+TNsXYxcHEIC6xkl Zny7zgySYBMwkvj2fiYLiC0CZK/uWcYEUsQssItRYvKEE2AJYYEYiefHl7GC2CwCqhIffj8H s3kFHCQ61j1kg9ggL7Gr7SJYnBMo/mr2dSCbA2ibvcSOXQYTGLkXMDKsYhTLzcwpzk3PLDA0 1CtOzEvJLM7WS87P3cQICZLIHYxPJ5ofYmTi4JRqYIzJs45hazMO8/VcdXu9aEIr//SP9hIP rD5e/TttbcqO5mt9j1JtD+Q7c0nvEJ9oFPB9SUbh5cnzFbjYJ5/rst2totyUbz77r7LPejYv FYfXbWlqVV3vS71VD3oFrnDX3p917Fu+/n+OvhmtLR+czJ2uRybLKReylb570XQmxKvY+u7U L8IrlViKMxINtZiLihMBjGYfosIBAAA= 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 89f8c4c3ba47..0664e57e2211 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -2507,7 +2507,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) @@ -2770,7 +2770,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) @@ -2784,17 +2784,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; @@ -2813,24 +2813,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);