Skip to content

Conversation

@RanderWang
Copy link

It should use full part of node_id to compare to SOF_IPC4_INVALID_NODE_ID, Also rename local variable node_id to node_index to make it more clear

fix #4048

ranj063
ranj063 previously approved these changes Nov 30, 2022
aiChaoSONG
aiChaoSONG previously approved these changes Nov 30, 2022
bardliao
bardliao previously approved these changes Nov 30, 2022
@RanderWang RanderWang mentioned this pull request Nov 30, 2022
jsarha
jsarha previously approved these changes Nov 30, 2022
Copy link

@jsarha jsarha left a comment

Choose a reason for hiding this comment

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

Looks good to me. Hope to have this merged soon to help me to merge #3953 (it does not work without it).

if (node_id == SOF_IPC4_INVALID_NODE_ID)
node_index = SOF_IPC4_NODE_INDEX(host_copier->data.gtw_cfg.node_id);
if (host_copier->data.gtw_cfg.node_id == SOF_IPC4_INVALID_NODE_ID)
return -EINVAL;
Copy link
Collaborator

Choose a reason for hiding this comment

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

it would be better to swap these to be easier to follow:

if (host_copier->data.gtw_cfg.node_id == SOF_IPC4_INVALID_NODE_ID)
		return -EINVAL;

node_index = SOF_IPC4_NODE_INDEX(host_copier->data.gtw_cfg.node_id);

Copy link
Author

@RanderWang RanderWang Nov 30, 2022

Choose a reason for hiding this comment

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

@ujfalusi I did it first in this way, but I found it resulted to great change in diff, so do it this way. Let's do it as your suggestion

Copy link
Collaborator

Choose a reason for hiding this comment

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

@RanderWang, thank you!

It should use full part of node_id to compare to SOF_IPC4_INVALID_NODE_ID,
Also rename local variable node_id to node_index to make it more clear

Signed-off-by: Rander Wang <rander.wang@intel.com>
if (node_id == SOF_IPC4_INVALID_NODE_ID)
node_index = SOF_IPC4_NODE_INDEX(host_copier->data.gtw_cfg.node_id);
if (host_copier->data.gtw_cfg.node_id == SOF_IPC4_INVALID_NODE_ID)
return -EINVAL;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@RanderWang, thank you!

Copy link

@jsarha jsarha left a comment

Choose a reason for hiding this comment

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

Even better than before. Please merge soon!

@plbossart plbossart merged commit 3869d8a into thesofproject:topic/sof-dev Nov 30, 2022
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.

cppcheck warnings with SOF_IPC4_INVALID_NODE_ID

7 participants