Skip to content

Conversation

@nashif
Copy link
Member

@nashif nashif commented May 9, 2025

Add missing curly braces in if/while/for statements.

This is a style guideline we have that was not enforced in CI. All
issues fixed here were detected by sonarqube SCA.

Signed-off-by: Anas Nashif anas.nashif@intel.com

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 9, 2025

ARC_CLN_CACHE_CMD_OP_REG_INV | ARC_CLN_CACHE_CMD_INCR);
while (arc_cln_read_reg_nolock(ARC_CLN_CACHE_STATUS) & ARC_CLN_CACHE_STATUS_BUSY)
while (arc_cln_read_reg_nolock(ARC_CLN_CACHE_STATUS) & ARC_CLN_CACHE_STATUS_BUSY) {
;
Copy link
Member

@henrikbrixandersen henrikbrixandersen May 9, 2025

Choose a reason for hiding this comment

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

Do we allow these empty statements (;)? SonarQube flags them for removal. I'd prefer either empty braces (or otherwise empty braces with a comment in them) or terminating the loop as while (...);

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, just noticed that, will deal with it. Thanks.

Add missing curly braces in if/while/for statements.

This is a style guideline we have that was not enforced in CI. All
issues fixed here were detected by sonarqube SCA.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Copy link
Member

@ruuddw ruuddw left a comment

Choose a reason for hiding this comment

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

SonarQube or some agent may be better in reviewing this than me, but looks good to me :-)

chan_data = &dev_data->chan[channel];

if (!size)
if (!size) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, as existing: as you're already changing the line, consider changing it to "size == 0" to make it clear that size isn't a boolean.

@kartben kartben merged commit 2aacbca into zephyrproject-rtos:main May 17, 2025
30 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.

6 participants