qed*: Change dpi_addr to be denoted with __iomem
authorMichal Kalderon <michal.kalderon@marvell.com>
Tue, 9 Jul 2019 14:17:33 +0000 (17:17 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 25 Jul 2019 18:03:26 +0000 (15:03 -0300)
Several casts were required around dpi_addr parameter in qed_rdma_if.h
This is an address on the doorbell bar and should therefore be marked with
__iomem.

Link: https://lore.kernel.org/r/20190709141735.19193-5-michal.kalderon@marvell.com
Reported-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Ariel Elior <ariel.elior@marvell.com>
Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/qedr/main.c
drivers/infiniband/hw/qedr/qedr.h
drivers/net/ethernet/qlogic/qed/qed_rdma.c
include/linux/qed/qed_rdma_if.h

index 533157a..ca5f6f6 100644 (file)
@@ -820,7 +820,7 @@ static int qedr_init_hw(struct qedr_dev *dev)
        if (rc)
                goto out;
 
-       dev->db_addr = (void __iomem *)(uintptr_t)out_params.dpi_addr;
+       dev->db_addr = out_params.dpi_addr;
        dev->db_phys_addr = out_params.dpi_phys_addr;
        dev->db_size = out_params.dpi_size;
        dev->dpi = out_params.dpi;
index a92ca22..0cfd849 100644 (file)
@@ -229,7 +229,7 @@ struct qedr_ucontext {
        struct ib_ucontext ibucontext;
        struct qedr_dev *dev;
        struct qedr_pd *pd;
-       u64 dpi_addr;
+       void __iomem *dpi_addr;
        u64 dpi_phys_addr;
        u32 dpi_size;
        u16 dpi;
index f900fde..95eba27 100644 (file)
@@ -799,9 +799,8 @@ static int qed_rdma_add_user(void *rdma_cxt,
        /* Calculate the corresponding DPI address */
        dpi_start_offset = p_hwfn->dpi_start_offset;
 
-       out_params->dpi_addr = (u64)((u8 __iomem *)p_hwfn->doorbells +
-                                    dpi_start_offset +
-                                    ((out_params->dpi) * p_hwfn->dpi_size));
+       out_params->dpi_addr = p_hwfn->doorbells + dpi_start_offset +
+                              out_params->dpi * p_hwfn->dpi_size;
 
        out_params->dpi_phys_addr = p_hwfn->db_phys_addr +
                                    dpi_start_offset +
index 898f595..74efca1 100644 (file)
@@ -225,7 +225,7 @@ struct qed_rdma_start_in_params {
 
 struct qed_rdma_add_user_out_params {
        u16 dpi;
-       u64 dpi_addr;
+       void __iomem *dpi_addr;
        u64 dpi_phys_addr;
        u32 dpi_size;
        u16 wid_count;