提交 350266f6 编写于 作者: H Hu Chunzhi 提交者: Xie XiuQi

RDMA/hns: Fix device initialization bugs

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

This patch changes some code format and fix device initialization bugs.
Reviewed-by: NHuang Dongdong <hdd.huang@huawei.com>
Signed-off-by: NHu Chunzhi <huchunzhi@huawei.com>
Acked-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 af324d95
...@@ -365,8 +365,8 @@ static int rdfx_v2_ceqc_store(const char *p_buf, struct rdfx_info *rdfx) ...@@ -365,8 +365,8 @@ static int rdfx_v2_ceqc_store(const char *p_buf, struct rdfx_info *rdfx)
return PTR_ERR(mailbox); return PTR_ERR(mailbox);
eq_context = kzalloc(sizeof(*eq_context), GFP_KERNEL); eq_context = kzalloc(sizeof(*eq_context), GFP_KERNEL);
if (!eq_context) { if (ZERO_OR_NULL_PTR(eq_context)) {
//pr_info("alloc mailbox mem for ceqc failed\n"); pr_info("alloc mailbox mem for ceqc failed\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err_context; goto err_context;
} }
...@@ -383,8 +383,7 @@ static int rdfx_v2_ceqc_store(const char *p_buf, struct rdfx_info *rdfx) ...@@ -383,8 +383,7 @@ static int rdfx_v2_ceqc_store(const char *p_buf, struct rdfx_info *rdfx)
pr_info("************** CEQC INFO ***************\n"); pr_info("************** CEQC INFO ***************\n");
eqc = (int *)eq_context; eqc = (int *)eq_context;
for (i = 0; i < (sizeof(*eq_context) >> 2); i += 8) { for (i = 0; i < (sizeof(*eq_context) >> 2); i += 8) {
pr_info( pr_info("CEQC(0x%x): %08x %08x %08x %08x %08x %08x %08x %08x\n",
"CEQC(0x%x): %08x %08x %08x %08x %08x %08x %08x %08x\n",
ceqn, *eqc, *(eqc + 1), *(eqc + 2), ceqn, *eqc, *(eqc + 1), *(eqc + 2),
*(eqc + 3), *(eqc + 4), *(eqc + 5), *(eqc + 3), *(eqc + 4), *(eqc + 5),
*(eqc + 6), *(eqc + 7)); *(eqc + 6), *(eqc + 7));
...@@ -427,8 +426,8 @@ static int rdfx_v2_aeqc_store(const char *p_buf, struct rdfx_info *rdfx) ...@@ -427,8 +426,8 @@ static int rdfx_v2_aeqc_store(const char *p_buf, struct rdfx_info *rdfx)
return PTR_ERR(mailbox); return PTR_ERR(mailbox);
eq_context = kzalloc(sizeof(*eq_context), GFP_KERNEL); eq_context = kzalloc(sizeof(*eq_context), GFP_KERNEL);
if (!eq_context) { if (ZERO_OR_NULL_PTR(eq_context)) {
//pr_info("alloc mailbox mem for ceqc failed\n"); pr_info("alloc mailbox mem for aeqc failed\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err_context; goto err_context;
} }
...@@ -445,8 +444,7 @@ static int rdfx_v2_aeqc_store(const char *p_buf, struct rdfx_info *rdfx) ...@@ -445,8 +444,7 @@ static int rdfx_v2_aeqc_store(const char *p_buf, struct rdfx_info *rdfx)
pr_info("************** AEQC INFO ***************\n"); pr_info("************** AEQC INFO ***************\n");
eqc = (int *)eq_context; eqc = (int *)eq_context;
for (i = 0; i < (sizeof(*eq_context) >> 2); i += 8) { for (i = 0; i < (sizeof(*eq_context) >> 2); i += 8) {
pr_info( pr_info("AEQC(0x%x): %08x %08x %08x %08x %08x %08x %08x %08x\n",
"AEQC(0x%x): %08x %08x %08x %08x %08x %08x %08x %08x\n",
aeqn, *eqc, *(eqc + 1), *(eqc + 2), aeqn, *eqc, *(eqc + 1), *(eqc + 2),
*(eqc + 3), *(eqc + 4), *(eqc + 5), *(eqc + 3), *(eqc + 4), *(eqc + 5),
*(eqc + 6), *(eqc + 7)); *(eqc + 6), *(eqc + 7));
...@@ -511,8 +509,8 @@ static int rdfx_v2_qpc_store(const char *p_buf, struct rdfx_info *rdfx) ...@@ -511,8 +509,8 @@ static int rdfx_v2_qpc_store(const char *p_buf, struct rdfx_info *rdfx)
} }
qp_context = kzalloc(sizeof(*qp_context), GFP_KERNEL); qp_context = kzalloc(sizeof(*qp_context), GFP_KERNEL);
if (!qp_context) { if (ZERO_OR_NULL_PTR(qp_context)) {
//pr_info("alloc mailbox mem for qpc failed\n"); pr_info("alloc mailbox mem for qpc failed\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err_cmd; goto err_cmd;
} }
...@@ -532,8 +530,7 @@ static int rdfx_v2_qpc_store(const char *p_buf, struct rdfx_info *rdfx) ...@@ -532,8 +530,7 @@ static int rdfx_v2_qpc_store(const char *p_buf, struct rdfx_info *rdfx)
pr_info("QPC(0x%x) BT1: 0x%llx\n", qpn, bt1_ba); pr_info("QPC(0x%x) BT1: 0x%llx\n", qpn, bt1_ba);
qpc = (int *)qp_context; qpc = (int *)qp_context;
for (i = 0; i < (sizeof(*qp_context) >> 2); i += 8) { for (i = 0; i < (sizeof(*qp_context) >> 2); i += 8) {
pr_info( pr_info("QPC(0x%x): %08x %08x %08x %08x %08x %08x %08x %08x\n",
"QPC(0x%x): %08x %08x %08x %08x %08x %08x %08x %08x\n",
qpn, *qpc, *(qpc + 1), *(qpc + 2), qpn, *qpc, *(qpc + 1), *(qpc + 2),
*(qpc + 3), *(qpc + 4), *(qpc + 5), *(qpc + 3), *(qpc + 4), *(qpc + 5),
*(qpc + 6), *(qpc + 7)); *(qpc + 6), *(qpc + 7));
...@@ -598,8 +595,8 @@ static int rdfx_v2_cqc_store(const char *p_buf, struct rdfx_info *rdfx) ...@@ -598,8 +595,8 @@ static int rdfx_v2_cqc_store(const char *p_buf, struct rdfx_info *rdfx)
} }
cq_context = kzalloc(sizeof(*cq_context), GFP_KERNEL); cq_context = kzalloc(sizeof(*cq_context), GFP_KERNEL);
if (!cq_context) { if (ZERO_OR_NULL_PTR(cq_context)) {
//pr_info("alloc mailbox mem for cqc failed\n"); pr_info("alloc mailbox mem for cqc failed\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err_cmd; goto err_cmd;
} }
...@@ -619,8 +616,7 @@ static int rdfx_v2_cqc_store(const char *p_buf, struct rdfx_info *rdfx) ...@@ -619,8 +616,7 @@ static int rdfx_v2_cqc_store(const char *p_buf, struct rdfx_info *rdfx)
pr_info("CQC(0x%x) BT1: 0x%llx\n", cqn, bt1_ba); pr_info("CQC(0x%x) BT1: 0x%llx\n", cqn, bt1_ba);
cqc = (int *)cq_context; cqc = (int *)cq_context;
for (i = 0; i < (sizeof(*cq_context) >> 2); i += 8) { for (i = 0; i < (sizeof(*cq_context) >> 2); i += 8) {
pr_info( pr_info("CQC(0x%x): %08x %08x %08x %08x %08x %08x %08x %08x\n",
"CQC(0x%x): %08x %08x %08x %08x %08x %08x %08x %08x\n",
cqn, *cqc, *(cqc + 1), *(cqc + 2), cqn, *cqc, *(cqc + 1), *(cqc + 2),
*(cqc + 3), *(cqc + 4), *(cqc + 5), *(cqc + 3), *(cqc + 4), *(cqc + 5),
*(cqc + 6), *(cqc + 7)); *(cqc + 6), *(cqc + 7));
...@@ -685,8 +681,8 @@ static int rdfx_v2_srqc_store(const char *p_buf, struct rdfx_info *rdfx) ...@@ -685,8 +681,8 @@ static int rdfx_v2_srqc_store(const char *p_buf, struct rdfx_info *rdfx)
} }
srq_context = kzalloc(sizeof(*srq_context), GFP_KERNEL); srq_context = kzalloc(sizeof(*srq_context), GFP_KERNEL);
if (!srq_context) { if (ZERO_OR_NULL_PTR(srq_context)) {
//pr_info("alloc mailbox mem for srqc failed\n"); pr_info("alloc mailbox mem for srqc failed\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err_cmd; goto err_cmd;
} }
...@@ -706,8 +702,7 @@ static int rdfx_v2_srqc_store(const char *p_buf, struct rdfx_info *rdfx) ...@@ -706,8 +702,7 @@ static int rdfx_v2_srqc_store(const char *p_buf, struct rdfx_info *rdfx)
pr_info("SRQC(0x%x) BT1: 0x%llx\n", srqn, bt1_ba); pr_info("SRQC(0x%x) BT1: 0x%llx\n", srqn, bt1_ba);
srqc = (int *)srq_context; srqc = (int *)srq_context;
for (i = 0; i < (sizeof(*srq_context) >> 2); i += 8) { for (i = 0; i < (sizeof(*srq_context) >> 2); i += 8) {
pr_info( pr_info("SRQC(0x%x): %08x %08x %08x %08x %08x %08x %08x %08x\n",
"SRQC(0x%x): %08x %08x %08x %08x %08x %08x %08x %08x\n",
srqn, *srqc, *(srqc + 1), *(srqc + 2), srqn, *srqc, *(srqc + 1), *(srqc + 2),
*(srqc + 3), *(srqc + 4), *(srqc + 5), *(srqc + 3), *(srqc + 4), *(srqc + 5),
*(srqc + 6), *(srqc + 7)); *(srqc + 6), *(srqc + 7));
...@@ -772,8 +767,8 @@ static int rdfx_v2_mpt_store(const char *p_buf, struct rdfx_info *rdfx) ...@@ -772,8 +767,8 @@ static int rdfx_v2_mpt_store(const char *p_buf, struct rdfx_info *rdfx)
} }
mpt_ctx = kzalloc(sizeof(*mpt_ctx), GFP_KERNEL); mpt_ctx = kzalloc(sizeof(*mpt_ctx), GFP_KERNEL);
if (!mpt_ctx) { if (ZERO_OR_NULL_PTR(mpt_ctx)) {
//pr_info("alloc mailbox mem for cqc failed\n"); pr_info("alloc mailbox mem for mpt failed\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err_cmd; goto err_cmd;
} }
...@@ -793,8 +788,7 @@ static int rdfx_v2_mpt_store(const char *p_buf, struct rdfx_info *rdfx) ...@@ -793,8 +788,7 @@ static int rdfx_v2_mpt_store(const char *p_buf, struct rdfx_info *rdfx)
pr_info("MPT(0x%x) BT1: 0x%llx\n", key, bt1_ba); pr_info("MPT(0x%x) BT1: 0x%llx\n", key, bt1_ba);
mpt = (int *)mpt_ctx; mpt = (int *)mpt_ctx;
for (i = 0; i < (sizeof(*mpt_ctx) >> 2); i += 8) { for (i = 0; i < (sizeof(*mpt_ctx) >> 2); i += 8) {
pr_info( pr_info("MPT(0x%x): %08x %08x %08x %08x %08x %08x %08x %08x\n",
"MPT(0x%x): %08x %08x %08x %08x %08x %08x %08x %08x\n",
key, *mpt, *(mpt + 1), *(mpt + 2), key, *mpt, *(mpt + 1), *(mpt + 2),
*(mpt + 3), *(mpt + 4), *(mpt + 5), *(mpt + 3), *(mpt + 4), *(mpt + 5),
*(mpt + 6), *(mpt + 7)); *(mpt + 6), *(mpt + 7));
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
unsigned int hr_fc_print; unsigned int hr_fc_print;
module_param(hr_fc_print, uint, 0644); module_param(hr_fc_print, uint, 0644);
MODULE_PARM_DESC(hr_fc_print, "enable func call prin"); MODULE_PARM_DESC(hr_fc_print, "enable function call print");
static struct rdfx_qp_info *rdfx_find_rdfx_qp(struct rdfx_info *rdfx, static struct rdfx_qp_info *rdfx_find_rdfx_qp(struct rdfx_info *rdfx,
unsigned long qpn); unsigned long qpn);
...@@ -85,7 +85,7 @@ void alloc_rdfx_info(struct hns_roce_dev *hr_dev) ...@@ -85,7 +85,7 @@ void alloc_rdfx_info(struct hns_roce_dev *hr_dev)
struct rdfx_info *rdfx; struct rdfx_info *rdfx;
rdfx = kzalloc(sizeof(*rdfx), GFP_KERNEL); rdfx = kzalloc(sizeof(*rdfx), GFP_KERNEL);
if (!rdfx) if (ZERO_OR_NULL_PTR(rdfx))
return; return;
hr_dev->dfx_priv = rdfx; hr_dev->dfx_priv = rdfx;
...@@ -621,7 +621,7 @@ void rdfx_alloc_rdfx_ceq(struct hns_roce_dev *hr_dev, unsigned long ceqn, ...@@ -621,7 +621,7 @@ void rdfx_alloc_rdfx_ceq(struct hns_roce_dev *hr_dev, unsigned long ceqn,
if (eq_cmd == HNS_ROCE_CMD_CREATE_CEQC) { if (eq_cmd == HNS_ROCE_CMD_CREATE_CEQC) {
rdfx_ceq = kzalloc(sizeof(struct rdfx_ceq_info), GFP_KERNEL); rdfx_ceq = kzalloc(sizeof(struct rdfx_ceq_info), GFP_KERNEL);
if (!rdfx_ceq) if (ZERO_OR_NULL_PTR(rdfx_ceq))
return; return;
rdfx_ceq->ceqn = ceqn; rdfx_ceq->ceqn = ceqn;
...@@ -647,7 +647,7 @@ void rdfx_alloc_cq_buf(struct hns_roce_dev *hr_dev, struct hns_roce_cq *hr_cq) ...@@ -647,7 +647,7 @@ void rdfx_alloc_cq_buf(struct hns_roce_dev *hr_dev, struct hns_roce_cq *hr_cq)
cq_entries = hr_cq->cq_depth; cq_entries = hr_cq->cq_depth;
dfx_cq_buf = kzalloc(sizeof(struct hns_roce_buf), GFP_KERNEL); dfx_cq_buf = kzalloc(sizeof(struct hns_roce_buf), GFP_KERNEL);
if (!dfx_cq_buf) if (ZERO_OR_NULL_PTR(dfx_cq_buf))
return; return;
page_shift = PAGE_SHIFT + hr_dev->caps.cqe_buf_pg_sz; page_shift = PAGE_SHIFT + hr_dev->caps.cqe_buf_pg_sz;
...@@ -664,7 +664,7 @@ void rdfx_alloc_cq_buf(struct hns_roce_dev *hr_dev, struct hns_roce_cq *hr_cq) ...@@ -664,7 +664,7 @@ void rdfx_alloc_cq_buf(struct hns_roce_dev *hr_dev, struct hns_roce_cq *hr_cq)
#endif #endif
rdfx_cq = kzalloc(sizeof(*rdfx_cq), GFP_KERNEL); rdfx_cq = kzalloc(sizeof(*rdfx_cq), GFP_KERNEL);
if (!rdfx_cq) if (ZERO_OR_NULL_PTR(rdfx_cq))
goto err_buf; goto err_buf;
rdfx_cq->buf = dfx_cq_buf; rdfx_cq->buf = dfx_cq_buf;
...@@ -707,7 +707,7 @@ void rdfx_alloc_qp_buf(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp) ...@@ -707,7 +707,7 @@ void rdfx_alloc_qp_buf(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp)
unsigned long flags; unsigned long flags;
dfx_qp_buf = kzalloc(sizeof(struct hns_roce_buf), GFP_KERNEL); dfx_qp_buf = kzalloc(sizeof(struct hns_roce_buf), GFP_KERNEL);
if (!dfx_qp_buf) if (ZERO_OR_NULL_PTR(dfx_qp_buf))
return; return;
page_shift = PAGE_SHIFT + hr_dev->caps.mtt_buf_pg_sz; page_shift = PAGE_SHIFT + hr_dev->caps.mtt_buf_pg_sz;
...@@ -721,7 +721,7 @@ void rdfx_alloc_qp_buf(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp) ...@@ -721,7 +721,7 @@ void rdfx_alloc_qp_buf(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp)
} }
rdfx_qp = kzalloc(sizeof(*rdfx_qp), GFP_KERNEL); rdfx_qp = kzalloc(sizeof(*rdfx_qp), GFP_KERNEL);
if (!rdfx_qp) { if (ZERO_OR_NULL_PTR(rdfx_qp)) {
hns_roce_buf_free(hr_dev, hr_qp->buff_size, dfx_qp_buf); hns_roce_buf_free(hr_dev, hr_qp->buff_size, dfx_qp_buf);
kfree(dfx_qp_buf); kfree(dfx_qp_buf);
return; return;
...@@ -788,7 +788,7 @@ void rdfx_alloc_rdfx_mr(struct hns_roce_dev *hr_dev, struct hns_roce_mr *mr) ...@@ -788,7 +788,7 @@ void rdfx_alloc_rdfx_mr(struct hns_roce_dev *hr_dev, struct hns_roce_mr *mr)
unsigned long flags; unsigned long flags;
rdfx_mr = kzalloc(sizeof(*rdfx_mr), GFP_KERNEL); rdfx_mr = kzalloc(sizeof(*rdfx_mr), GFP_KERNEL);
if (!rdfx_mr) if (ZERO_OR_NULL_PTR(rdfx_mr))
return; return;
rdfx_mr->pd = mr->pd; rdfx_mr->pd = mr->pd;
...@@ -853,7 +853,7 @@ void rdfx_alloc_rdfx_pd(struct hns_roce_dev *hr_dev, struct hns_roce_pd *pd) ...@@ -853,7 +853,7 @@ void rdfx_alloc_rdfx_pd(struct hns_roce_dev *hr_dev, struct hns_roce_pd *pd)
unsigned long flags; unsigned long flags;
rdfx_pd = kzalloc(sizeof(struct rdfx_pd_info), GFP_KERNEL); rdfx_pd = kzalloc(sizeof(struct rdfx_pd_info), GFP_KERNEL);
if (!rdfx_pd) if (ZERO_OR_NULL_PTR(rdfx_pd))
return; return;
rdfx_pd->pdn = pd->pdn; rdfx_pd->pdn = pd->pdn;
...@@ -971,7 +971,7 @@ void rdfx_cp_sq_wqe_buf(struct hns_roce_dev *hr_dev, struct hns_roce_qp *qp, ...@@ -971,7 +971,7 @@ void rdfx_cp_sq_wqe_buf(struct hns_roce_dev *hr_dev, struct hns_roce_qp *qp,
memcpy(dfx_qp_buf, dfx_hns_wqe_sge, (wr->num_sge - 2) * memcpy(dfx_qp_buf, dfx_hns_wqe_sge, (wr->num_sge - 2) *
sizeof(struct hns_roce_v2_wqe_data_seg)); sizeof(struct hns_roce_v2_wqe_data_seg));
if (wr->opcode <= IB_WR_MASKED_ATOMIC_FETCH_AND_ADD) if (wr->opcode <= IB_WR_REG_SIG_MR)
atomic_inc(&(sq->sq_wqe_cnt[wr->opcode])); atomic_inc(&(sq->sq_wqe_cnt[wr->opcode]));
else else
dev_err(hr_dev->dev, "Error opcode - %d while post send.\n", dev_err(hr_dev->dev, "Error opcode - %d while post send.\n",
......
...@@ -36,7 +36,6 @@ const struct file_operations chr_ops = { ...@@ -36,7 +36,6 @@ const struct file_operations chr_ops = {
static const struct rdfx_dev_id rdfx_dev_tbl[] = { static const struct rdfx_dev_id rdfx_dev_tbl[] = {
{.name = "hisi_", .ops = NULL}, {.name = "hisi_", .ops = NULL},
{.name = "hns", .ops = &rdfx_ops_hw_v2}, {.name = "hns", .ops = &rdfx_ops_hw_v2},
{},
}; };
/* /*
...@@ -55,7 +54,7 @@ int parg_getopt(char *input, char *optstring, char *parg) ...@@ -55,7 +54,7 @@ int parg_getopt(char *input, char *optstring, char *parg)
if (input == NULL || optstring == NULL) if (input == NULL || optstring == NULL)
return -EINVAL; return -EINVAL;
_input = kmalloc(strlen(input) + 1, GFP_KERNEL); _input = kmalloc(strlen(input) + 1, GFP_KERNEL);
if (!_input) if (ZERO_OR_NULL_PTR(_input))
return -ENOMEM; return -ENOMEM;
strcpy(_input, input); strcpy(_input, input);
_optstring[0] = '-'; _optstring[0] = '-';
...@@ -129,7 +128,7 @@ int str_to_ll(char *p_buf, unsigned long long *pll_val, unsigned int *num) ...@@ -129,7 +128,7 @@ int str_to_ll(char *p_buf, unsigned long long *pll_val, unsigned int *num)
arr = kzalloc(sizeof(unsigned long long) * arr = kzalloc(sizeof(unsigned long long) *
SYSFS_MAX_PARA, GFP_KERNEL); SYSFS_MAX_PARA, GFP_KERNEL);
if (!arr) if (ZERO_OR_NULL_PTR(arr))
return -ENOMEM; return -ENOMEM;
p = strtok(p_buf, delim); p = strtok(p_buf, delim);
...@@ -231,10 +230,9 @@ static int rdfx_info_init(struct ib_device *ib_dev, int i) ...@@ -231,10 +230,9 @@ static int rdfx_info_init(struct ib_device *ib_dev, int i)
for (j = 0; j < sizeof(rdfx_dev_tbl)/sizeof(struct rdfx_dev_id); j++) { for (j = 0; j < sizeof(rdfx_dev_tbl)/sizeof(struct rdfx_dev_id); j++) {
if (!memcmp(rdfx_dev_tbl[j].name, ib_dev->name, if (!memcmp(rdfx_dev_tbl[j].name, ib_dev->name,
strlen(rdfx_dev_tbl[j].name))) { strlen(rdfx_dev_tbl[j].name)) && rdfx_dev_tbl[j].ops) {
if (rdfx_dev_tbl[j].ops) rdfx_top_info_list[i].rdfx =
rdfx_top_info_list[i].rdfx = rdfx_dev_tbl[j].ops->get_dfx(ib_dev);
rdfx_dev_tbl[j].ops->get_dfx(ib_dev);
(rdfx_top_info_list[i].rdfx)->ops = rdfx_dev_tbl[j].ops; (rdfx_top_info_list[i].rdfx)->ops = rdfx_dev_tbl[j].ops;
(rdfx_top_info_list[i].rdfx)->drv_dev = drv_device; (rdfx_top_info_list[i].rdfx)->drv_dev = drv_device;
...@@ -269,11 +267,12 @@ static void rdfx_add_device(struct ib_device *ib_dev) ...@@ -269,11 +267,12 @@ static void rdfx_add_device(struct ib_device *ib_dev)
} }
rdfx_top_info_list[i].dev = ib_dev; rdfx_top_info_list[i].dev = ib_dev;
pr_info("rdfx add ib device(%p), idx - %d, name - %s\n", pr_info("rdfx add ib device(%pK), idx - %d, name - %s\n",
ib_dev, i, ib_dev->name); ib_dev, i, ib_dev->name);
ret = rdfx_info_init(ib_dev, i); ret = rdfx_info_init(ib_dev, i);
if (ret) { if (ret) {
pr_err("rdfx info init failed\n"); pr_err("rdfx info init failed\n");
rdfx_top_info_list[i].dev = NULL;
return; return;
} }
...@@ -291,7 +290,7 @@ static void rdfx_remove_device(struct ib_device *ib_dev, void *client_data) ...@@ -291,7 +290,7 @@ static void rdfx_remove_device(struct ib_device *ib_dev, void *client_data)
for (i = 0; i < MAX_IB_DEV; i++) { for (i = 0; i < MAX_IB_DEV; i++) {
if (rdfx_top_info_list[i].dev && if (rdfx_top_info_list[i].dev &&
(rdfx_top_info_list[i].dev == ib_dev)) { (rdfx_top_info_list[i].dev == ib_dev)) {
pr_info("rdfx rm ib device(%p), idx - %d, name - %s\n", pr_info("rdfx rm ib device(%pK), idx - %d, name - %s\n",
ib_dev, i, ib_dev->name); ib_dev, i, ib_dev->name);
ops = (rdfx_top_info_list[i].rdfx)->ops; ops = (rdfx_top_info_list[i].rdfx)->ops;
ops->del_sysfs(rdfx_top_info_list[i].rdfx); ops->del_sysfs(rdfx_top_info_list[i].rdfx);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册