Commit 34217f78 authored by Jie Wang's avatar Jie Wang Committed by Jiantao Xiao
Browse files

net: hns3: add build check in hclge_get_vf_isolate_bitmap

driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I6W94W


CVE: NA

----------------------------------------------------------------------

This patch adds a build check to guarantee enum value and avoid future
issues.

Signed-off-by: default avatarJie Wang <wangjie125@huawei.com>
Signed-off-by: default avatarJiantao Xiao <xiaojiantao1@h-partners.com>
parent 29e4bb1a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3016,6 +3016,9 @@ static void hclge_get_vf_fault_bitmap(struct hclge_desc *desc,

	u8 *buff;

	BUILD_BUG_ON(HCLGE_FIR_FAULT_BYTES + HCLGE_SEC_FAULT_BYTES !=
		     BITS_TO_BYTES(HCLGE_VPORT_NUM));

	memcpy(bitmap, desc[0].data, HCLGE_FIR_FAULT_BYTES);
	buff = (u8 *)bitmap + HCLGE_FIR_FAULT_BYTES;
	memcpy(buff, desc[1].data, HCLGE_SEC_FAULT_BYTES);