net: hns3: remove a redundant hclge_cmd_csq_done
Set complete in the first hclge_cmd_csq_done of hclge_cmd_send, and check if complete later, unnecessary to do hclge_cmd_csq_done again. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1c1270da47
commit
f6762f3852
@ -242,15 +242,18 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num)
|
||||
*/
|
||||
if (HCLGE_SEND_SYNC(le16_to_cpu(desc->flag))) {
|
||||
do {
|
||||
if (hclge_cmd_csq_done(hw))
|
||||
if (hclge_cmd_csq_done(hw)) {
|
||||
complete = true;
|
||||
break;
|
||||
}
|
||||
udelay(1);
|
||||
timeout++;
|
||||
} while (timeout < hw->cmq.tx_timeout);
|
||||
}
|
||||
|
||||
if (hclge_cmd_csq_done(hw)) {
|
||||
complete = true;
|
||||
if (!complete) {
|
||||
retval = -EAGAIN;
|
||||
} else {
|
||||
handle = 0;
|
||||
while (handle < num) {
|
||||
/* Get the result of hardware write back */
|
||||
@ -274,9 +277,6 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num)
|
||||
}
|
||||
}
|
||||
|
||||
if (!complete)
|
||||
retval = -EAGAIN;
|
||||
|
||||
/* Clean the command send queue */
|
||||
handle = hclge_cmd_csq_clean(hw);
|
||||
if (handle != num) {
|
||||
|
Loading…
Reference in New Issue
Block a user