[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251129-b4-container-of-const-asoc-qcom-v1-3-67a3d3320371@oss.qualcomm.com>
Date: Sat, 29 Nov 2025 15:02:33 +0100
From: Krzysztof Kozlowski <krzysztof.kozlowski@....qualcomm.com>
To: Srinivas Kandagatla <srini@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
Cc: linux-sound@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Krzysztof Kozlowski <krzysztof.kozlowski@....qualcomm.com>
Subject: [PATCH 3/6] ASoC: qcom: topology: Constify pointed ar control
structs
audioreach_route_load() does not modify the pointed 'struct
audioreach_module' and functions for connecting subgraphs do not change
pointed 'struct snd_ar_control'. Constify the pointers for
self-explanatory code (pointed memory is not modified by the function)
and a bit safer code.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@....qualcomm.com>
---
sound/soc/qcom/qdsp6/topology.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topology.c
index 748a3b7fa78d..67d3147caf62 100644
--- a/sound/soc/qcom/qdsp6/topology.c
+++ b/sound/soc/qcom/qdsp6/topology.c
@@ -1032,7 +1032,7 @@ static struct audioreach_module *audioreach_find_module(struct snd_soc_component
static int audioreach_route_load(struct snd_soc_component *scomp, int index,
struct snd_soc_dapm_route *route)
{
- struct audioreach_module *src_module, *sink_module;
+ const struct audioreach_module *src_module, *sink_module;
struct snd_ar_control *control;
struct snd_soc_dapm_widget *w;
int i;
@@ -1098,8 +1098,8 @@ static int audioreach_link_load(struct snd_soc_component *component, int index,
}
static void audioreach_connect_sub_graphs(struct q6apm *apm,
- struct snd_ar_control *m1,
- struct snd_ar_control *m2,
+ const struct snd_ar_control *m1,
+ const struct snd_ar_control *m2,
bool connect)
{
struct audioreach_graph_info *info;
@@ -1123,10 +1123,10 @@ static void audioreach_connect_sub_graphs(struct q6apm *apm,
}
static bool audioreach_is_vmixer_connected(struct q6apm *apm,
- struct snd_ar_control *m1,
- struct snd_ar_control *m2)
+ const struct snd_ar_control *m1,
+ const struct snd_ar_control *m2)
{
- struct audioreach_graph_info *info;
+ const struct audioreach_graph_info *info;
mutex_lock(&apm->lock);
info = idr_find(&apm->graph_info_idr, m2->graph_id);
--
2.48.1
Powered by blists - more mailing lists