-
Notifications
You must be signed in to change notification settings - Fork 8.4k
style: add missing curly braces in if/while/for statements. #89735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
arch/arc/core/prep_c.c
Outdated
| 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) { | ||
| ; |
There was a problem hiding this comment.
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 (...);
There was a problem hiding this comment.
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>
ruuddw
left a comment
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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.



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