print_opcode_name() was only ever called with a '0' argument from LLDDs and ULDs which were _not_ supporting variable length CDBs, so the 'if' clause was never triggered.
Reviewed-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Hannes Reinecke <h...@suse.de> --- drivers/scsi/constants.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c index 2110d61..713e1e0 100644 --- a/drivers/scsi/constants.c +++ b/drivers/scsi/constants.c @@ -320,25 +320,21 @@ static bool scsi_opcode_sa_name(int cmd, int service_action, return true; } -/* attempt to guess cdb length if cdb_len==0 . No trailing linefeed. */ -static void print_opcode_name(unsigned char * cdbp, int cdb_len) +static void print_opcode_name(unsigned char *cdbp) { - int sa, len, cdb0; + int sa, cdb0; const char *cdb_name = NULL, *sa_name = NULL; cdb0 = cdbp[0]; if (cdb0 == VARIABLE_LENGTH_CMD) { - len = scsi_varlen_cdb_length(cdbp); + int len = scsi_varlen_cdb_length(cdbp); if (len < 10) { - printk("short variable length command, " - "len=%d ext_len=%d", len, cdb_len); + printk("short variable length command, len=%d", len); return; } sa = (cdbp[8] << 8) + cdbp[9]; - } else { + } else sa = cdbp[1] & 0x1f; - len = cdb_len; - } if (!scsi_opcode_sa_name(cdb0, sa, &cdb_name, &sa_name)) { if (cdb_name) @@ -356,9 +352,6 @@ static void print_opcode_name(unsigned char * cdbp, int cdb_len) printk("%s, sa=0x%x", cdb_name, sa); else printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa); - - if (cdb_len > 0 && len != cdb_len) - printk(", in_cdb_len=%d, ext_len=%d", len, cdb_len); } } @@ -366,7 +359,7 @@ void __scsi_print_command(unsigned char *cdb) { int k, len; - print_opcode_name(cdb, 0); + print_opcode_name(cdb); len = scsi_command_size(cdb); /* print out all bytes in cdb */ for (k = 0; k < len; ++k) @@ -383,7 +376,7 @@ void scsi_print_command(struct scsi_cmnd *cmd) return; scmd_printk(KERN_INFO, cmd, "CDB: "); - print_opcode_name(cmd->cmnd, cmd->cmd_len); + print_opcode_name(cmd->cmnd); /* print out all bytes in cdb */ printk(":"); -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html