summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>2022-02-20 06:17:41 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2022-02-23 05:31:16 +0300
commitd2ed913b9a42e8f9072e4ef836727ff50eb8b8cc (patch)
tree9ba2833de498fcd276016185142bed645dd59d32
parent8454563e4c2aafbfb81a383ab423ea8b9b430a25 (diff)
downloadlinux-d2ed913b9a42e8f9072e4ef836727ff50eb8b8cc.tar.xz
scsi: pm8001: Fix __iomem pointer use in pm8001_phy_control()
Avoid the sparse warning "warning: cast removes address space '__iomem' of expression" by declaring the qp pointer as "u32 __iomem *". Accordingly, change the accesses to the qp array to use readl(). Link: https://lore.kernel.org/r/20220220031810.738362-3-damien.lemoal@opensource.wdc.com Reviewed-by: Jack Wang <jinpu.wang@ionos.com> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/pm8001/pm8001_sas.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index 828d719afa1b..f5678be4c17b 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -234,14 +234,13 @@ 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)));
-
- phy->invalid_dword_count = qp[0];
- phy->running_disparity_error_count = qp[1];
- phy->loss_of_dword_sync_count = qp[3];
- phy->phy_reset_problem_count = qp[4];
+ u32 __iomem *qp = pm8001_ha->io_mem[2].memvirtaddr
+ + 0x1034 + (0x4000 * (phy_id & 3));
+
+ phy->invalid_dword_count = readl(qp);
+ phy->running_disparity_error_count = readl(&qp[1]);
+ phy->loss_of_dword_sync_count = readl(&qp[3]);
+ phy->phy_reset_problem_count = readl(&qp[4]);
}
if (pm8001_ha->chip_id == chip_8001)
pm8001_bar4_shift(pm8001_ha, 0);