- Change all conditional checks in "if" statement to boolean expressions
- Initialzie variables with too complex values outside the declaration
- Fix indentations
- Move code associated with sysctls to ena_sysctl.c file
- For consistency, remove unnecesary "return" from void functions
- Use if_getdrvflags() function instead of accesing variable directly
Details
Details
- Reviewers
byenduri_gmail.com rlibby mw - Commits
- rS325580: Refactor style of the ENA driver
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Most of these changes look to be in the right direction. I don't think evaluating if a bool == true or == false is necessary. In some places parentheses have been added which are not strictly needed, I don't feel strongly about those either way. I did not evaluate for completeness.
sys/dev/ena/ena.c | ||
---|---|---|
1430 ↗ | (On Diff #34523) | This one is not necessary, rss_support is already a bool. |
1433 ↗ | (On Diff #34523) | As above, frag is bool. |
1434 ↗ | (On Diff #34523) | style(9) discourages excess parentheses when the parsing is not confusing. I don't have a complaint if you prefer to parenthesize this, but FYI it is not required by style. |
1587–1598 ↗ | (On Diff #34523) | As above, l3_csum_err and l4_csum_err are already bools. |