diff options
| author | Mark Brown <broonie@kernel.org> | 2025-09-02 11:02:19 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-09-02 11:02:19 +0100 |
| commit | 9b7892eaadcd12eacecd90e52c96c35616d747ce (patch) | |
| tree | 20baab96c60bbfac6858c6175c43c51e21fd78b2 | |
| parent | 8a9772ec08f87c9e45ab1ad2c8d2b8c1763836eb (diff) | |
| parent | 8f57dcf39fd0864f5f3e6701fe885e55f45d0d3a (diff) | |
ASoC: qcom: audioreach: fix sparse warnings
Merge series from Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>:
Recent static calibration support patches have excersised new code path
exposing some missing checks and also accessing some variables which are
of LE type that are accessed directly without converting it to CPU type.
Thanks to Dan Carpenter and kernel test robot for reporting this.
| -rw-r--r-- | sound/soc/qcom/qdsp6/audioreach.c | 2 | ||||
| -rw-r--r-- | sound/soc/qcom/qdsp6/topology.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audioreach.c index f4c53e84b4dc..bbfd51db8797 100644 --- a/sound/soc/qcom/qdsp6/audioreach.c +++ b/sound/soc/qcom/qdsp6/audioreach.c @@ -815,7 +815,7 @@ static int audioreach_set_module_config(struct q6apm_graph *graph, struct audioreach_module *module, struct audioreach_module_config *cfg) { - int payload_size = module->data->size; + int payload_size = le32_to_cpu(module->data->size); struct gpr_pkt *pkt; int rc; void *p; diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topology.c index ec51fabd98cb..f61285e7dcf2 100644 --- a/sound/soc/qcom/qdsp6/topology.c +++ b/sound/soc/qcom/qdsp6/topology.c @@ -314,7 +314,7 @@ static struct audioreach_module_priv_data *audioreach_get_module_priv_data( struct snd_soc_tplg_vendor_array *mod_array; mod_array = (struct snd_soc_tplg_vendor_array *)((u8 *)private->array + sz); - if (mod_array->type == SND_SOC_AR_TPLG_MODULE_CFG_TYPE) { + if (le32_to_cpu(mod_array->type) == SND_SOC_AR_TPLG_MODULE_CFG_TYPE) { struct audioreach_module_priv_data *pdata; pdata = kzalloc(struct_size(pdata, data, le32_to_cpu(mod_array->size)), @@ -607,8 +607,8 @@ static int audioreach_widget_load_module_common(struct snd_soc_component *compon return PTR_ERR(cont); mod = audioreach_parse_common_tokens(apm, cont, &tplg_w->priv, w); - if (IS_ERR(mod)) - return PTR_ERR(mod); + if (IS_ERR_OR_NULL(mod)) + return mod ? PTR_ERR(mod) : -ENODEV; mod->data = audioreach_get_module_priv_data(&tplg_w->priv); |
