summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hns3/hnae3.h
diff options
context:
space:
mode:
authorHuazhong Tan <tanhuazhong@huawei.com>2020-01-04 10:49:30 +0800
committerDavid S. Miller <davem@davemloft.net>2020-01-06 13:26:25 -0800
commit7061867b59e0e5231b64655356c67ec31f44bc01 (patch)
treea9e9f1370f629ebf36aa918a8bc9e4b17a7d5e61 /drivers/net/ethernet/hisilicon/hns3/hnae3.h
parent2af8cb6126f36ffad848d1b0af714c09eb801b9d (diff)
net: hns3: replace an unsuitable variable type in hclge_inform_reset_assert_to_vf()
In hclge_inform_reset_assert_to_vf(), variable reset_type(enum type) will be copied into msg_data whose size is 2 bytes. Currently, hip08 is a little-endian machine, so the lower two bytes of reset_type will be copied to msg_data. But when running on a big-endian machine, msg_data will have a wrong value(the higher two bytes of reset_type). So this patch modifies the type of reset_type to u16, and adds a build check in case enum hnae3_reset_type has value larger than U16_MAX. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hnae3.h')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hnae3.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index ed97bd6c03e6..6b131ab36c7e 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -164,6 +164,7 @@ enum hnae3_reset_type {
HNAE3_IMP_RESET,
HNAE3_UNKNOWN_RESET,
HNAE3_NONE_RESET,
+ HNAE3_MAX_RESET,
};
enum hnae3_flr_state {