Commit 631d1ae4 authored by Wenchao Hao's avatar Wenchao Hao Committed by sanglipeng
Browse files

ata: libata-scsi: simplify __ata_scsi_queuecmd()

stable inclusion
from stable-v5.10.157
commit 4034d06a4dbecab7030a88b735a131357b2dac58
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7MU59

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4034d06a4dbecab7030a88b735a131357b2dac58



--------------------------------

[ Upstream commit 84eac327 ]

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: default avatarWenchao Hao <haowenchao@huawei.com>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Stable-dep-of: e20e81a2 ("ata: libata-core: do not issue non-internal commands once EH is pending")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent eddd63a1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment