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 GPR callback response data

GPR bus driver calls each GPR client callback with pointer to the GPR
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-3-d0833f3ed423@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Mark Brown
f3a86870 c66cea19

+7 -7
+1 -1
include/linux/soc/qcom/apr.h
··· 122 122 #define APR_SVC_MAJOR_VERSION(v) ((v >> 16) & 0xFF) 123 123 #define APR_SVC_MINOR_VERSION(v) (v & 0xFF) 124 124 125 - typedef int (*gpr_port_cb) (struct gpr_resp_pkt *d, void *priv, int op); 125 + typedef int (*gpr_port_cb) (const struct gpr_resp_pkt *d, void *priv, int op); 126 126 struct packet_router; 127 127 struct pkt_router_svc { 128 128 struct device *dev;
+4 -4
sound/soc/qcom/qdsp6/q6apm.c
··· 487 487 } 488 488 EXPORT_SYMBOL_GPL(q6apm_get_hw_pointer); 489 489 490 - static int graph_callback(struct gpr_resp_pkt *data, void *priv, int op) 490 + static int graph_callback(const struct gpr_resp_pkt *data, void *priv, int op) 491 491 { 492 492 struct data_cmd_rsp_rd_sh_mem_ep_data_buffer_done_v2 *rd_done; 493 493 struct data_cmd_rsp_wr_sh_mem_ep_data_buffer_done_v2 *done; 494 494 struct apm_cmd_rsp_shared_mem_map_regions *rsp; 495 495 struct gpr_ibasic_rsp_result_t *result; 496 496 struct q6apm_graph *graph = priv; 497 - struct gpr_hdr *hdr = &data->hdr; 497 + const struct gpr_hdr *hdr = &data->hdr; 498 498 struct device *dev = graph->dev; 499 499 uint32_t client_event; 500 500 phys_addr_t phys; ··· 761 761 762 762 } 763 763 764 - static int apm_callback(struct gpr_resp_pkt *data, void *priv, int op) 764 + static int apm_callback(const struct gpr_resp_pkt *data, void *priv, int op) 765 765 { 766 766 gpr_device_t *gdev = priv; 767 767 struct q6apm *apm = dev_get_drvdata(&gdev->dev); 768 768 struct device *dev = &gdev->dev; 769 769 struct gpr_ibasic_rsp_result_t *result; 770 - struct gpr_hdr *hdr = &data->hdr; 770 + const struct gpr_hdr *hdr = &data->hdr; 771 771 772 772 result = data->payload; 773 773
+2 -2
sound/soc/qcom/qdsp6/q6prm.c
··· 175 175 } 176 176 EXPORT_SYMBOL_GPL(q6prm_set_lpass_clock); 177 177 178 - static int prm_callback(struct gpr_resp_pkt *data, void *priv, int op) 178 + static int prm_callback(const struct gpr_resp_pkt *data, void *priv, int op) 179 179 { 180 180 gpr_device_t *gdev = priv; 181 181 struct q6prm *prm = dev_get_drvdata(&gdev->dev); 182 182 struct gpr_ibasic_rsp_result_t *result; 183 - struct gpr_hdr *hdr = &data->hdr; 183 + const struct gpr_hdr *hdr = &data->hdr; 184 184 185 185 switch (hdr->opcode) { 186 186 case PRM_CMD_RSP_REQUEST_HW_RSC: