]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
remoteproc: mtk_scp_ipi: Constify buffer passed to scp_ipi_send()
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Tue, 17 Mar 2026 12:36:50 +0000 (13:36 +0100)
committerBjorn Andersson <andersson@kernel.org>
Mon, 6 Apr 2026 14:37:50 +0000 (09:37 -0500)
scp_ipi_send() should only send the passed buffer, without modifying its
contents, so mark pointer 'buf' as pointer to const.

Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260317-rpmsg-send-const-v3-1-4d7fd27f037f@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/remoteproc/mtk_scp_ipi.c
include/linux/remoteproc/mtk_scp.h

index 7a37e273b3af8dfe75ec26e2906f3e3e018bdff2..ee2f1121411fcf99209274248c51219102688ff8 100644 (file)
@@ -156,7 +156,7 @@ EXPORT_SYMBOL_GPL(scp_ipi_unlock);
  *
  * Return: 0 if sending data successfully, -error on error.
  **/
-int scp_ipi_send(struct mtk_scp *scp, u32 id, void *buf, unsigned int len,
+int scp_ipi_send(struct mtk_scp *scp, u32 id, const void *buf, unsigned int len,
                 unsigned int wait)
 {
        struct mtk_share_obj __iomem *send_obj = scp->send_buf;
index 344ff41c22c70a3e9e3d0a95a6b07b74097e3b19..4070537d6542d1373759349be31d34620a3a1eb6 100644 (file)
@@ -58,7 +58,7 @@ int scp_ipi_register(struct mtk_scp *scp, u32 id, scp_ipi_handler_t handler,
                     void *priv);
 void scp_ipi_unregister(struct mtk_scp *scp, u32 id);
 
-int scp_ipi_send(struct mtk_scp *scp, u32 id, void *buf, unsigned int len,
+int scp_ipi_send(struct mtk_scp *scp, u32 id, const void *buf, unsigned int len,
                 unsigned int wait);
 
 unsigned int scp_get_vdec_hw_capa(struct mtk_scp *scp);