From patchwork Wed Feb 8 22:25:01 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: 9563681 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 52C7A60236 for ; Wed, 8 Feb 2017 22:28:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26C20284F2 for ; Wed, 8 Feb 2017 22:28:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BADE2852C; Wed, 8 Feb 2017 22:28:37 +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 AEEC12852B for ; Wed, 8 Feb 2017 22:28:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751429AbdBHW2g (ORCPT ); Wed, 8 Feb 2017 17:28:36 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:63863 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689AbdBHW1w (ORCPT ); Wed, 8 Feb 2017 17:27:52 -0500 X-IronPort-AV: E=Sophos;i="5.35,348,1483977600"; d="scan'208";a="76618187" Received: from unknown (HELO milsmgep15.sandisk.com) ([63.163.107.21]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2017 06:28:21 +0800 Received: from MILHUBIP03.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 A6.54.57638.BCA9B985; Wed, 8 Feb 2017 14:25:15 -0800 (PST) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Wed, 8 Feb 2017 14:25:11 -0800 X-AuditID: 0ac94369-26dee9800001e126-fc-589b9acb2e9e Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 18.42.18148.7CA9B985; Wed, 8 Feb 2017 14:25:11 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: , Christoph Hellwig , Andy Grover , David Disseldorp Subject: [PATCH v4 31/37] target: Change return type of transport_wait_for_tasks() into void Date: Wed, 8 Feb 2017 14:25:01 -0800 Message-ID: <20170208222507.25715-32-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170208222507.25715-1-bart.vanassche@sandisk.com> References: <20170208222507.25715-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCLMWRmVeSWpSXmKPExsXCddJ5ke7pWbMjDGY+1LfYP+sZk8XX/9NZ LFauPspk0br0LZMDi8fumw1sHu/3XWXz2Hy62uPzJrkAligum5TUnMyy1CJ9uwSujK4j31kK lkhV/Lu+g7GBcapYFyMHh4SAiUT73aouRk4OIYGlTBJT/kp0MXIB2dsZJZZP2sYMkgCpad20 nB0isZFRYlb/WzaQBJuAkcS39zNZQGwRAQOJ370XGEGKmAU6GCXm9zxjBUkIC8RIfP1/mxVk G4uAikTfUgOQMK+Ag8TWo39YIBbIS+xquwhWzgkUn/DyGSPERfYSrw58AZspIdDFKjHn7mEm iGZBiZMzn4A1MwtISBx88YIZokFd4uSS+UwTGIVmISmbhaRsASPTKkax3Myc4tz01AJDU73i xLyUzOJsveT83E2MkLDO3MF494n3IUYBDkYlHt4Ky9kRQqyJZcWVuYcYJTiYlUR4U6YBhXhT EiurUovy44tKc1KLDzFKc7AoifOek5kaISSQnliSmp2aWpBaBJNl4uCUamCUDS0zO6HJ+2rC wg6xz4YXTufsWCS91PVw98O1m+oWfH+r+3NV+IENh+YHb0jNnpz3v+7vZtkXm2y3SzzwORIk tO+f/f449u3B7alHslzsbDPXr7Kf6+btF/THUjGIUa/CuTb42PKo9FmvIlT+mN6PWZYsJhit p3xL7O2E6ec3+s1n/c3EsKhPiaU4I9FQi7moOBEAKUYgG2cCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKJMWRmVeSWpSXmKPExsXCtZGTTff4rNkRBi2zrCz2z3rGZHHwZxuj xdf/01ksVq4+ymTRuvQtkwOrx+6bDWwe7/ddZfOYtuY8k8fm09UenzfJBbBGcdmkpOZklqUW 6dslcGV0HfnOUrBEquLf9R2MDYxTxboYOTkkBEwkWjctZ+9i5OIQEljPKHH1Zh8LSIJNwEji 2/uZYLaIgIHE794LjCBFzAJdjBKbzpxiB0kIC8RIfP1/m7WLkYODRUBVYv8lYZAwr4CDxIzv e1ggFshL7Gq7yApicwLFJ7x8xghiCwnYS7w68IVxAiP3AkaGVYxiuZk5xbnpmQWGRnrFiXkp mcXZesn5uZsYIQERtYPx+kTzQ4xMHJxSDYzrIl+Lymu+aLNcoGB9V/LsMmYln8lzhD08q1k8 vsRb/etT3duyMkLp6IbwJb5LFs3o9P749ErF4tfR/wK586e5qsW033m36JFP9Rm9Ofsqfnnw vbT98Dq6/WnAzytNccIqPDf+TVPoO7e3ouz+g2hrk7BEGYaq0qxjv2Zc41uZvWqXs2t2jqoS S3FGoqEWc1FxIgA6slYmuAEAAA== 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 f6d38eba139e..fdd06ecacd52 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -2488,7 +2488,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) @@ -2711,7 +2711,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) @@ -2725,17 +2725,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; @@ -2752,24 +2752,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);