Page MenuHomeFreeBSD

tools/* : use nitems instead of local N(a)/ARRAY_SIZE(a) definitions, fix some clang warnings
ClosedPublic

Authored by avos on Aug 20 2015, 5:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 16 2024, 2:26 AM
Unknown Object (File)
Jan 5 2024, 9:33 PM
Unknown Object (File)
Jan 5 2024, 9:33 PM
Unknown Object (File)
Jan 5 2024, 9:33 PM
Unknown Object (File)
Jan 5 2024, 9:33 PM
Unknown Object (File)
Jan 5 2024, 9:08 PM
Unknown Object (File)
Dec 27 2023, 10:01 AM
Unknown Object (File)
Dec 27 2023, 9:59 AM
Subscribers

Details

Summary
  • Replace N(a)/N(i)/N(T)/LEN(a)/ARRAY_SIZE(a) with nitems()
  • Add missing <err.h> for err() and <sys/sysctl.h> for sysctlbyname()
  • NULL -> 0 for 5th parameter of sysctlbyname()
  • Fix printf() in tools/tools/ath/ath_ee_v4k_print/v4k.c

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avos retitled this revision from to tools/* : use nitems instead of local N(a)/ARRAY_SIZE(a) definitions, fix some clang warnings.
avos updated this object.
avos edited the test plan for this revision. (Show Details)
avos set the repository for this revision to rS FreeBSD src repository - subversion.
eadler added a subscriber: eadler.

I added some people that might be interested. Feel free to add change the reviewers.

rodrigc edited edge metadata.

I'm mostly OK with this change. There was one change in tools/tools/ath/ath_ee_v4k_print/v4k.c (see above), that I don't understand.

Also, in a few files, you added an include for err.h. It's not a big deal, but any particular reason for that?

tools/tools/ath/ath_ee_v4k_print/v4k.c
131 ↗(On Diff #8090)

Why is this change needed?

Please replace sys/types.h with sys/param.h if the source file already has sys/types.h #include'd in it

tools/tools/ath/ath_ee_v4k_print/v4k.c
131 ↗(On Diff #8090)

Agreed. This seems unnecessary

tools/tools/crypto/hifnstats.c
28–30 ↗(On Diff #8090)

Please sort.

tools/tools/mwl/mwlstats/mwlstats.c
37 ↗(On Diff #8090)
  1. Please sort.
  2. Please replace sys/types.h with sys/param.h
avos edited edge metadata.
  • Sort includes according to style(9)
avos marked 2 inline comments as done.Aug 26 2015, 9:23 PM

Also, in a few files, you added an include for err.h. It's not a big deal, but any particular reason for that?

I have added it where clang warns about "implicit declaration of function 'err'".

tools/tools/ath/ath_ee_v4k_print/v4k.c
132 ↗(On Diff #8230)

Size of this array was changed in r220589 (possibly, new fields from this revision should be added instead?)

tools/tools/ath/ath_ee_v4k_print/v4k.c
132 ↗(On Diff #8230)

I'm OK with everything in this patch except for this part.
I will commit everything else in this patch. Thanks for submitting!

Every other part of this patch is simple, and straightforward, while this
is a bit more involved because it involves logic in the code.

For this part of the patch, can you submit it as a separate review?
It is a bit more involved (slightly) since it involves logic in the code.
@adrian can you look at this part of the patch and provide feedback?

This revision was automatically updated to reflect the committed changes.

I committed everything in this patch except for the tools/tools/ath/ath_ee_v4k_print/v4k.c print changes.
Need someone who knows the code to comment on that.