From: Hongbo Zheng Date: Tue, 22 Sep 2020 12:03:20 +0000 (+0800) Subject: net/hns3: break loop in adding error stats X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2bc3797c53857abbe8ca9bbe5429cc42992158c5;p=dpdk.git net/hns3: break loop in adding error stats 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 Signed-off-by: Wei Hu (Xavier) --- diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c index 067673c833..e8846b9d87 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 + hns3_error_int_stats_strings[i].offset; *(uint64_t *)addr += 1; + break; } } }