Skip to content

Commit ca65a29

Browse files
committed
audio: eq_iir: Clear lookup tail with memset
Use memset() to zero the unused tail of the response lookup array in eq_iir_walk_config() instead of a per-slot loop. The walk pre-clears the whole table once when a lookup is requested and then fills the in-use entries. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 442b1d4 commit ca65a29

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎src/audio/eq_iir/eq_iir_generic.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,17 +270,16 @@ static int eq_iir_walk_config(struct comp_dev *dev,
270270

271271
j = 0;
272272
coef_data = ASSUME_ALIGNED(&config->data[config->channels_in_config], 4);
273+
if (lookup)
274+
memset(lookup, 0, SOF_EQ_IIR_MAX_RESPONSES * sizeof(*lookup));
275+
273276
for (i = 0; i < config->number_of_responses; i++) {
274277
ret = eq_iir_init_response(dev, i, coef_data, coef_words_max, &j, &eq);
275278
if (ret < 0)
276279
return ret;
277280
if (lookup)
278281
lookup[i] = eq;
279282
}
280-
if (lookup) {
281-
for (; i < SOF_EQ_IIR_MAX_RESPONSES; i++)
282-
lookup[i] = NULL;
283-
}
284283

285284
return 0;
286285
}

0 commit comments

Comments
 (0)