RDMA/ocrdma: Fix compiler warning about int/pointer size mismatch

Fix:

   drivers/infiniband/hw/ocrdma/ocrdma_verbs.c: In function 'ocrdma_build_fr':
>> drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:1832:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     mr = (struct ocrdma_mr *)qp->dev->stag_arr[(hdr->lkey >> 8) &
          ^
   drivers/infiniband/hw/ocrdma/ocrdma_verbs.c: In function 'ocrdma_alloc_frmr':
>> drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2661:64: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     dev->stag_arr[(mr->hwmr.lkey >> 8) & (OCRDMA_MAX_STAG - 1)] = (u64) mr;

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
This commit is contained in:
Roland Dreier 2013-09-03 09:00:08 -07:00
parent d7e19c0ad9
commit 33ccbd858f
1 changed files with 2 additions and 2 deletions

View File

@ -2010,7 +2010,7 @@ static int ocrdma_build_fr(struct ocrdma_qp *qp, struct ocrdma_hdr_wqe *hdr,
fast_reg->num_sges = wr->wr.fast_reg.page_list_len; fast_reg->num_sges = wr->wr.fast_reg.page_list_len;
fast_reg->size_sge = fast_reg->size_sge =
get_encoded_page_size(1 << wr->wr.fast_reg.page_shift); get_encoded_page_size(1 << wr->wr.fast_reg.page_shift);
mr = (struct ocrdma_mr *)qp->dev->stag_arr[(hdr->lkey >> 8) & mr = (struct ocrdma_mr *) (unsigned long) qp->dev->stag_arr[(hdr->lkey >> 8) &
(OCRDMA_MAX_STAG - 1)]; (OCRDMA_MAX_STAG - 1)];
build_frmr_pbes(wr, mr->hwmr.pbl_table, &mr->hwmr); build_frmr_pbes(wr, mr->hwmr.pbl_table, &mr->hwmr);
return 0; return 0;
@ -2839,7 +2839,7 @@ struct ib_mr *ocrdma_alloc_frmr(struct ib_pd *ibpd, int max_page_list_len)
goto mbx_err; goto mbx_err;
mr->ibmr.rkey = mr->hwmr.lkey; mr->ibmr.rkey = mr->hwmr.lkey;
mr->ibmr.lkey = mr->hwmr.lkey; mr->ibmr.lkey = mr->hwmr.lkey;
dev->stag_arr[(mr->hwmr.lkey >> 8) & (OCRDMA_MAX_STAG - 1)] = (u64) mr; dev->stag_arr[(mr->hwmr.lkey >> 8) & (OCRDMA_MAX_STAG - 1)] = (unsigned long) mr;
return &mr->ibmr; return &mr->ibmr;
mbx_err: mbx_err:
ocrdma_free_mr_pbl_tbl(dev, &mr->hwmr); ocrdma_free_mr_pbl_tbl(dev, &mr->hwmr);