On Fri, Mar 12, 2021 at 05:48:26PM +0800, Weihang Li wrote:
+static int hns_roce_query_func_info(struct hns_roce_dev *hr_dev) +{
- struct hns_roce_pf_func_info *resp;
- struct hns_roce_cmq_desc desc;
- int ret;
- if (hr_dev->pci_dev->revision < PCI_REVISION_ID_HIP09)
return 0;
- hns_roce_cmq_setup_basic_desc(&desc, HNS_ROCE_OPC_QUERY_FUNC_INFO,
true);
- ret = hns_roce_cmq_send(hr_dev, &desc, 1);
- if (ret)
return ret;
- resp = (struct hns_roce_pf_func_info *)desc.data;
WTF is this cast?
struct hns_roce_cmq_desc { __le16 opcode; __le16 flag; __le16 retval; __le16 rsv; __le32 data[6]; };
Casting __le32 to a pointer is wrong
Jason