Skip to content

Conversation

@jsarha
Copy link
Contributor

@jsarha jsarha commented Oct 20, 2025

Rewrite misleading copy-pasted comment and remove unnecessary container removals from res->res_list and res->cont_chunk_list. All the containers are anyway freed when the container chunks are freed and the list heads are reinitialized when mod_resource_init() is called.

Rewrite misleading copy-pasted comment and remove unnecessary
container removals from res->res_list and res->cont_chunk_list. All
the containers are anyway freed when the container chunks are freed
and the list heads are reinitialized when mod_resource_init() is
called.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Copilot AI review requested due to automatic review settings October 20, 2025 22:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes the mod_free_all() function by removing redundant list item deletions and updating a misleading comment. The optimization is based on the observation that all containers are freed when their container chunks are freed, making individual list item removals unnecessary.

Key changes:

  • Replaced misleading comment about finding memory containers with accurate description of freeing container contents
  • Removed unnecessary list_item_del() calls from the res_list iteration
  • Removed entire iteration over free_cont_list as it only performed unnecessary list deletions
  • Added explanatory comment documenting why container removal operations are not needed

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

LGTM

@lgirdwood lgirdwood merged commit 9c15ccb into thesofproject:main Nov 3, 2025
39 of 45 checks passed
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.

4 participants