Page MenuHomeFreeBSD

hwpmc: style(9) pass of hwpmc_mod.c
AbandonedPublic

Authored by mhorne on May 26 2023, 6:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 4:05 AM
Unknown Object (File)
Tue, Nov 5, 5:41 AM
Unknown Object (File)
Oct 23 2024, 9:06 AM
Unknown Object (File)
Oct 10 2024, 10:12 PM
Unknown Object (File)
Sep 25 2024, 8:48 PM
Unknown Object (File)
Sep 25 2024, 4:26 PM
Unknown Object (File)
Sep 22 2024, 7:17 PM
Unknown Object (File)
Sep 21 2024, 9:36 PM
Subscribers

Details

Reviewers
jkoshy
emaste
gnn
Group Reviewers
pmc
Summary

Make it adhere more closely to the style conventions in the rest of the
kernel. Obviously, this diff is large, but the result it more legible in
many cases, IMO. I want to do this before some further refactoring.

Mainly the following:

  • Remove superfluous blank lines
  • return statement style
  • Explicit flag value checks
  • Eliminate some unnecessary type casts
  • Adjust variable declaration order
  • More liberal use of braces around loops and conditions
  • Indentation/whitespace

The change is not completely exhaustive, and some functions are
intentionally left alone as they will be modified or adjusted in
follow-up changes; notably, pmc_syscall_handler().

No functional change intended.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 51717
Build 48608: arc lint + arc unit

Event Timeline

sys/dev/hwpmc/hwpmc_mod.c
2043

this one not a purely style(9) change

Add few more tweaks. Remove the type changes.

mhorne added inline comments.
sys/dev/hwpmc/hwpmc_mod.c
2043

That was unintentional, and after skimming it over again I don't think there are other changes like that.

There are some stylistic choices I've made here that are outside of strict style(9) rules, but in general I've tried to avoid type changes, etc.

sys/dev/hwpmc/hwpmc_mod.c
2043

I am finding the change too large to review properly.

Do you think you could split it into smaller changes, e.g. one for the return statements, one for whitespace changes and so on?

Doing so should also help catch any inadvertent changes like the one above.

mhorne added inline comments.
sys/dev/hwpmc/hwpmc_mod.c
2043

Sure, I have done a rough split into a few separate reviews and tagged you for those. There is a couple instances of overlap between the diffs, but the purpose of each is much more focused now.

And thanks, I know it is a big ask to look at all of this stuff in detail, so just do what you can.

sys/dev/hwpmc/hwpmc_mod.c
2043

Thanks for splitting up this change into smaller ones. These have now been reviewed.

mhorne marked an inline comment as done.

Thanks for review, this landed in several commits, see D40513, D40514, D40515, D40516, and D40517.