[Sound-open-firmware] [PATCH] Fix pointer of struct dma_trace_data.
From: Yan Wang yan.wang@linux.intel.com
Liam's previous patch modify the structure variable from instance to pointer. So it is unnecessary to use "&". This parameter of parse_page_descriptors() is "void*", so complier doesn't find this error.
Signed-off-by: Yan Wang yan.wang@linux.intel.com --- src/ipc/intel-ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ipc/intel-ipc.c b/src/ipc/intel-ipc.c index 5e14653..04e8c1b 100644 --- a/src/ipc/intel-ipc.c +++ b/src/ipc/intel-ipc.c @@ -619,7 +619,7 @@ static int ipc_dma_trace_config(uint32_t header)
/* Parse host tables */ err = parse_page_descriptors(iipc, ¶ms->buffer, - &_ipc->dmat, 1); + _ipc->dmat, 1); if (err < 0) { trace_ipc_error("ePP"); goto error;
On Thu, 2018-03-01 at 11:59 +0800, yan.wang@linux.intel.com wrote:
From: Yan Wang yan.wang@linux.intel.com
Liam's previous patch modify the structure variable from instance to pointer. So it is unnecessary to use "&". This parameter of parse_page_descriptors() is "void*", so complier doesn't find this error.
Signed-off-by: Yan Wang yan.wang@linux.intel.com
src/ipc/intel-ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks Yan applied, but I think we need to revisit this API and remove the void *.
We also need to clean this part :-
if (is_trace) err = dma_trace_host_buffer(d, &elem, ring->size); else err = comp_host_buffer(cd, &elem, ring->size);
So that it is only call after the ring parsing is complete. i.e. we know ring size at the start, so we can allocate an array of elems. This array can then be filled one by one and we only call the above code at the end (and pass the elem array).
This above change would help remove the void * and also help deep buffer (as we are not allocating one elem per page, but allocating one array instead).
Thanks
Liam
On 3/1/2018 8:46 PM, Liam Girdwood wrote:
On Thu, 2018-03-01 at 11:59 +0800, yan.wang@linux.intel.com wrote:
From: Yan Wang yan.wang@linux.intel.com
Liam's previous patch modify the structure variable from instance to pointer. So it is unnecessary to use "&". This parameter of parse_page_descriptors() is "void*", so complier doesn't find this error.
Signed-off-by: Yan Wang yan.wang@linux.intel.com
src/ipc/intel-ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks Yan applied, but I think we need to revisit this API and remove the void *.
We also need to clean this part :-
if (is_trace) err = dma_trace_host_buffer(d, &elem, ring->size); else err = comp_host_buffer(cd, &elem, ring->size);
So that it is only call after the ring parsing is complete. i.e. we know ring size at the start, so we can allocate an array of elems. This array can then be filled one by one and we only call the above code at the end (and pass the elem array).
This above change would help remove the void * and also help deep buffer (as we are not allocating one elem per page, but allocating one array instead).
Sure. I will try to modify it. Thanks for your comments.
Yan Wang
Thanks
Liam _______________________________________________ Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
participants (3)
-
Liam Girdwood
-
Yan Wang
-
yan.wang@linux.intel.com