]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: refactor reset_prepare_general retry statement
authorJiaran Zhang <zhangjiaran@huawei.com>
Mon, 29 Nov 2021 14:00:18 +0000 (22:00 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Nov 2021 14:26:17 +0000 (14:26 +0000)
commitf73767746fb3446f3f3ef57591d369de64f7d25c
tree500655cfe31aaa671962f540835ca435bc10c06b
parenta4f14c46e0da88b5f686caece7b752f99911d703
net: hns3: refactor reset_prepare_general retry statement

Currently, the hclge_reset_prepare_general function uses the goto
statement to jump upwards, which increases code complexity and makes
the program structure difficult to understand. In addition, if
reset_pending is set, retry_cnt cannot be increased. This may result
in a failure to exit the retry or increase the number of retries.

Use the while statement instead to make the program easier to understand
and solve the problem that the goto statement cannot be exited.

Signed-off-by: Jiaran Zhang <zhangjiaran@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c