Skip to content

Commit fe4cf06

Browse files
committed
ipc4: helper: remove false warning
Function get_driver is once called just for checking if a component is already registered prior to registration. This leads to a false warning. This change fixes this by adding a separate function that does not issue the warning. Signed-off-by: Wojciech Jablonski <wojciech.jablonski@intel.com>
1 parent a32d983 commit fe4cf06

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

src/ipc/ipc4/helper.c

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,9 +1126,8 @@ int ipc4_process_on_core(uint32_t core, bool blocking)
11261126
return IPC4_SUCCESS;
11271127
}
11281128

1129-
__cold static const struct comp_driver *ipc4_get_drv(const void *uuid)
1129+
__cold static const struct comp_driver *ipc4_search_for_drv(const void *uuid)
11301130
{
1131-
const struct sof_uuid *const __maybe_unused sof_uuid = (const struct sof_uuid *)uuid;
11321131
struct comp_driver_list *drivers = comp_drivers_get();
11331132
struct list_item *clist;
11341133
const struct comp_driver *drv = NULL;
@@ -1149,21 +1148,29 @@ __cold static const struct comp_driver *ipc4_get_drv(const void *uuid)
11491148
info->drv->type,
11501149
info->drv->tctx->uuid_p);
11511150
drv = info->drv;
1152-
goto out;
1151+
break;
11531152
}
11541153
}
11551154

1156-
tr_warn(&comp_tr,
1157-
"the provided UUID (%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x) can't be found!",
1158-
sof_uuid->a, sof_uuid->b, sof_uuid->c, sof_uuid->d[0], sof_uuid->d[1],
1159-
sof_uuid->d[2], sof_uuid->d[3], sof_uuid->d[4], sof_uuid->d[5], sof_uuid->d[6],
1160-
sof_uuid->d[7]);
1161-
1162-
out:
11631155
irq_local_enable(flags);
11641156
return drv;
11651157
}
11661158

1159+
__cold static const struct comp_driver *ipc4_get_drv(const void *uuid)
1160+
{
1161+
const struct comp_driver *drv = ipc4_search_for_drv(uuid);
1162+
const struct sof_uuid *const __maybe_unused sof_uuid = (const struct sof_uuid *)uuid;
1163+
1164+
if (!drv)
1165+
tr_warn(&comp_tr,
1166+
"the provided UUID (%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x) "
1167+
"can't be found!", sof_uuid->a, sof_uuid->b, sof_uuid->c, sof_uuid->d[0],
1168+
sof_uuid->d[1], sof_uuid->d[2], sof_uuid->d[3], sof_uuid->d[4],
1169+
sof_uuid->d[5], sof_uuid->d[6], sof_uuid->d[7]);
1170+
1171+
return drv;
1172+
}
1173+
11671174
/*
11681175
* Called from
11691176
* - ipc4_get_large_config_module_instance()
@@ -1224,7 +1231,7 @@ __cold const struct comp_driver *ipc4_get_comp_drv(uint32_t module_id)
12241231
#endif
12251232
}
12261233
/* Check already registered components */
1227-
drv = ipc4_get_drv(&mod->uuid);
1234+
drv = ipc4_search_for_drv(&mod->uuid);
12281235

12291236
#if CONFIG_LIBRARY_MANAGER
12301237
if (!drv) {

0 commit comments

Comments
 (0)