RDMA/irdma: Store PBL info address a pointer type
authorShiraz Saleem <shiraz.saleem@intel.com>
Wed, 9 Jun 2021 23:49:24 +0000 (18:49 -0500)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 10 Jun 2021 12:39:27 +0000 (09:39 -0300)
commit2db7b2eac7ad55105fe037b3f8f57d8ecac8c3fb
tree6fd50ad9ad1e768e49f08b56fcc9a36d549cfc8e
parentbf0480a2df7597b43a8383191e14580243ecc1f9
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>
drivers/infiniband/hw/irdma/hw.c
drivers/infiniband/hw/irdma/pble.c
drivers/infiniband/hw/irdma/pble.h
drivers/infiniband/hw/irdma/utils.c
drivers/infiniband/hw/irdma/verbs.c