Skip to content

Conversation

@RanderWang
Copy link
Collaborator

@RanderWang RanderWang commented Dec 12, 2023

We need to build params based on module base config first then we can verify it since the income params is built for the source of the this module . In comp_verify_params the params is applied to buffer so the sequence is vital. And also remove redundant stream_param set.

We need to build params based on module base config first then we can
verify it since the income params is built for the source of the this
module. In comp_verify_params the params is applied to buffer so the
sequence is vital. And also remove redundant stream_param set.

Signed-off-by: Rander Wang <rander.wang@intel.com>
int ret;
struct processing_module *mod = comp_get_drvdata(dev);

module_adapter_set_params(mod, params);
Copy link
Collaborator

Choose a reason for hiding this comment

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

while at it you can also replace rzalloc() with rmalloc() in line 596 because the memory is completely overwritten, and also we can check the size and if it's the same, avoid re-allocation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good idea. I will submit another PR.

Copy link
Contributor

@btian1 btian1 left a comment

Choose a reason for hiding this comment

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

" the this module" something wrong with this in commit message.

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

@RanderWang The commit message is hard to read. My immediate reaction is that if the order is wrong, how has this worked before this commit?

I won't block as others seem to have understood this better, but in future commits, please expand (in the commit message) what problem the patch is solving. And if it's something obvious (like here, we verify before parameter object is ready), reviewers (and people later maintaining the code) would really appreciate an explanation how did this work despite the flaw.

@kv2019i kv2019i merged commit c3ba7e4 into thesofproject:main Dec 13, 2023
@dbaluta
Copy link
Collaborator

dbaluta commented Dec 13, 2023

@kv2019i agree with you, commit messages should explain WHY the change is needed and how in this specific case it worked before.

I Acked this patch only because on IPC3 this patch is a NO-OP and assumed that IPC4-gang reviewed for that case.

@RanderWang
Copy link
Collaborator Author

RanderWang commented Dec 14, 2023

@RanderWang The commit message is hard to read. My immediate reaction is that if the order is wrong, how has this worked before this commit?

This is a general solution and all the build-in modules do it by themself. Loadable module will use this general solution.

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.

7 participants