Skip to content

Commit e09cf2c

Browse files
author
Jyri Sarha
committed
probe: Reorder the init function to be more logical
It makse more sense to initialize the probe data right after the allocation than at the end of the function. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent 856629d commit e09cf2c

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/probe/probe.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,14 @@ int probe_init(const struct probe_dma *probe_dma)
365365
return -ENOMEM;
366366
}
367367

368+
/* initialize injection DMAs as invalid */
369+
for (i = 0; i < CONFIG_PROBE_DMA_MAX; i++)
370+
_probe->inject_dma[i].stream_tag = PROBE_DMA_INVALID;
371+
372+
/* initialize probe points as invalid */
373+
for (i = 0; i < CONFIG_PROBE_POINTS_MAX; i++)
374+
_probe->probe_points[i].stream_tag = PROBE_POINT_INVALID;
375+
368376
/* setup extraction dma if requested */
369377
if (probe_dma) {
370378
tr_dbg(&pr_tr, "\tstream_tag = %u, dma_buffer_size = %u",
@@ -400,14 +408,6 @@ int probe_init(const struct probe_dma *probe_dma)
400408
_probe->ext_dma.stream_tag = PROBE_DMA_INVALID;
401409
}
402410

403-
/* initialize injection DMAs as invalid */
404-
for (i = 0; i < CONFIG_PROBE_DMA_MAX; i++)
405-
_probe->inject_dma[i].stream_tag = PROBE_DMA_INVALID;
406-
407-
/* initialize probe points as invalid */
408-
for (i = 0; i < CONFIG_PROBE_POINTS_MAX; i++)
409-
_probe->probe_points[i].stream_tag = PROBE_POINT_INVALID;
410-
411411
return 0;
412412
}
413413

0 commit comments

Comments
 (0)