[v2,08/17] net/hns3: add break to exit loop when err stat item found
diff mbox series

Message ID 20200922120329.21185-9-huwei013@chinasoftinc.com
State Accepted
Delegated to: Ferruh Yigit
Headers show
  • updates for hns3 PMD driver
Related show


Context Check Description
ci/checkpatch success coding style OK

Commit Message

Wei Hu (Xavier) Sept. 22, 2020, 12:03 p.m. UTC
From: Hongbo Zheng <zhenghongbo3@huawei.com>

This patch solves the redundant operation during traversal. In the internal
function named hns3_error_int_stats_add for adding error statistics,
because only one statistical item will be found in the for loop statement,
a break can be executed after finding the error statistical item without
traversing the remaining table entries.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
 drivers/net/hns3/hns3_stats.c | 1 +
 1 file changed, 1 insertion(+)

diff mbox series

diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c
index 067673c..e8846b9 100644
--- a/drivers/net/hns3/hns3_stats.c
+++ b/drivers/net/hns3/hns3_stats.c
@@ -703,6 +703,7 @@  hns3_error_int_stats_add(struct hns3_adapter *hns, const char *err)
 			addr = (char *)&pf->abn_int_stats +
 			*(uint64_t *)addr += 1;
+			break;