[Devel] [PATCH RHEL7 COMMIT] ms/target: Inline transport_get_sense_codes()

Konstantin Khorenko khorenko at virtuozzo.com
Mon Apr 2 17:28:20 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-693.21.1.vz7.46.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.21.1.vz7.46.2
------>
commit d47712e564562670059fe8a1da7f9f8a308faf26
Author: Bart Van Assche <bart.vanassche at sandisk.com>
Date:   Mon Apr 2 17:28:20 2018 +0300

    ms/target: Inline transport_get_sense_codes()
    
    ML: 46d5bd62ef9e3d6e2018963cbb725c91f864922d
    
    Inline this function in its call site since it performs a trivial
    task and since it is only called once.
    
    Signed-off-by: Bart Van Assche <bart.vanassche at sandisk.com>
    Signed-off-by: Sagi Grimberg <sagig at mellanox.com>
    Reviewed-by: Hannes Reinecke <hare at suse.de>
    Reviewed-by: Christoph Hellwig <hch at lst.de>
    Reviewed-by: Martin K. Petersen <martin.petersen at oracle.com>
    Signed-off-by: Nicholas Bellinger <nab at linux-iscsi.org>
    Signed-off-by: Andrei Vagin <avagin at openvz.org>
---
 drivers/target/target_core_transport.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 5d2487b840b1..9b0cacadd46a 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2659,17 +2659,6 @@ bool transport_wait_for_tasks(struct se_cmd *cmd)
 }
 EXPORT_SYMBOL(transport_wait_for_tasks);
 
-static int transport_get_sense_codes(
-	struct se_cmd *cmd,
-	u8 *asc,
-	u8 *ascq)
-{
-	*asc = cmd->scsi_asc;
-	*ascq = cmd->scsi_ascq;
-
-	return 0;
-}
-
 static
 void transport_err_sector_info(unsigned char *buffer, sector_t bad_sector)
 {
@@ -2863,9 +2852,8 @@ transport_send_check_condition_and_sense(struct se_cmd *cmd,
 		buffer[SPC_ADD_SENSE_LEN_OFFSET] = 10;
 		/* Not Ready */
 		buffer[SPC_SENSE_KEY_OFFSET] = NOT_READY;
-		transport_get_sense_codes(cmd, &asc, &ascq);
-		buffer[SPC_ASC_KEY_OFFSET] = asc;
-		buffer[SPC_ASCQ_KEY_OFFSET] = ascq;
+		buffer[SPC_ASC_KEY_OFFSET] = cmd->scsi_asc;
+		buffer[SPC_ASCQ_KEY_OFFSET] = cmd->scsi_ascq;
 		break;
 	case TCM_MISCOMPARE_VERIFY:
 		/* CURRENT ERROR */


More information about the Devel mailing list