Skip to content

Commit 4251dab

Browse files
krzkandersson
authored andcommitted
remoteproc: mtk_scp_ipi: Constify buffer passed to scp_ipi_send()
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>
1 parent 82c43ba commit 4251dab

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/remoteproc/mtk_scp_ipi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ EXPORT_SYMBOL_GPL(scp_ipi_unlock);
156156
*
157157
* Return: 0 if sending data successfully, -error on error.
158158
**/
159-
int scp_ipi_send(struct mtk_scp *scp, u32 id, void *buf, unsigned int len,
159+
int scp_ipi_send(struct mtk_scp *scp, u32 id, const void *buf, unsigned int len,
160160
unsigned int wait)
161161
{
162162
struct mtk_share_obj __iomem *send_obj = scp->send_buf;

include/linux/remoteproc/mtk_scp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int scp_ipi_register(struct mtk_scp *scp, u32 id, scp_ipi_handler_t handler,
5858
void *priv);
5959
void scp_ipi_unregister(struct mtk_scp *scp, u32 id);
6060

61-
int scp_ipi_send(struct mtk_scp *scp, u32 id, void *buf, unsigned int len,
61+
int scp_ipi_send(struct mtk_scp *scp, u32 id, const void *buf, unsigned int len,
6262
unsigned int wait);
6363

6464
unsigned int scp_get_vdec_hw_capa(struct mtk_scp *scp);

0 commit comments

Comments
 (0)