mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-07 14:27:05 +07:00
net: hns3: add optimization in the hclge_hw_error_set_state
1. This patch adds minor loop optimization in the hclge_hw_error_set_state function. 2. Adds logging module's name if it fails to configure the error interrupts. Signed-off-by: Shiju Jose <shiju.jose@huawei.com> Signed-off-by: Salil Mehta <salil.mehta@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
381c356e95
commit
481a626a60
@ -586,18 +586,16 @@ static const struct hclge_hw_blk hw_blk[] = {
|
||||
|
||||
int hclge_hw_error_set_state(struct hclge_dev *hdev, bool state)
|
||||
{
|
||||
const struct hclge_hw_blk *module = hw_blk;
|
||||
int ret = 0;
|
||||
int i = 0;
|
||||
|
||||
while (hw_blk[i].name) {
|
||||
if (!hw_blk[i].config_err_int) {
|
||||
i++;
|
||||
continue;
|
||||
while (module->name) {
|
||||
if (module->config_err_int) {
|
||||
ret = module->config_err_int(hdev, state);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
ret = hw_blk[i].config_err_int(hdev, state);
|
||||
if (ret)
|
||||
return ret;
|
||||
i++;
|
||||
module++;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user