Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: qcom: Constify APR callback response data

APR bus driver calls each APR client callback with pointer to the APR
response packet. The callbacks are not suppose to modify that response
packet, so make it a pointer to const to document that expectation
explicitly.

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-1-d0833f3ed423@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Mark Brown
86af3c22 8f0b4cce

+11 -11
+1 -1
include/linux/soc/qcom/apr.h
··· 155 155 int (*probe)(struct apr_device *sl); 156 156 void (*remove)(struct apr_device *sl); 157 157 int (*callback)(struct apr_device *a, 158 - struct apr_resp_pkt *d); 158 + const struct apr_resp_pkt *d); 159 159 int (*gpr_callback)(struct gpr_resp_pkt *d, void *data, int op); 160 160 struct device_driver driver; 161 161 const struct apr_device_id *id_table;
+2 -2
sound/soc/qcom/qdsp6/q6adm.c
··· 186 186 kfree(c); 187 187 } 188 188 189 - static int q6adm_callback(struct apr_device *adev, struct apr_resp_pkt *data) 189 + static int q6adm_callback(struct apr_device *adev, const struct apr_resp_pkt *data) 190 190 { 191 191 struct aprv2_ibasic_rsp_result_t *result = data->payload; 192 192 int port_idx, copp_idx; 193 - struct apr_hdr *hdr = &data->hdr; 193 + const struct apr_hdr *hdr = &data->hdr; 194 194 struct q6copp *copp; 195 195 struct q6adm *adm = dev_get_drvdata(&adev->dev); 196 196
+2 -2
sound/soc/qcom/qdsp6/q6afe.c
··· 958 958 return ret; 959 959 } 960 960 961 - static int q6afe_callback(struct apr_device *adev, struct apr_resp_pkt *data) 961 + static int q6afe_callback(struct apr_device *adev, const struct apr_resp_pkt *data) 962 962 { 963 963 struct q6afe *afe = dev_get_drvdata(&adev->dev); 964 964 struct aprv2_ibasic_rsp_result_t *res; 965 - struct apr_hdr *hdr = &data->hdr; 965 + const struct apr_hdr *hdr = &data->hdr; 966 966 struct q6afe_port *port; 967 967 968 968 if (!data->payload_size)
+4 -4
sound/soc/qcom/qdsp6/q6asm.c
··· 599 599 EXPORT_SYMBOL_GPL(q6asm_get_hw_pointer); 600 600 601 601 static int32_t q6asm_stream_callback(struct apr_device *adev, 602 - struct apr_resp_pkt *data, 602 + const struct apr_resp_pkt *data, 603 603 int session_id) 604 604 { 605 605 struct q6asm *q6asm = dev_get_drvdata(&adev->dev); 606 606 struct aprv2_ibasic_rsp_result_t *result; 607 - struct apr_hdr *hdr = &data->hdr; 607 + const struct apr_hdr *hdr = &data->hdr; 608 608 struct audio_port_data *port; 609 609 struct audio_client *ac; 610 610 uint32_t client_event = 0; ··· 744 744 } 745 745 746 746 static int q6asm_srvc_callback(struct apr_device *adev, 747 - struct apr_resp_pkt *data) 747 + const struct apr_resp_pkt *data) 748 748 { 749 749 struct q6asm *q6asm = dev_get_drvdata(&adev->dev); 750 750 struct aprv2_ibasic_rsp_result_t *result; 751 751 struct audio_port_data *port; 752 752 struct audio_client *ac = NULL; 753 - struct apr_hdr *hdr = &data->hdr; 753 + const struct apr_hdr *hdr = &data->hdr; 754 754 struct q6asm *a; 755 755 uint32_t sid = 0; 756 756 uint32_t dir = 0;
+2 -2
sound/soc/qcom/qdsp6/q6core.c
··· 67 67 68 68 static struct q6core *g_core; 69 69 70 - static int q6core_callback(struct apr_device *adev, struct apr_resp_pkt *data) 70 + static int q6core_callback(struct apr_device *adev, const struct apr_resp_pkt *data) 71 71 { 72 72 struct q6core *core = dev_get_drvdata(&adev->dev); 73 73 struct aprv2_ibasic_rsp_result_t *result; 74 - struct apr_hdr *hdr = &data->hdr; 74 + const struct apr_hdr *hdr = &data->hdr; 75 75 76 76 result = data->payload; 77 77 switch (hdr->opcode) {