Skip to content

cppcheck warnings with SOF_IPC4_INVALID_NODE_ID #4048

Closed

Description

@plbossart
sound/soc/sof/ipc4-pcm.c:568:5: style: Mismatching assignment and comparison, comparison 'node_id==0xffffffff' is always false. [assignIfError]
 if (node_id == SOF_IPC4_INVALID_NODE_ID)
    ^
sound/soc/sof/ipc4-pcm.c:567:10: note: Mismatching assignment and comparison, comparison 'node_id==0xffffffff' is always false.
 node_id = SOF_IPC4_NODE_INDEX(host_copier->data.gtw_cfg.node_id);
         ^
sound/soc/sof/ipc4-pcm.c:568:5: note: Mismatching assignment and comparison, comparison 'node_id==0xffffffff' is always false.
 if (node_id == SOF_IPC4_INVALID_NODE_ID)
    ^
ipc4-topology.h:#define SOF_IPC4_NODE_INDEX_MASK	0xFF
ipc4-topology.h:#define SOF_IPC4_NODE_INDEX(x)	((x) & SOF_IPC4_NODE_INDEX_MASK)

ipc4-topology.h:#define SOF_IPC4_INVALID_NODE_ID	0xffffffff

@RanderWang can you please take a look? The definitions don't match.

Should we use

 #define SOF_IPC4_INVALID_NODE_ID SOF_IPC4_NODE_INDEX_MASK

Activity

  1. RanderWang commented on Nov 30, 2022

    @RanderWang

    sure, I will check it

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions