diff options
author | Shiraz Saleem <shiraz.saleem@intel.com> | 2021-06-10 02:49:24 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-06-10 15:39:27 +0300 |
commit | 2db7b2eac7ad55105fe037b3f8f57d8ecac8c3fb (patch) | |
tree | 6fd50ad9ad1e768e49f08b56fcc9a36d549cfc8e /drivers/infiniband/hw/irdma/pble.h | |
parent | bf0480a2df7597b43a8383191e14580243ecc1f9 (diff) | |
download | linux-2db7b2eac7ad55105fe037b3f8f57d8ecac8c3fb.tar.xz |
RDMA/irdma: Store PBL info address a pointer type
The level1 PBL info address is stored as u64. This requires casting
through a uinptr_t before used as a pointer type.
And this leads to sparse warning such as this when uinptr_t is missing:
drivers/infiniband/hw/irdma/hw.c: In function 'irdma_destroy_virt_aeq':
drivers/infiniband/hw/irdma/hw.c:579:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
579 | dma_addr_t *pg_arr = (dma_addr_t *)aeq->palloc.level1.addr;
This can be fixed using an intermediate uintptr_t, but rather it is better
to fix the structure irdm_pble_info to store the address as u64* and the
VA it is assigned in irdma_chunk as a void*. This greatly reduces the
casting on this address.
Fixes: 44d9e52977a1 ("RDMA/irdma: Implement device initialization definitions")
Link: https://lore.kernel.org/r/20210609234924.938-1-shiraz.saleem@intel.com
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/irdma/pble.h')
-rw-r--r-- | drivers/infiniband/hw/irdma/pble.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/irdma/pble.h b/drivers/infiniband/hw/irdma/pble.h index e4da6f53e6c2..e4e635dc4fd9 100644 --- a/drivers/infiniband/hw/irdma/pble.h +++ b/drivers/infiniband/hw/irdma/pble.h @@ -30,7 +30,7 @@ struct irdma_pble_chunkinfo { }; struct irdma_pble_info { - u64 addr; + u64 *addr; u32 idx; u32 cnt; struct irdma_pble_chunkinfo chunkinfo; @@ -73,7 +73,7 @@ struct irdma_chunk { u32 sizeofbitmap; u64 size; - u64 vaddr; + void *vaddr; u64 fpm_addr; u32 pg_cnt; enum irdma_alloc_type type; @@ -122,7 +122,7 @@ enum irdma_status_code irdma_prm_add_pble_mem(struct irdma_pble_prm *pprm, enum irdma_status_code irdma_prm_get_pbles(struct irdma_pble_prm *pprm, struct irdma_pble_chunkinfo *chunkinfo, u32 mem_size, - u64 *vaddr, u64 *fpm_addr); + u64 **vaddr, u64 *fpm_addr); void irdma_prm_return_pbles(struct irdma_pble_prm *pprm, struct irdma_pble_chunkinfo *chunkinfo); void irdma_pble_acquire_lock(struct irdma_hmc_pble_rsrc *pble_rsrc, |