Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ipc/dma-copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static struct dma_sg_elem *sg_get_elem_at(struct dma_sg_config *host_sg,
}

/* host offset in beyond end of SG buffer */
tr_err(&dmacpy_tr, "sg_get_elem_at(): host offset in beyond end of SG buffer");
tr_err(&dmacpy_tr, "host offset in beyond end of SG buffer");
return NULL;
}
#endif
Expand Down Expand Up @@ -165,15 +165,15 @@ int dma_copy_new(struct dma_copy *dc)
cap = 0;
dc->dmac = dma_get(dir, cap, dev, DMA_ACCESS_SHARED);
if (!dc->dmac) {
tr_err(&dmacpy_tr, "dma_copy_new(): dc->dmac = NULL");
tr_err(&dmacpy_tr, "dc->dmac = NULL");
return -ENODEV;
}

#if !CONFIG_DMA_GW
/* get DMA channel from DMAC0 */
dc->chan = dma_channel_get_legacy(dc->dmac, CONFIG_TRACE_CHANNEL);
if (!dc->chan) {
tr_err(&dmacpy_tr, "dma_copy_new(): dc->chan is NULL");
tr_err(&dmacpy_tr, "dc->chan is NULL");
return -ENODEV;
}
#endif
Expand All @@ -186,7 +186,7 @@ int dma_copy_set_stream_tag(struct dma_copy *dc, uint32_t stream_tag)
/* get DMA channel from DMAC */
dc->chan = dma_channel_get_legacy(dc->dmac, stream_tag - 1);
if (!dc->chan) {
tr_err(&dmacpy_tr, "dma_copy_set_stream_tag(): dc->chan is NULL");
tr_err(&dmacpy_tr, "dc->chan is NULL");
return -EINVAL;
}

Expand Down
4 changes: 2 additions & 2 deletions src/ipc/ipc-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int ipc_process_on_core(uint32_t core, bool blocking)

/* check if requested core is enabled */
if (!cpu_is_core_enabled(core)) {
tr_err(&ipc_tr, "ipc_process_on_core(): core #%d is disabled", core);
tr_err(&ipc_tr, "core #%d is disabled", core);
return -EACCES;
}

