Skip to content

lib-manager: fix lib id packing#10578

Open
wjablon1 wants to merge 1 commit intothesofproject:mainfrom
wjablon1:lib_id_fix
Open

lib-manager: fix lib id packing#10578
wjablon1 wants to merge 1 commit intothesofproject:mainfrom
wjablon1:lib_id_fix

Conversation

@wjablon1
Copy link
Contributor

@wjablon1 wjablon1 commented Feb 25, 2026

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?

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>
Copy link
Collaborator

@softwarecki softwarecki left a comment

Choose a reason for hiding this comment

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

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!

@wjablon1
Copy link
Contributor Author

wjablon1 commented Feb 25, 2026

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants