[PATCH] soc: qcom: smsm: fix __iomem annotations
From: Ben Dooks
Date: Tue Jun 23 2026 - 05:15:32 EST
There are a number of points in the driver which miss out
on __iomem annotations, so add these to remove the following
sparse warnings:
drivers/soc/qcom/smsm.c:159:32: warning: incorrect type in argument 1 (different address spaces)
drivers/soc/qcom/smsm.c:159:32: expected void const volatile [noderef] __iomem *addr
drivers/soc/qcom/smsm.c:159:32: got unsigned int [usertype] *local_state
drivers/soc/qcom/smsm.c:171:25: warning: incorrect type in argument 2 (different address spaces)
drivers/soc/qcom/smsm.c:171:25: expected void volatile [noderef] __iomem *addr
drivers/soc/qcom/smsm.c:171:25: got unsigned int [usertype] *local_state
drivers/soc/qcom/smsm.c:181:48: warning: incorrect type in argument 1 (different address spaces)
drivers/soc/qcom/smsm.c:181:48: expected void const volatile [noderef] __iomem *addr
drivers/soc/qcom/smsm.c:181:48: got unsigned int [usertype] *
drivers/soc/qcom/smsm.c:219:26: warning: incorrect type in argument 1 (different address spaces)
drivers/soc/qcom/smsm.c:219:26: expected void const volatile [noderef] __iomem *addr
drivers/soc/qcom/smsm.c:219:26: got unsigned int [usertype] *remote_state
drivers/soc/qcom/smsm.c:257:49: warning: incorrect type in argument 1 (different address spaces)
drivers/soc/qcom/smsm.c:257:49: expected void const volatile [noderef] __iomem *addr
drivers/soc/qcom/smsm.c:257:49: got unsigned int [usertype] *
drivers/soc/qcom/smsm.c:259:49: warning: incorrect type in argument 2 (different address spaces)
drivers/soc/qcom/smsm.c:259:49: expected void volatile [noderef] __iomem *addr
drivers/soc/qcom/smsm.c:259:49: got unsigned int [usertype] *
drivers/soc/qcom/smsm.c:280:24: warning: incorrect type in argument 1 (different address spaces)
drivers/soc/qcom/smsm.c:280:24: expected void const volatile [noderef] __iomem *addr
drivers/soc/qcom/smsm.c:280:24: got unsigned int [usertype] *remote_state
drivers/soc/qcom/smsm.c:288:49: warning: incorrect type in argument 1 (different address spaces)
drivers/soc/qcom/smsm.c:288:49: expected void const volatile [noderef] __iomem *addr
drivers/soc/qcom/smsm.c:288:49: got unsigned int [usertype] *
drivers/soc/qcom/smsm.c:290:49: warning: incorrect type in argument 2 (different address spaces)
drivers/soc/qcom/smsm.c:290:49: expected void volatile [noderef] __iomem *addr
drivers/soc/qcom/smsm.c:290:49: got unsigned int [usertype] *
drivers/soc/qcom/smsm.c:330:26: warning: incorrect type in argument 1 (different address spaces)
drivers/soc/qcom/smsm.c:330:26: expected void const volatile [noderef] __iomem *addr
drivers/soc/qcom/smsm.c:330:26: got unsigned int [usertype] *remote_state
drivers/soc/qcom/smsm.c:635:47: warning: incorrect type in argument 2 (different address spaces)
drivers/soc/qcom/smsm.c:635:47: expected void volatile [noderef] __iomem *addr
drivers/soc/qcom/smsm.c:635:47: got unsigned int [usertype] *
Note, we don't fixup the qcom_smem_get() to return an __iomem annotated pointer.
Signed-off-by: Ben Dooks <ben.dooks@xxxxxxxxxxxxxxx>
---
drivers/soc/qcom/smsm.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/soc/qcom/smsm.c b/drivers/soc/qcom/smsm.c
index 021e9d1f61dc..8d6656edd959 100644
--- a/drivers/soc/qcom/smsm.c
+++ b/drivers/soc/qcom/smsm.c
@@ -82,8 +82,8 @@ struct qcom_smsm {
u32 num_hosts;
u32 num_entries;
- u32 *local_state;
- u32 *subscription;
+ u32 __iomem *local_state;
+ u32 __iomem *subscription;
struct qcom_smem_state *state;
spinlock_t lock;
@@ -115,8 +115,8 @@ struct smsm_entry {
DECLARE_BITMAP(irq_falling, 32);
unsigned long last_value;
- u32 *remote_state;
- u32 *subscription;
+ u32 __iomem *remote_state;
+ u32 __iomem *subscription;
};
/**
@@ -138,7 +138,7 @@ struct smsm_host {
* smsm_update_bits() - change bit in outgoing entry and inform subscribers
* @data: smsm context pointer
* @mask: value mask
- * @value: new value
+ * @Value: new value
*
* Used to set and clear the bits in the outgoing/local entry and inform
* subscribers about the change.
@@ -513,9 +513,9 @@ static int qcom_smsm_probe(struct platform_device *pdev)
struct device_node *node;
struct smsm_entry *entry;
struct qcom_smsm *smsm;
- u32 *intr_mask;
+ u32 __iomem *intr_mask;
size_t size;
- u32 *states;
+ u32 __iomem *states;
u32 id;
int ret;
@@ -579,7 +579,7 @@ static int qcom_smsm_probe(struct platform_device *pdev)
goto out_put;
}
- states = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_SMSM_SHARED_STATE, NULL);
+ states = (u32 __iomem *)qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_SMSM_SHARED_STATE, NULL);
if (IS_ERR(states)) {
dev_err(&pdev->dev, "Unable to acquire shared state entry\n");
ret = PTR_ERR(states);
@@ -594,7 +594,7 @@ static int qcom_smsm_probe(struct platform_device *pdev)
goto out_put;
}
- intr_mask = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_SMSM_CPU_INTR_MASK, NULL);
+ intr_mask = (u32 __iomem *)qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_SMSM_CPU_INTR_MASK, NULL);
if (IS_ERR(intr_mask)) {
dev_err(&pdev->dev, "unable to acquire shared memory interrupt mask\n");
ret = PTR_ERR(intr_mask);
--
2.37.2.352.g3c44437643