ata: libata-scsi: simplify __ata_scsi_queuecmd()
authorWenchao Hao <haowenchao@huawei.com>
Thu, 6 Jan 2022 00:13:54 +0000 (19:13 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:41:00 +0000 (17:41 +0100)
commite09583e83e4add0fbd78cf8564db87a12d0a5fe9
tree8d7cd5030757a50542fe260375e73d82e03480c0
parenta9059e338fc000c0b87d8cf29e93c74fd703212e
ata: libata-scsi: simplify __ata_scsi_queuecmd()

[ Upstream commit 84eac327af543f03172085d5ef9f98ea25a51191 ]

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>
Stable-dep-of: e20e81a24a4d ("ata: libata-core: do not issue non-internal commands once EH is pending")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ata/libata-scsi.c