Skip to content

Commit

Permalink
lib-manager: don't cast away "const"
Browse files Browse the repository at this point in the history
Don't type-cast pointers to "const" objects to writable pointers even
temporarily. This is error-prone and might cause future compiler
warnings.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
  • Loading branch information
lyakh committed Mar 3, 2025
1 parent 87fef1b commit 66d6108
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/library_manager/lib_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,9 @@ int lib_manager_register_module(const uint32_t component_id)
goto cleanup;
}

mod = (struct sof_man_module *)((const uint8_t *)desc + SOF_MAN_MODULE_OFFSET(entry_index));
const struct sof_uuid *uid = (struct sof_uuid *)&mod->uuid;
mod = (const struct sof_man_module *)((const uint8_t *)desc +
SOF_MAN_MODULE_OFFSET(entry_index));
const struct sof_uuid *uid = (const struct sof_uuid *)&mod->uuid;

lib_manager_prepare_module_adapter(drv, uid);

Expand Down

0 comments on commit 66d6108

Please sign in to comment.