diff mbox series

[07/19] net/hns3: fix gcov compile warning

Message ID 20220930072220.20753-8-liudongdong3@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Andrew Rybchenko
Headers show
Series some bugfixes and clean code for hns3 - part2 | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Dongdong Liu Sept. 30, 2022, 7:22 a.m. UTC
meson build -Db_coverage=true
ninja -C build

../drivers/net/hns3/hns3_ethdev.c:2856:22: warning: ‘cfg.umv_space’ may be
used uninitialized in this function [-Wmaybe-uninitialized]
 2856 |  pf->wanted_umv_size = cfg.umv_space;

This patch fix compiling warnings using gcc10.3.1 version.

Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index 330a913cb8..bbc086f21d 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -2808,6 +2808,7 @@  hns3_get_board_configuration(struct hns3_hw *hw)
 	struct hns3_cfg cfg;
 	int ret;
 
+	memset(&cfg, 0, sizeof(cfg));
 	ret = hns3_get_board_cfg(hw, &cfg);
 	if (ret) {
 		PMD_INIT_LOG(ERR, "get board config failed %d", ret);