[linux-yocto] [PATCH] drivers: soc: xilinx: fix compile warning by defining payload array length to 32
quanyang.wang at windriver.com
quanyang.wang at windriver.com
Mon Nov 4 07:01:04 PST 2019
From: Quanyang Wang <quanyang.wang at windriver.com>
In zynqmp-ipi-mailbox.c and zynqmp_r5_remoteproc.c, the variables of
zynqmp_ipi_message structures are all using 32 as the maximum size of
data length. So move IPI_BUF_LEN_MAX to zynqmp-ipi-message.h to share with
zynqmp_power.c.
Signed-off-by: Quanyang Wang <quanyang.wang at windriver.com>
---
drivers/remoteproc/zynqmp_r5_remoteproc.c | 2 --
drivers/soc/xilinx/zynqmp_power.c | 2 +-
include/linux/mailbox/zynqmp-ipi-message.h | 3 +++
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/remoteproc/zynqmp_r5_remoteproc.c b/drivers/remoteproc/zynqmp_r5_remoteproc.c
index 097e2055b39f..5df4e512865e 100644
--- a/drivers/remoteproc/zynqmp_r5_remoteproc.c
+++ b/drivers/remoteproc/zynqmp_r5_remoteproc.c
@@ -48,8 +48,6 @@
/* PM proc states */
#define PM_PROC_STATE_ACTIVE 1U
-/* IPI buffer MAX length */
-#define IPI_BUF_LEN_MAX 32U
/* RX mailbox client buffer max length */
#define RX_MBOX_CLIENT_BUF_MAX (IPI_BUF_LEN_MAX + \
sizeof(struct zynqmp_ipi_message))
diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c
index 663010658b2a..01a2e9dc1fe5 100644
--- a/drivers/soc/xilinx/zynqmp_power.c
+++ b/drivers/soc/xilinx/zynqmp_power.c
@@ -88,7 +88,7 @@ static irqreturn_t zynqmp_pm_isr(int irq, void *data)
static void ipi_receive_callback(struct mbox_client *cl, void *data)
{
struct zynqmp_ipi_message *msg = (struct zynqmp_ipi_message *)data;
- u32 payload[msg->len];
+ u32 payload[IPI_BUF_LEN_MAX];
int ret;
memcpy(payload, msg->data, sizeof(msg->len));
diff --git a/include/linux/mailbox/zynqmp-ipi-message.h b/include/linux/mailbox/zynqmp-ipi-message.h
index 9542b41eacfd..d9f0a7471b51 100644
--- a/include/linux/mailbox/zynqmp-ipi-message.h
+++ b/include/linux/mailbox/zynqmp-ipi-message.h
@@ -3,6 +3,9 @@
#ifndef _LINUX_ZYNQMP_IPI_MESSAGE_H_
#define _LINUX_ZYNQMP_IPI_MESSAGE_H_
+/* IPI buffer MAX length */
+#define IPI_BUF_LEN_MAX 32U
+
/**
* struct zynqmp_ipi_message - ZynqMP IPI message structure
* @len: Length of message
--
2.17.1
More information about the linux-yocto
mailing list