On 10/16/22 12:59, Mike Christie wrote:
+/** + * scsi_check_passthrough - Determine if passthrough scsi_cmnd needs a retry. + * @scmd: scsi_cmnd to check. + * + * Return value: + * SCSI_RETURN_NOT_HANDLED - if the caller should process the command + * because there is no error or the passthrough user wanted the default + * error processing. + * SUCCESS, FAILED or NEEDS_RETRY - if this function has determined the + * command should be completed, go through the erorr handler due to + * missing sense or should be retried.
erorr -> error?
+static enum scsi_disposition scsi_check_passthrough(struct scsi_cmnd *scmd) +{ + struct scsi_failure *failure; + struct scsi_sense_hdr sshdr; + enum scsi_disposition ret; + enum sam_status status; + int i; + + if (!scmd->result || !scmd->failures) + return SCSI_RETURN_NOT_HANDLED; + + for (i = 0, failure = &scmd->failures[i]; failure->result; + failure = &scmd->failures[++i]) {
Since the cmd->failures array has a sentinel, can the local variable 'i' be left out by changing "failure = &scmd->failures[++i]" into "failure++"?
+#define SCMD_FAILURE_NONE 0
Is there any patch in this patch series that uses this constant? If not, please remove it.
+#define SCMD_FAILURE_ANY 0x7fffffff
Please consider embedding the word "result" in the name of the above constant, e.g. SCMD_ANY_RESULT_FAILURE or SCMD_RESULT_FAILURE_ANY or SCMD_FAILURE_RESULT_ANY.
Thanks, Bart.