Skip to content

uplink: convert 'flags' to array - #99

Merged
mniestroj merged 1 commit into
mainfrom
uplink-atomic
Oct 14, 2025
Merged

uplink: convert 'flags' to array#99
mniestroj merged 1 commit into
mainfrom
uplink-atomic

Conversation

@mniestroj

Copy link
Copy Markdown
Collaborator

Treat 'flags' as array of bits, so that Coverity does not complain about
singleton use with atomic_*_bit() API usage.

Treat 'flags' as array of bits, so that Coverity does not complain about
singleton use with atomic_*_bit() API usage.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
@mniestroj
mniestroj requested review from sam-golioth and trond-snekvik and removed request for sam-golioth October 14, 2025 15:00

@sam-golioth sam-golioth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @mniestroj! One non-blocking comment.

Comment thread gateway/src/uplink.c
struct gateway_uplink *session;
uint32_t block_idx;
atomic_t flags;
atomic_t flags[1];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We could also use the ATOMIC_DEFINE() macro here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good suggestion. Not sure we want to do that already, since we will likely end up with less than 10 flags anyway. So I don't want to overcomplicate definition.

@mniestroj
mniestroj merged commit 81fdb3f into main Oct 14, 2025
9 checks passed
@mniestroj
mniestroj deleted the uplink-atomic branch October 14, 2025 18:00
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.

2 participants