[PATCH] firmware: arm_scmi: fix incorrect type in optee transport
From: Etienne Carriere
Date: Mon Apr 04 2022 - 06:17:39 EST
Correct struct scmi_shared_mem references that should have __iomem
attribute. The issue was reported by kernel test robot:
drivers/firmware/arm_scmi/optee.c:428:20: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected struct scmi_shared_mem * @@ got struct scmi_shared_mem [noderef] __iomem *shmem @@
drivers/firmware/arm_scmi/optee.c:440:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct scmi_shared_mem [noderef] __iomem *shmem @@ got struct scmi_shared_mem *shmem @@
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: Etienne Carriere <etienne.carriere@xxxxxxxxxx>
---
drivers/firmware/arm_scmi/optee.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/firmware/arm_scmi/optee.c b/drivers/firmware/arm_scmi/optee.c
index 734f1eeee161..bcab9ff73103 100644
--- a/drivers/firmware/arm_scmi/optee.c
+++ b/drivers/firmware/arm_scmi/optee.c
@@ -405,8 +405,8 @@ static int scmi_optee_chan_free(int id, void *p, void *data)
return 0;
}
-static struct scmi_shared_mem *get_channel_shm(struct scmi_optee_channel *chan,
- struct scmi_xfer *xfer)
+static struct scmi_shared_mem __iomem *get_channel_shm(struct scmi_optee_channel *chan,
+ struct scmi_xfer *xfer)
{
if (!chan)
return NULL;
@@ -419,7 +419,7 @@ static int scmi_optee_send_message(struct scmi_chan_info *cinfo,
struct scmi_xfer *xfer)
{
struct scmi_optee_channel *channel = cinfo->transport_info;
- struct scmi_shared_mem *shmem = get_channel_shm(channel, xfer);
+ struct scmi_shared_mem __iomem *shmem = get_channel_shm(channel, xfer);
int ret;
mutex_lock(&channel->mu);
@@ -436,7 +436,7 @@ static void scmi_optee_fetch_response(struct scmi_chan_info *cinfo,
struct scmi_xfer *xfer)
{
struct scmi_optee_channel *channel = cinfo->transport_info;
- struct scmi_shared_mem *shmem = get_channel_shm(channel, xfer);
+ struct scmi_shared_mem __iomem *shmem = get_channel_shm(channel, xfer);
shmem_fetch_response(shmem, xfer);
}
--
2.17.1