From 720cdcda675f778dc232aa5def986a4b477aaa71 Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Tue, 16 Jul 2019 11:21:22 +0800 Subject: [PATCH] sof-ctl: fix ABI dumping doesn't work issue For dumping to output file without '-r', we need to dump ABI header, here fix it. Signed-off-by: Keyon Jie --- tools/ctl/ctl.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/ctl/ctl.c b/tools/ctl/ctl.c index cff217c9c..cfcc401a4 100644 --- a/tools/ctl/ctl.c +++ b/tools/ctl/ctl.c @@ -413,13 +413,14 @@ static void ctl_dump(struct ctl_data *ctl_data) } if (ctl_data->binary) { - if (ctl_data->no_abi) - offset = BUFFER_ABI_OFFSET + - sizeof(struct sof_abi_hdr) / - sizeof(int); - n = ctl_data->buffer[BUFFER_SIZE_OFFSET] - - sizeof(struct sof_abi_hdr); + offset = BUFFER_ABI_OFFSET; + n = ctl_data->buffer[BUFFER_SIZE_OFFSET]; + if (ctl_data->no_abi) { + offset += sizeof(struct sof_abi_hdr) / + sizeof(int); + n -= sizeof(struct sof_abi_hdr); + } n = fwrite(&ctl_data->buffer[offset], 1, n, fh); }