[PATCH v2 07/16] ASoC: qcom: audioreach: add module configuration command helpers

Srinivas Kandagatla srinivas.kandagatla at linaro.org
Thu Jul 15 12:32:06 CEST 2021


Thanks Pierre,

On 14/07/2021 17:48, Pierre-Louis Bossart wrote:
> 
>> +static int audioreach_shmem_set_media_format(struct q6apm_graph *graph,
>> +				       struct audioreach_module *module,
>> +				       int direction, uint32_t rate,
>> +				       uint32_t num_channels,
>> +				       u8 channel_map[PCM_MAX_NUM_CHANNEL],
>> +				       uint16_t bits_per_sample)
>> +{
>> +	struct apm_module_param_data *param_data;
>> +	struct payload_media_fmt_pcm *cfg;
>> +	struct media_format *header;
>> +	int rc, payload_size;
>> +	struct gpr_pkt *pkt;
>> +	void *p;
>> +
>> +	if (num_channels < 0 || num_channels > 2)
>> +		dev_err(graph->dev, "Error: Invalid channels (%d)!\n", num_channels);
> 
> that doesn't sound good, you flag num_channels as an invalid value but still continue using it.

I forgot to run cppcheck after doing make W=1 C=1.

It did catch these, will fix all such instances before I send out next 
version.



--srini


More information about the Alsa-devel mailing list