ata: libata-scsi: simplify __ata_scsi_queuecmd()
authorWenchao Hao <haowenchao@huawei.com>
Thu, 6 Jan 2022 00:13:54 +0000 (19:13 -0500)
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>
Fri, 14 Jan 2022 06:17:17 +0000 (15:17 +0900)
commit84eac327af543f03172085d5ef9f98ea25a51191
tree820e545b3531a691ea7859e74ea3b2c4d0966751
parentdb6a3f47cecc3da00d13fc68738aaa96e31f7c04
ata: libata-scsi: simplify __ata_scsi_queuecmd()

This patch cleans up the code of __ata_scsi_queuecmd(). Since each
branch of the "if" condition check that scmd->cmd_len is not zero, move
this check out of the "if" to simplify the conditions being checked in
the "else" branch.

While at it, avoid the if-else-if-else structure using if-else if
structure and remove the redundant rc local variable.

This patch does not change the function logic.

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
drivers/ata/libata-scsi.c