RE: [PATCH 16/24] scsi: consolidate opcode lookup in scsi_opcode_sa_name()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Hannes Reinecke [mailto:hare@xxxxxxx]
...
> diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
...
> @@ -332,21 +340,20 @@ static void print_opcode_name(unsigned char * cdbp, int
> cdb_len)
>  		len = cdb_len;
>  	}
> 
> -	if (!scsi_opcode_sa_name(cdb0, sa, &name)) {
> -		if (cdb0 < 0xc0) {
> -			if (ARRAY_SIZE(cdb_byte0_names)) {
> -				name = cdb_byte0_names[cdb0];
> -				if (name)
> -					printk("%s", name);
> -				else
> -					printk("cdb[0]=0x%x (reserved)", cdb0);
> -			} else
> -				printk("cdb[0]=0x%x", cdb0);
> -		} else
> +	if (!scsi_opcode_sa_name(cdb0, sa, &cdb_name, &sa_name)) {
> +		if (cdb_name)
> +			printk("%s", cdb_name);
> +		else if (cdb0 > VENDOR_SPECIFIC_CDB)
>  			printk("cdb[0]=0x%x (vendor)", cdb0);
> +		else if (cdb0 > 0x60 && cdb0 < 0x7e)
> +			printk("cdb[0]=0x%x (reserved)", cdb0);
> +		else
> +			printk("cdb[0]=0x%x", cdb0);

Both of those > need to be >=, since the reserved
range starts at and includes 0x60, and the vendor
specific range starts at and includes 0xc0.

---
Rob Elliott    HP Server Storage



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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux