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.
This commit is contained in:
Mark Brown 2025-09-02 11:02:19 +01:00
commit 9b7892eaad
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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);