lib-manager: fix lib id packing#10578
Open
wjablon1 wants to merge 1 commit intothesofproject:mainfrom
Open
Conversation
Function lib_manager_get_library_manifest expects a full module identifier consisting of library ID and module index packed together as a parameter. There are some incorrect calls to the function where only library index is provided. This change fixes those incorrect calls. Signed-off-by: Wojciech Jablonski <wojciech.jablonski@intel.com>
softwarecki
approved these changes
Feb 25, 2026
Collaborator
softwarecki
left a comment
There was a problem hiding this comment.
My intent was to have all functions accept a single module_id parameter. They extract whichever fields they need. I considered this clearer than splitting it into lib_id, mod_id, and mod_inst. The downside, as visible here, is that an incorrect value can be passed by mistake. Good catch!
Contributor
Author
|
@softwarecki It's hard for me to tell whether the interface itself is a problem. I made the same mistake in my pending changes only because I did copy-paste of the incorrect code. Maybe the situation would be different if I wrote my code from scratch. But the code looked fine at first glace. |
lgirdwood
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found this issue in lib_manager during testing. For now, I want to apply a simple fix to unblock my pending work because I don’t know yet how to remove this confusion from the lib_manager function interface that caused the mistake. On one hand the signature of lib_manager_get_library_manifest says clearly that the function takes module ID as a parameter (which is LIB_ID << 12 | MODULE_INDEX). On the other hand, I can understand how someone would expect a different behavior just by looking at the function name itself. We can change the argument type, but some functions in this file also take module_id encoded this way. Maybe we should group some functions related to a module in a separate C file?