Skip to content

Commit 287e4f9

Browse files
tmlemanlgirdwood
authored andcommitted
audio: chain_dma: fix incorrect format specifier for error codes
This patch corrects the format specifier used for printing error codes in the chain_dma.c file. The error codes are signed integers, but the format specifier used was `%u`, which is for unsigned integers. This caused negative error codes to be printed incorrectly as large positive values. The format specifier has been changed to `%d` to correctly print signed integers. This is a cosmetic change that ensures error codes are accurately represented in the logs, aiding in debugging and analysis. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent d16d8c4 commit 287e4f9

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/audio/chain_dma.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ static enum task_state chain_task_run(void *data)
187187
break;
188188
case -EPIPE:
189189
tr_warn(&chain_dma_tr, "chain_task_run(): dma_get_status() link xrun occurred,"
190-
" ret = %u", ret);
190+
" ret = %d", ret);
191191
#if CONFIG_XRUN_NOTIFICATIONS_ENABLE
192192
handle_xrun(cd);
193193
#endif
194194
break;
195195
default:
196-
tr_err(&chain_dma_tr, "chain_task_run(): dma_get_status() error, ret = %u", ret);
196+
tr_err(&chain_dma_tr, "chain_task_run(): dma_get_status() error, ret = %d", ret);
197197
return SOF_TASK_STATE_COMPLETED;
198198
}
199199

@@ -204,7 +204,7 @@ static enum task_state chain_task_run(void *data)
204204
/* Host DMA does not report xruns. All error values will be treated as critical. */
205205
ret = dma_get_status(cd->chan_host->dma->z_dev, cd->chan_host->index, &stat);
206206
if (ret < 0) {
207-
tr_err(&chain_dma_tr, "chain_task_run(): dma_get_status() error, ret = %u", ret);
207+
tr_err(&chain_dma_tr, "chain_task_run(): dma_get_status() error, ret = %d", ret);
208208
return SOF_TASK_STATE_COMPLETED;
209209
}
210210

@@ -223,14 +223,14 @@ static enum task_state chain_task_run(void *data)
223223
ret = dma_reload(cd->chan_host->dma->z_dev, cd->chan_host->index, 0, 0, increment);
224224
if (ret < 0) {
225225
tr_err(&chain_dma_tr,
226-
"chain_task_run(): dma_reload() host error, ret = %u", ret);
226+
"chain_task_run(): dma_reload() host error, ret = %d", ret);
227227
return SOF_TASK_STATE_COMPLETED;
228228
}
229229

230230
ret = dma_reload(cd->chan_link->dma->z_dev, cd->chan_link->index, 0, 0, increment);
231231
if (ret < 0) {
232232
tr_err(&chain_dma_tr,
233-
"chain_task_run(): dma_reload() link error, ret = %u", ret);
233+
"chain_task_run(): dma_reload() link error, ret = %d", ret);
234234
return SOF_TASK_STATE_COMPLETED;
235235
}
236236
} else {
@@ -248,7 +248,7 @@ static enum task_state chain_task_run(void *data)
248248
half_buff_size);
249249
if (ret < 0) {
250250
tr_err(&chain_dma_tr,
251-
"chain_task_run(): dma_reload() link error, ret = %u",
251+
"chain_task_run(): dma_reload() link error, ret = %d",
252252
ret);
253253
return SOF_TASK_STATE_COMPLETED;
254254
}
@@ -264,7 +264,7 @@ static enum task_state chain_task_run(void *data)
264264
0, 0, transferred);
265265
if (ret < 0) {
266266
tr_err(&chain_dma_tr,
267-
"chain_task_run(): dma_reload() host error, ret = %u", ret);
267+
"chain_task_run(): dma_reload() host error, ret = %d", ret);
268268
return SOF_TASK_STATE_COMPLETED;
269269
}
270270

@@ -274,7 +274,7 @@ static enum task_state chain_task_run(void *data)
274274
0, 0, half_buff_size);
275275
if (ret < 0) {
276276
tr_err(&chain_dma_tr, "chain_task_run(): dma_reload() "
277-
"link error, ret = %u", ret);
277+
"link error, ret = %d", ret);
278278
return SOF_TASK_STATE_COMPLETED;
279279
}
280280
}

0 commit comments

Comments
 (0)