From a2a631830deb382a3d27b6f52b2d654a3e6bb427 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sun, 30 Nov 2025 10:40:26 +0100 Subject: [PATCH] ASoC: qcom: Constify APR/GPR result structs APR and GPR callbacks receive pointer to const response packet which holds the response result. That result should not be modified by callback, so make it pointer to const for code safety. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Srinivas Kandagatla Link: https://patch.msgid.link/20251130-asoc-apr-const-v1-4-d0833f3ed423@oss.qualcomm.com Signed-off-by: Mark Brown --- sound/soc/qcom/qdsp6/q6adm.c | 2 +- sound/soc/qcom/qdsp6/q6afe.c | 2 +- sound/soc/qcom/qdsp6/q6apm.c | 2 +- sound/soc/qcom/qdsp6/q6asm.c | 2 +- sound/soc/qcom/qdsp6/q6core.c | 2 +- sound/soc/qcom/qdsp6/q6prm.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6adm.c b/sound/soc/qcom/qdsp6/q6adm.c index 608ca0e41539f..c415b30030302 100644 --- a/sound/soc/qcom/qdsp6/q6adm.c +++ b/sound/soc/qcom/qdsp6/q6adm.c @@ -188,7 +188,7 @@ static void q6adm_free_copp(struct kref *ref) static int q6adm_callback(struct apr_device *adev, const struct apr_resp_pkt *data) { - struct aprv2_ibasic_rsp_result_t *result = data->payload; + const struct aprv2_ibasic_rsp_result_t *result = data->payload; int port_idx, copp_idx; const struct apr_hdr *hdr = &data->hdr; struct q6copp *copp; diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c index a9f8b7d68a96b..e8e3e3bbacd99 100644 --- a/sound/soc/qcom/qdsp6/q6afe.c +++ b/sound/soc/qcom/qdsp6/q6afe.c @@ -961,7 +961,7 @@ static struct q6afe_port *q6afe_find_port(struct q6afe *afe, int token) static int q6afe_callback(struct apr_device *adev, const struct apr_resp_pkt *data) { struct q6afe *afe = dev_get_drvdata(&adev->dev); - struct aprv2_ibasic_rsp_result_t *res; + const struct aprv2_ibasic_rsp_result_t *res; const struct apr_hdr *hdr = &data->hdr; struct q6afe_port *port; diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index cec135c53b99e..3b504e2a9173b 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -492,7 +492,7 @@ static int graph_callback(const struct gpr_resp_pkt *data, void *priv, int op) struct data_cmd_rsp_rd_sh_mem_ep_data_buffer_done_v2 *rd_done; struct data_cmd_rsp_wr_sh_mem_ep_data_buffer_done_v2 *done; struct apm_cmd_rsp_shared_mem_map_regions *rsp; - struct gpr_ibasic_rsp_result_t *result; + const struct gpr_ibasic_rsp_result_t *result; struct q6apm_graph *graph = priv; const struct gpr_hdr *hdr = &data->hdr; struct device *dev = graph->dev; diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c index df183b7a4019c..6f1667895262c 100644 --- a/sound/soc/qcom/qdsp6/q6asm.c +++ b/sound/soc/qcom/qdsp6/q6asm.c @@ -603,7 +603,7 @@ static int32_t q6asm_stream_callback(struct apr_device *adev, int session_id) { struct q6asm *q6asm = dev_get_drvdata(&adev->dev); - struct aprv2_ibasic_rsp_result_t *result; + const struct aprv2_ibasic_rsp_result_t *result; const struct apr_hdr *hdr = &data->hdr; struct audio_port_data *port; struct audio_client *ac; diff --git a/sound/soc/qcom/qdsp6/q6core.c b/sound/soc/qcom/qdsp6/q6core.c index 51398199bff3d..f4939302b88ac 100644 --- a/sound/soc/qcom/qdsp6/q6core.c +++ b/sound/soc/qcom/qdsp6/q6core.c @@ -70,7 +70,7 @@ static struct q6core *g_core; static int q6core_callback(struct apr_device *adev, const struct apr_resp_pkt *data) { struct q6core *core = dev_get_drvdata(&adev->dev); - struct aprv2_ibasic_rsp_result_t *result; + const struct aprv2_ibasic_rsp_result_t *result; const struct apr_hdr *hdr = &data->hdr; result = data->payload; diff --git a/sound/soc/qcom/qdsp6/q6prm.c b/sound/soc/qcom/qdsp6/q6prm.c index eaec6d211cf84..6d9834b5d16b6 100644 --- a/sound/soc/qcom/qdsp6/q6prm.c +++ b/sound/soc/qcom/qdsp6/q6prm.c @@ -179,7 +179,7 @@ static int prm_callback(const struct gpr_resp_pkt *data, void *priv, int op) { gpr_device_t *gdev = priv; struct q6prm *prm = dev_get_drvdata(&gdev->dev); - struct gpr_ibasic_rsp_result_t *result; + const struct gpr_ibasic_rsp_result_t *result; const struct gpr_hdr *hdr = &data->hdr; switch (hdr->opcode) { -- 2.47.3