Expand Down Expand Up @@ -290,7 +290,7 @@ __cold int ipc_init(struct sof *sof)
{
assert_can_be_cold();

tr_dbg(&ipc_tr, "ipc_init()");
tr_dbg(&ipc_tr, "");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty line comment makes no sense, for such cases let's put, say "function entry" there since usually that's where such calls show up


/* init ipc data */
sof->ipc = rzalloc(SOF_MEM_FLAG_USER | SOF_MEM_FLAG_COHERENT, sizeof(*sof->ipc));
Expand Down
12 changes: 6 additions & 6 deletions src/ipc/ipc-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int comp_verify_params(struct comp_dev *dev, uint32_t flag,
int dir = dev->direction;

if (!params) {
comp_err(dev, "comp_verify_params(): !params");
comp_err(dev, "!params");
return -EINVAL;
}

Expand Down Expand Up @@ -263,14 +263,14 @@ int ipc_pipeline_complete(struct ipc *ipc, uint32_t comp_id)
/* find the scheduling component */
icd = ipc_get_comp_by_id(ipc, p->sched_id);
if (!icd) {
tr_warn(&ipc_tr, "ipc_pipeline_complete(): no scheduling component specified, use comp 0x%x",
tr_warn(&ipc_tr, "no scheduling component specified, use comp 0x%x",
ipc_ppl_sink->id);

icd = ipc_ppl_sink;
}

if (icd->core != ipc_pipe->core) {
tr_err(&ipc_tr, "ipc_pipeline_complete(): icd->core (%d) != ipc_pipe->core (%d) for pipeline scheduling component icd->id 0x%x",
tr_err(&ipc_tr, "icd->core (%d) != ipc_pipe->core (%d) for pipeline scheduling component icd->id 0x%x",
icd->core, ipc_pipe->core, icd->id);
return -EINVAL;
}
Expand Down Expand Up @@ -298,7 +298,7 @@ __cold int ipc_comp_free(struct ipc *ipc, uint32_t comp_id)
/* check whether component exists */
icd = ipc_get_comp_by_id(ipc, comp_id);
if (!icd) {
tr_err(&ipc_tr, "ipc_comp_free(): comp id: 0x%x is not found",
tr_err(&ipc_tr, "comp id: 0x%x is not found",
comp_id);
return -ENODEV;
}
Expand All @@ -309,7 +309,7 @@ __cold int ipc_comp_free(struct ipc *ipc, uint32_t comp_id)

/* check state */
if (icd->cd->state != COMP_STATE_READY) {
tr_err(&ipc_tr, "ipc_comp_free(): comp id: 0x%x state is %d cannot be freed",
tr_err(&ipc_tr, "comp id: 0x%x state is %d cannot be freed",
comp_id, icd->cd->state);
return -EINVAL;
}
Expand All @@ -328,7 +328,7 @@ __cold int ipc_comp_free(struct ipc *ipc, uint32_t comp_id)
* leak on error. Bug-free host drivers won't do
* this, this was found via fuzzing.
*/
tr_err(&ipc_tr, "ipc_comp_free(): uninitialized buffer lists on comp 0x%x\n",
tr_err(&ipc_tr, "uninitialized buffer lists on comp 0x%x\n",
icd->id);
return -EINVAL;
}
Expand Down
20 changes: 10 additions & 10 deletions src/ipc/ipc3/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int dai_config_dma_channel(struct dai_data *dd, struct comp_dev *dev, const void
break;
default:
/* other types of DAIs not handled for now */
comp_err(dev, "dai_config_dma_channel(): Unknown dai type %d",
comp_err(dev, "Unknown dai type %d",
config->type);
channel = SOF_DMA_CHAN_INVALID;
break;
Expand All @@ -119,7 +119,7 @@ int ipc_dai_data_config(struct dai_data *dd, struct comp_dev *dev)
struct sof_ipc_dai_config *config = ipc_from_dai_config(dd->dai_spec_config);

if (!config) {
comp_err(dev, "dai_data_config(): no config set for dai %d type %d",
comp_err(dev, "no config set for dai %d type %d",
dai->dai_index, dai->type);
return -EINVAL;
}
Expand All @@ -129,14 +129,14 @@ int ipc_dai_data_config(struct dai_data *dd, struct comp_dev *dev)

/* cannot configure DAI while active */
if (dev->state == COMP_STATE_ACTIVE) {
comp_info(dev, "dai_data_config(): Component is in active state.");
comp_info(dev, "Component is in active state.");
return 0;
}

/* validate direction */
if (dai->direction != SOF_IPC_STREAM_PLAYBACK &&
dai->direction != SOF_IPC_STREAM_CAPTURE) {
comp_err(dev, "dai_data_config(): no direction set for dai %d type %d",
comp_err(dev, "no direction set for dai %d type %d",
dai->dai_index, dai->type);
return -EINVAL;
}
Expand Down Expand Up @@ -195,7 +195,7 @@ int ipc_dai_data_config(struct dai_data *dd, struct comp_dev *dev)
break;
default:
/* other types of DAIs not handled for now */
comp_warn(dev, "dai_data_config(): Unknown dai type %d",
comp_warn(dev, "Unknown dai type %d",
config->type);
break;
}
Expand Down Expand Up @@ -241,7 +241,7 @@ int ipc_comp_dai_config(struct ipc *ipc, struct ipc_config_dai *common_config,
}

if (ret < 0) {
tr_err(&ipc_tr, "ipc_comp_dai_config(): comp_dai_config() failed");
tr_err(&ipc_tr, "comp_dai_config() failed");
return ret;
}

Expand Down Expand Up @@ -281,7 +281,7 @@ void dai_dma_release(struct dai_data *dd, struct comp_dev *dev)
{
/* cannot configure DAI while active */
if (dev->state == COMP_STATE_ACTIVE) {
comp_info(dev, "dai_config(): Component is in active state. Ignore resetting");
comp_info(dev, "Component is in active state. Ignore resetting");
return;
}

Expand Down Expand Up @@ -315,7 +315,7 @@ int dai_config(struct dai_data *dd, struct comp_dev *dev, struct ipc_config_dai

/* cannot configure DAI while active */
if (dev->state == COMP_STATE_ACTIVE) {
comp_info(dev, "dai_config(): Component is in active state. Ignore config");
comp_info(dev, "Component is in active state. Ignore config");
return 0;
}

Expand All @@ -328,7 +328,7 @@ int dai_config(struct dai_data *dd, struct comp_dev *dev, struct ipc_config_dai
dd->delayed_dma_stop = true;

if (dd->chan) {
comp_info(dev, "dai_config(): Configured. dma channel index %d, ignore...",
comp_info(dev, "Configured. dma channel index %d, ignore...",
dd->chan->index);
return 0;
}
Expand Down Expand Up @@ -379,7 +379,7 @@ int dai_config(struct dai_data *dd, struct comp_dev *dev, struct ipc_config_dai
dd->dai_spec_config = rzalloc(SOF_MEM_FLAG_USER | SOF_MEM_FLAG_COHERENT,
sizeof(struct sof_ipc_dai_config));
if (!dd->dai_spec_config) {
comp_err(dev, "dai_config(): No memory for dai_config.");
comp_err(dev, "No memory for dai_config.");
return -ENOMEM;
}
}
Expand Down
40 changes: 20 additions & 20 deletions src/ipc/ipc3/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,10 +996,10 @@ static inline int ipc_probe_init(uint32_t header)
struct sof_ipc_probe_dma_add_params *params = ipc_get()->comp_data;
int dma_provided = params->num_elems;

tr_dbg(&ipc_tr, "ipc_probe_init()");
tr_dbg(&ipc_tr, "");

if (dma_provided > 1 || dma_provided < 0) {
ipc_cmd_err(&ipc_tr, "ipc_probe_init(): Invalid amount of extraction DMAs specified = %d",
ipc_cmd_err(&ipc_tr, "Invalid amount of extraction DMAs specified = %d",
dma_provided);
return -EINVAL;
}
Expand All @@ -1009,7 +1009,7 @@ static inline int ipc_probe_init(uint32_t header)

static inline int ipc_probe_deinit(uint32_t header)
{
tr_dbg(&ipc_tr, "ipc_probe_deinit()");
tr_dbg(&ipc_tr, "");

return probe_deinit();
}
Expand All @@ -1019,17 +1019,17 @@ static inline int ipc_probe_dma_add(uint32_t header)
struct sof_ipc_probe_dma_add_params *params = ipc_get()->comp_data;
int dmas_count = params->num_elems;

tr_dbg(&ipc_tr, "ipc_probe_dma_add()");
tr_dbg(&ipc_tr, "");

if (dmas_count > CONFIG_PROBE_DMA_MAX) {
ipc_cmd_err(&ipc_tr, "ipc_probe_dma_add(): Invalid amount of injection DMAs specified = %d. Max is "
ipc_cmd_err(&ipc_tr, "Invalid amount of injection DMAs specified = %d. Max is "
STRINGIFY(CONFIG_PROBE_DMA_MAX) ".",
dmas_count);
return -EINVAL;
}

if (dmas_count <= 0) {
ipc_cmd_err(&ipc_tr, "ipc_probe_dma_add(): Inferred amount of incjection DMAs in payload is %d. This could indicate corrupt size reported in header or invalid IPC payload.",
ipc_cmd_err(&ipc_tr, "Inferred amount of incjection DMAs in payload is %d. This could indicate corrupt size reported in header or invalid IPC payload.",
dmas_count);
return -EINVAL;
}
Expand All @@ -1042,17 +1042,17 @@ static inline int ipc_probe_dma_remove(uint32_t header)
struct sof_ipc_probe_dma_remove_params *params = ipc_get()->comp_data;
int tags_count = params->num_elems;

tr_dbg(&ipc_tr, "ipc_probe_dma_remove()");
tr_dbg(&ipc_tr, "");

if (tags_count > CONFIG_PROBE_DMA_MAX) {
ipc_cmd_err(&ipc_tr, "ipc_probe_dma_remove(): Invalid amount of injection DMAs specified = %d. Max is "
ipc_cmd_err(&ipc_tr, "Invalid amount of injection DMAs specified = %d. Max is "
STRINGIFY(CONFIG_PROBE_DMA_MAX) ".",
tags_count);
return -EINVAL;
}

if (tags_count <= 0) {
ipc_cmd_err(&ipc_tr, "ipc_probe_dma_remove(): Inferred amount of incjection DMAs in payload is %d. This could indicate corrupt size reported in header or invalid IPC payload.",
ipc_cmd_err(&ipc_tr, "Inferred amount of incjection DMAs in payload is %d. This could indicate corrupt size reported in header or invalid IPC payload.",
tags_count);
return -EINVAL;
}
Expand All @@ -1065,17 +1065,17 @@ static inline int ipc_probe_point_add(uint32_t header)
struct sof_ipc_probe_point_add_params *params = ipc_get()->comp_data;
int probes_count = params->num_elems;

tr_dbg(&ipc_tr, "ipc_probe_point_add()");
tr_dbg(&ipc_tr, "");

if (probes_count > CONFIG_PROBE_POINTS_MAX) {
ipc_cmd_err(&ipc_tr, "ipc_probe_point_add(): Invalid amount of Probe Points specified = %d. Max is "
ipc_cmd_err(&ipc_tr, "Invalid amount of Probe Points specified = %d. Max is "
STRINGIFY(CONFIG_PROBE_POINT_MAX) ".",
probes_count);
return -EINVAL;
}

if (probes_count <= 0) {
ipc_cmd_err(&ipc_tr, "ipc_probe_point_add(): Inferred amount of Probe Points in payload is %d. This could indicate corrupt size reported in header or invalid IPC payload.",
ipc_cmd_err(&ipc_tr, "Inferred amount of Probe Points in payload is %d. This could indicate corrupt size reported in header or invalid IPC payload.",
probes_count);
return -EINVAL;
}
Expand All @@ -1088,17 +1088,17 @@ static inline int ipc_probe_point_remove(uint32_t header)
struct sof_ipc_probe_point_remove_params *params = ipc_get()->comp_data;
int probes_count = params->num_elems;

tr_dbg(&ipc_tr, "ipc_probe_point_remove()");
tr_dbg(&ipc_tr, "");

if (probes_count > CONFIG_PROBE_POINTS_MAX) {
ipc_cmd_err(&ipc_tr, "ipc_probe_point_remove(): Invalid amount of Probe Points specified = %d. Max is "
ipc_cmd_err(&ipc_tr, "Invalid amount of Probe Points specified = %d. Max is "
STRINGIFY(CONFIG_PROBE_POINT_MAX) ".",
probes_count);
return -EINVAL;
}

if (probes_count <= 0) {
ipc_cmd_err(&ipc_tr, "ipc_probe_point_remove(): Inferred amount of Probe Points in payload is %d. This could indicate corrupt size reported in header or invalid IPC payload.",
ipc_cmd_err(&ipc_tr, "Inferred amount of Probe Points in payload is %d. This could indicate corrupt size reported in header or invalid IPC payload.",
probes_count);
return -EINVAL;
}
Expand All @@ -1111,7 +1111,7 @@ static int ipc_probe_info(uint32_t header)
struct sof_ipc_probe_info_params *params = ipc_get()->comp_data;
int ret;

tr_dbg(&ipc_tr, "ipc_probe_get_data()");
tr_dbg(&ipc_tr, "");

switch (cmd) {
case SOF_IPC_PROBE_DMA_INFO:
Expand All @@ -1121,13 +1121,13 @@ static int ipc_probe_info(uint32_t header)
ret = probe_point_info(params, SOF_IPC_MSG_MAX_SIZE);
break;
default:
ipc_cmd_err(&ipc_tr, "ipc_probe_info(): Invalid probe INFO command = %u",
ipc_cmd_err(&ipc_tr, "Invalid probe INFO command = %u",
cmd);
ret = -EINVAL;
}

if (ret < 0) {
ipc_cmd_err(&ipc_tr, "ipc_probe_info(): cmd %u failed", cmd);
ipc_cmd_err(&ipc_tr, "cmd %u failed", cmd);
return ret;
}

Expand All @@ -1138,7 +1138,7 @@ static int ipc_probe_info(uint32_t header)
mailbox_hostbox_write(0, params, params->rhdr.hdr.size);
ret = 1;
} else {
ipc_cmd_err(&ipc_tr, "ipc_probe_get_data(): probes module returned too much payload for cmd %u - returned %d bytes, max %d",
ipc_cmd_err(&ipc_tr, "probes module returned too much payload for cmd %u - returned %d bytes, max %d",
cmd, params->rhdr.hdr.size,
MIN(MAILBOX_HOSTBOX_SIZE, SOF_IPC_MSG_MAX_SIZE));
ret = -EINVAL;
Expand Down Expand Up @@ -1177,7 +1177,7 @@ static int ipc_glb_probe(uint32_t header)
#else
static inline int ipc_glb_probe(uint32_t header)
{
ipc_cmd_err(&ipc_tr, "ipc_glb_probe(): Probes not enabled by Kconfig.");
ipc_cmd_err(&ipc_tr, "Probes not enabled by Kconfig.");

return -EINVAL;
}
Expand Down
Loading