diff mbox series

firmware: arm_scmi: fix incorrect type in optee transport

Message ID 20220404101722.27986-1-etienne.carriere@linaro.org (mailing list archive)
State New, archived
Headers show
Series firmware: arm_scmi: fix incorrect type in optee transport | expand

Commit Message

Etienne Carriere April 4, 2022, 10:17 a.m. UTC
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@intel.com>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
---
 drivers/firmware/arm_scmi/optee.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Sudeep Holla April 4, 2022, 10:59 a.m. UTC | #1
On Mon, Apr 04, 2022 at 12:17:22PM +0200, Etienne Carriere wrote:
> 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 @@
>

We seem to have crossed each other when we posted this. I hadn't got this
patch before I posted. Sorry for that.
diff mbox series

Patch

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);
 }