aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShiju Jose <shiju.jose@huawei.com>2018-12-07 21:08:03 +0000
committerDavid S. Miller <davem@davemloft.net>2018-12-07 15:57:01 -0800
commit481a626a603d5e234618a19abbaa889405755f46 (patch)
tree15d968947a66ac32760b0d683931d93c211ea3f4
parentnet: hns3: rename process_hw_error function (diff)
downloadlinux-dev-481a626a603d5e234618a19abbaa889405755f46.tar.xz
linux-dev-481a626a603d5e234618a19abbaa889405755f46.zip
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>
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
index 2d07be873a31..d1c9f7ac9021 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
@@ -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;