]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: qcom: Constify APR/GPR result structs
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Sun, 30 Nov 2025 09:40:26 +0000 (10:40 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 19 Dec 2025 21:29:31 +0000 (21:29 +0000)
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 <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20251130-asoc-apr-const-v1-4-d0833f3ed423@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/qdsp6/q6adm.c
sound/soc/qcom/qdsp6/q6afe.c
sound/soc/qcom/qdsp6/q6apm.c
sound/soc/qcom/qdsp6/q6asm.c
sound/soc/qcom/qdsp6/q6core.c
sound/soc/qcom/qdsp6/q6prm.c

index 608ca0e41539f414a0098db07e774644a30ba742..c415b30030302758ae74fa4b217aec1e9cc37711 100644 (file)
@@ -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;
index a9f8b7d68a96bc1fea9abba951c7cf446cd9439d..e8e3e3bbacd99f0cc955c980e104f9e9dc623a69 100644 (file)
@@ -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;
 
index cec135c53b99e06f4db996876a2d5528a5521841..3b504e2a9173be1223151e3c2e8d17ecc903960f 100644 (file)
@@ -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;
index df183b7a4019c1526c451773874a5800210f2f1b..6f1667895262ca1f7296d79caae6f9c02d6a9a1e 100644 (file)
@@ -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;
index 51398199bff3d9fe6a6583c8bf9b13527bc10747..f4939302b88ac146d06ae7246879710cb46f1e67 100644 (file)
@@ -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;
index eaec6d211cf8489df73b4d6ad30f645be269aa5e..6d9834b5d16b6c0e575e31665bb34663d15190b0 100644 (file)
@@ -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) {