[PATCH v2 2/5] remoteproc: mtp_scp: Constify buffer passed to scp_send_ipi()

Krzysztof Kozlowski posted 5 patches 4 weeks, 1 day ago
There is a newer version of this series
[PATCH v2 2/5] remoteproc: mtp_scp: Constify buffer passed to scp_send_ipi()
Posted by Krzysztof Kozlowski 4 weeks, 1 day ago
scp_send_ipi() should only send the passed buffer, without modifying its
contents, so mark pointer 'buf' as pointer to const.

Acked-by: Mathieu Poirier <mathieuu.poirier@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---

Patch necessary for the further patches, please keep with the rest.
---
 drivers/remoteproc/mtk_scp.c    | 2 +-
 include/linux/rpmsg/mtk_rpmsg.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index bb6f6a16d895..85a74c9ec521 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -1078,7 +1078,7 @@ static void scp_unregister_ipi(struct platform_device *pdev, u32 id)
 	scp_ipi_unregister(scp, id);
 }
 
-static int scp_send_ipi(struct platform_device *pdev, u32 id, void *buf,
+static int scp_send_ipi(struct platform_device *pdev, u32 id, const void *buf,
 			unsigned int len, unsigned int wait)
 {
 	struct mtk_scp *scp = platform_get_drvdata(pdev);
diff --git a/include/linux/rpmsg/mtk_rpmsg.h b/include/linux/rpmsg/mtk_rpmsg.h
index 363b60178040..badcbc89917f 100644
--- a/include/linux/rpmsg/mtk_rpmsg.h
+++ b/include/linux/rpmsg/mtk_rpmsg.h
@@ -25,7 +25,7 @@ struct mtk_rpmsg_info {
 			    ipi_handler_t handler, void *priv);
 	void (*unregister_ipi)(struct platform_device *pdev, u32 id);
 	int (*send_ipi)(struct platform_device *pdev, u32 id,
-			void *buf, unsigned int len, unsigned int wait);
+			const void *buf, unsigned int len, unsigned int wait);
 	int ns_ipi_id;
 };
 

-- 
2.51.0
Re: [PATCH v2 2/5] remoteproc: mtp_scp: Constify buffer passed to scp_send_ipi()
Posted by AngeloGioacchino Del Regno 4 weeks, 1 day ago
Il 10/03/26 12:22, Krzysztof Kozlowski ha scritto:
> scp_send_ipi() should only send the passed buffer, without modifying its
> contents, so mark pointer 'buf' as pointer to const.
> 
> Acked-by: Mathieu Poirier <mathieuu.poirier@linaro.org>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>



Please fix the commit title - that should be `remoteproc: mtk_scp: .....`

After which:

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Re: [PATCH v2 2/5] remoteproc: mtp_scp: Constify buffer passed to scp_send_ipi()
Posted by Krzysztof Kozlowski 4 weeks, 1 day ago
On 10/03/2026 15:35, AngeloGioacchino Del Regno wrote:
> Il 10/03/26 12:22, Krzysztof Kozlowski ha scritto:
>> scp_send_ipi() should only send the passed buffer, without modifying its
>> contents, so mark pointer 'buf' as pointer to const.
>>
>> Acked-by: Mathieu Poirier <mathieuu.poirier@linaro.org>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> 
> 
> 
> Please fix the commit title - that should be `remoteproc: mtk_scp: .....`

Ack, thanks!

> 
> After which:
> 
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> 


Best regards,
Krzysztof