net/hns3: break loop in adding error stats
authorHongbo Zheng <zhenghongbo3@huawei.com>
Tue, 22 Sep 2020 12:03:20 +0000 (20:03 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 30 Sep 2020 17:19:11 +0000 (19:19 +0200)
commit2bc3797c53857abbe8ca9bbe5429cc42992158c5
tree8fce01b1be9e3184e1ff65388b3c208f0c5be8ec
parent18a4b4c3fa805fbc4ffcf9ee301ec6d02e0b6d7b
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 <zhenghongbo3@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
drivers/net/hns3/hns3_stats.c