Page MenuHomeFreeBSD

LinuxKPI: rework cleanup.h to use CLASS
Needs ReviewPublic

Authored by bz on Fri, Oct 2, 11:53 AM.
Tags
None
Referenced Files
F174632532: D60245.diff
Sun, Oct 4, 7:42 PM
Unknown Object (File)
Sat, Oct 3, 9:58 PM
Unknown Object (File)
Sat, Oct 3, 3:22 AM
Unknown Object (File)
Sat, Oct 3, 3:05 AM
Unknown Object (File)
Sat, Oct 3, 2:18 AM
Subscribers

Details

Reviewers
dumbbell
Group Reviewers
linuxkpi
Summary

After adding DEFINE_CLASS and CLASS in f2a2e02ae54b to cleanup.h
cleanup that file some from the original implementation:

  • Rename CLEANUP_NAME to LKPI_CLASS_NAME to (a) match the CLASS implementation idea and (b) tell it is an internal macro and not a LinuxKPI one.
  • consistently use LKPI_CLASS_NAME() rather than doing multiple ##.
  • consistently use _constructor and _destructor instead of _create and _destroy.
  • consistently use _name instead of _n and _type instead of _t; the latter helps a lot to keep the typedef _type LKPI_CLASS_NAME(_name, _t) apart.
  • With this the former DECLARE now matches CLASS so remove the former in favour of the latter.
  • With this DEFINE_GUARD() can now be implemented as a single [LINUXKPI_]DEFINE_CLASS() call.
  • In guard() and scoped_guard() start using UNIQUE_ID() which was added in 8b05d84be9e28 rather than manually using ## COUNTER__.

No functional changes intended.

Suggested in: D57583
MFC after: 3 days

Diff Detail

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