Avoid the sparse warning "warning: cast removes address space '__iomem' of expression" by using a local unsigned long variable to store an iomem address. Signed-off-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx> --- drivers/scsi/pm8001/pm8001_sas.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c index 32edda3e55c6..6805c7f43e41 100644 --- a/drivers/scsi/pm8001/pm8001_sas.c +++ b/drivers/scsi/pm8001/pm8001_sas.c @@ -234,9 +234,10 @@ int pm8001_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func, } { struct sas_phy *phy = sas_phy->phy; - uint32_t *qp = (uint32_t *)(((char *) - pm8001_ha->io_mem[2].memvirtaddr) - + 0x1034 + (0x4000 * (phy_id & 3))); + unsigned long vaddr = (unsigned long) + pm8001_ha->io_mem[2].memvirtaddr; + uint32_t *qp = (uint32_t *) + (vaddr + 0x1034 + (0x4000 * (phy_id & 3))); phy->invalid_dword_count = qp[0]; phy->running_disparity_error_count = qp[1]; -- 2.34.1