Thread (40 messages) flat view 40 messages, 5 authors, 2021-07-30

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

From: Srinivas Kandagatla <hidden>
Date: 2021-07-15 10:32:12
Also in: alsa-devel, lkml

Thanks Pierre,

On 14/07/2021 17:48, Pierre-Louis Bossart wrote:
quoted
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help