]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd13e89e44e302db0569e3d557478e469ce52f620
tree820e545b3531a691ea7859e74ea3b2c4d0966751
parentefb81a34049e928e7ee7fc3b0fd7978bf1d7f1ef
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