[stgt] [PATCH 4/8] In sbc.c implementation of synchronize cache, set resid to 0 unconditionally and remove unused len=0, as const zero is used in set resid

nezhinsky at gmail.com nezhinsky at gmail.com
Wed Apr 25 16:52:17 CEST 2012


From: Alexander Nezhinsky <alexandern at mellanox.com>


Signed-off-by: Alexander Nezhinsky <alexandern at mellanox.com>
---
 usr/sbc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/usr/sbc.c b/usr/sbc.c
index 55145cf..7312c5d 100644
--- a/usr/sbc.c
+++ b/usr/sbc.c
@@ -439,13 +439,15 @@ sense:
 
 static int sbc_sync_cache(int host_no, struct scsi_cmd *cmd)
 {
-	int ret, len;
+	int ret;
 	uint8_t key = ILLEGAL_REQUEST;
 	uint16_t asc = ASC_LUN_NOT_SUPPORTED;
 
 	if (device_reserved(cmd))
 		return SAM_STAT_RESERVATION_CONFLICT;
 
+	scsi_set_in_resid_by_actual(cmd, 0);
+
 	if (cmd->dev->attrs.removable && !cmd->dev->attrs.online) {
 		key = NOT_READY;
 		asc = ASC_MEDIUM_NOT_PRESENT;
@@ -466,12 +468,10 @@ static int sbc_sync_cache(int host_no, struct scsi_cmd *cmd)
 		asc = ASC_INTERNAL_TGT_FAILURE;
 		goto sense;
 	default:
-		len = 0;
 		return SAM_STAT_GOOD;
 	}
 
 sense:
-	scsi_set_in_resid_by_actual(cmd, 0);
 	sense_data_build(cmd, key, asc);
 	return SAM_STAT_CHECK_CONDITION;
 }
-- 
1.7.9.6

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list