提交 9cbaa4dd 编写于 作者: Y Yonglong Liu 提交者: Yang Yingliang

net: hns3: the pointer is cast to another pointer in a different type, which is incompatible.

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

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

The type of desc.date is __le32, must change to cpu endian
before use.
Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
Reviewed-by: NJunxin Chen <chenjunxin1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 a82f8f20
...@@ -391,7 +391,7 @@ static int hclge_dbg_dump_mac(struct hclge_dev *hdev, char *buf, int len) ...@@ -391,7 +391,7 @@ static int hclge_dbg_dump_mac(struct hclge_dev *hdev, char *buf, int len)
static int hclge_dbg_dump_dcb_qset(struct hclge_dev *hdev, char *buf, int len, static int hclge_dbg_dump_dcb_qset(struct hclge_dev *hdev, char *buf, int len,
int *pos) int *pos)
{ {
struct hclge_dbg_bitmap_cmd *bitmap; struct hclge_dbg_bitmap_cmd req;
struct hclge_desc desc; struct hclge_desc desc;
u16 qset_id, qset_num; u16 qset_id, qset_num;
int ret; int ret;
...@@ -408,12 +408,12 @@ static int hclge_dbg_dump_dcb_qset(struct hclge_dev *hdev, char *buf, int len, ...@@ -408,12 +408,12 @@ static int hclge_dbg_dump_dcb_qset(struct hclge_dev *hdev, char *buf, int len,
if (ret) if (ret)
return ret; return ret;
bitmap = (struct hclge_dbg_bitmap_cmd *)&desc.data[1]; req.bitmap = (u8)le32_to_cpu(desc.data[1]);
*pos += scnprintf(buf + *pos, len - *pos, *pos += scnprintf(buf + *pos, len - *pos,
"%04u %#x %#x %#x %#x\n", "%04u %#x %#x %#x %#x\n",
qset_id, bitmap->bit0, bitmap->bit1, qset_id, req.bit0, req.bit1, req.bit2,
bitmap->bit2, bitmap->bit3); req.bit3);
} }
return 0; return 0;
...@@ -422,7 +422,7 @@ static int hclge_dbg_dump_dcb_qset(struct hclge_dev *hdev, char *buf, int len, ...@@ -422,7 +422,7 @@ static int hclge_dbg_dump_dcb_qset(struct hclge_dev *hdev, char *buf, int len,
static int hclge_dbg_dump_dcb_pri(struct hclge_dev *hdev, char *buf, int len, static int hclge_dbg_dump_dcb_pri(struct hclge_dev *hdev, char *buf, int len,
int *pos) int *pos)
{ {
struct hclge_dbg_bitmap_cmd *bitmap; struct hclge_dbg_bitmap_cmd req;
struct hclge_desc desc; struct hclge_desc desc;
u8 pri_id, pri_num; u8 pri_id, pri_num;
int ret; int ret;
...@@ -439,12 +439,11 @@ static int hclge_dbg_dump_dcb_pri(struct hclge_dev *hdev, char *buf, int len, ...@@ -439,12 +439,11 @@ static int hclge_dbg_dump_dcb_pri(struct hclge_dev *hdev, char *buf, int len,
if (ret) if (ret)
return ret; return ret;
bitmap = (struct hclge_dbg_bitmap_cmd *)&desc.data[1]; req.bitmap = (u8)le32_to_cpu(desc.data[1]);
*pos += scnprintf(buf + *pos, len - *pos, *pos += scnprintf(buf + *pos, len - *pos,
"%03u %#x %#x %#x\n", "%03u %#x %#x %#x\n",
pri_id, bitmap->bit0, bitmap->bit1, pri_id, req.bit0, req.bit1, req.bit2);
bitmap->bit2);
} }
return 0; return 0;
...@@ -453,7 +452,7 @@ static int hclge_dbg_dump_dcb_pri(struct hclge_dev *hdev, char *buf, int len, ...@@ -453,7 +452,7 @@ static int hclge_dbg_dump_dcb_pri(struct hclge_dev *hdev, char *buf, int len,
static int hclge_dbg_dump_dcb_pg(struct hclge_dev *hdev, char *buf, int len, static int hclge_dbg_dump_dcb_pg(struct hclge_dev *hdev, char *buf, int len,
int *pos) int *pos)
{ {
struct hclge_dbg_bitmap_cmd *bitmap; struct hclge_dbg_bitmap_cmd req;
struct hclge_desc desc; struct hclge_desc desc;
u8 pg_id; u8 pg_id;
int ret; int ret;
...@@ -466,12 +465,11 @@ static int hclge_dbg_dump_dcb_pg(struct hclge_dev *hdev, char *buf, int len, ...@@ -466,12 +465,11 @@ static int hclge_dbg_dump_dcb_pg(struct hclge_dev *hdev, char *buf, int len,
if (ret) if (ret)
return ret; return ret;
bitmap = (struct hclge_dbg_bitmap_cmd *)&desc.data[1]; req.bitmap = (u8)le32_to_cpu(desc.data[1]);
*pos += scnprintf(buf + *pos, len - *pos, *pos += scnprintf(buf + *pos, len - *pos,
"%03u %#x %#x %#x\n", "%03u %#x %#x %#x\n",
pg_id, bitmap->bit0, bitmap->bit1, pg_id, req.bit0, req.bit1, req.bit2);
bitmap->bit2);
} }
return 0; return 0;
...@@ -511,7 +509,7 @@ static int hclge_dbg_dump_dcb_queue(struct hclge_dev *hdev, char *buf, int len, ...@@ -511,7 +509,7 @@ static int hclge_dbg_dump_dcb_queue(struct hclge_dev *hdev, char *buf, int len,
static int hclge_dbg_dump_dcb_port(struct hclge_dev *hdev, char *buf, int len, static int hclge_dbg_dump_dcb_port(struct hclge_dev *hdev, char *buf, int len,
int *pos) int *pos)
{ {
struct hclge_dbg_bitmap_cmd *bitmap; struct hclge_dbg_bitmap_cmd req;
struct hclge_desc desc; struct hclge_desc desc;
u8 port_id = 0; u8 port_id = 0;
int ret; int ret;
...@@ -521,12 +519,11 @@ static int hclge_dbg_dump_dcb_port(struct hclge_dev *hdev, char *buf, int len, ...@@ -521,12 +519,11 @@ static int hclge_dbg_dump_dcb_port(struct hclge_dev *hdev, char *buf, int len,
if (ret) if (ret)
return ret; return ret;
bitmap = (struct hclge_dbg_bitmap_cmd *)&desc.data[1]; req.bitmap = (u8)le32_to_cpu(desc.data[1]);
*pos += scnprintf(buf + *pos, len - *pos, "port_mask: %#x\n", *pos += scnprintf(buf + *pos, len - *pos, "port_mask: %#x\n", req.bit0);
bitmap->bit0);
*pos += scnprintf(buf + *pos, len - *pos, "port_shaping_pass: %#x\n", *pos += scnprintf(buf + *pos, len - *pos, "port_shaping_pass: %#x\n",
bitmap->bit1); req.bit1);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册