Commit 481a626a authored by Shiju Jose's avatar Shiju Jose Committed by David S. Miller

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: default avatarShiju Jose <shiju.jose@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 381c356e
...@@ -586,18 +586,16 @@ static const struct hclge_hw_blk hw_blk[] = { ...@@ -586,18 +586,16 @@ static const struct hclge_hw_blk hw_blk[] = {
int hclge_hw_error_set_state(struct hclge_dev *hdev, bool state) int hclge_hw_error_set_state(struct hclge_dev *hdev, bool state)
{ {
const struct hclge_hw_blk *module = hw_blk;
int ret = 0; int ret = 0;
int i = 0;
while (hw_blk[i].name) { while (module->name) {
if (!hw_blk[i].config_err_int) { if (module->config_err_int) {
i++; ret = module->config_err_int(hdev, state);
continue;
}
ret = hw_blk[i].config_err_int(hdev, state);
if (ret) if (ret)
return ret; return ret;
i++; }
module++;
} }
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment