Commit 3ff0f0b6 authored by Xiaofei Tan's avatar Xiaofei Tan Committed by Martin K. Petersen

scsi: hisi_sas: consolidate command check in hisi_sas_get_ata_protocol()

Currently we check the fis->command value in 2 locations in
hisi_sas_get_ata_protocol() switch statement. Fix this by consolidating
the check for fis->command value to 1 location only.
Signed-off-by: default avatarXiaofei Tan <tanxiaofei@huawei.com>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 4f4e21b8
...@@ -78,9 +78,8 @@ u8 hisi_sas_get_ata_protocol(struct host_to_dev_fis *fis, int direction) ...@@ -78,9 +78,8 @@ u8 hisi_sas_get_ata_protocol(struct host_to_dev_fis *fis, int direction)
case ATA_CMD_STANDBYNOW1: case ATA_CMD_STANDBYNOW1:
case ATA_CMD_ZAC_MGMT_OUT: case ATA_CMD_ZAC_MGMT_OUT:
return HISI_SAS_SATA_PROTOCOL_NONDATA; return HISI_SAS_SATA_PROTOCOL_NONDATA;
default:
{ case ATA_CMD_SET_MAX:
if (fis->command == ATA_CMD_SET_MAX) {
switch (fis->features) { switch (fis->features) {
case ATA_SET_MAX_PASSWD: case ATA_SET_MAX_PASSWD:
case ATA_SET_MAX_LOCK: case ATA_SET_MAX_LOCK:
...@@ -93,7 +92,9 @@ u8 hisi_sas_get_ata_protocol(struct host_to_dev_fis *fis, int direction) ...@@ -93,7 +92,9 @@ u8 hisi_sas_get_ata_protocol(struct host_to_dev_fis *fis, int direction)
default: default:
return HISI_SAS_SATA_PROTOCOL_NONDATA; return HISI_SAS_SATA_PROTOCOL_NONDATA;
} }
}
default:
{
if (direction == DMA_NONE) if (direction == DMA_NONE)
return HISI_SAS_SATA_PROTOCOL_NONDATA; return HISI_SAS_SATA_PROTOCOL_NONDATA;
return HISI_SAS_SATA_PROTOCOL_PIO; return HISI_SAS_SATA_PROTOCOL_PIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment