This makes KOBJOPLOOKUP() rather more suitable for purposes outside
the macros generated by makeobjops.awk. Of note other callers can
lookup the function on their parent class and call that explicitly.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 61649 Build 58533: arc lint + arc unit
Event Timeline
The change seems fine at a glance, but I'm not very familiar with this code.
For the commit description: I'm not convinced the conversion to compound expressions is the interesting point. IMO that's just the implementation. It's changing the API from assigning to a tkobjop_t _m internally to returning an <OP>_t that's interesting.
sys/sys/kobj.h | ||
---|---|---|
223 | IIRC we need to spell it __extension__ ({ to avoid breaking... something. |
sys/sys/kobj.h | ||
---|---|---|
223 | Eh, we don't include that in other places (at least it's not something I'm aware of) |
sys/sys/kobj.h | ||
---|---|---|
223 | 49 uses in sys/; I suspect it's only a requirement for the userland warning set, but it'd be nice to be consistent. |
Updating as per current comments, add extension, minor title adjustment. Remove a now unnecessary cast from makeobjsops.awk's output.
One more comment and possible adjustment. I don't like the KOBJOPLOOKUP name. I think the original author was thinking (KOBJOP)(LOOKUP), but I believe the more common parsing is (KOBJ)(OP)(LOOKUP). KOBJLOOKUPOP or KOBJLOOKUP seem better since the is it is looking up an OP (function pointer) on a KOBJ, not looking up a KOBJOP in some global table.
I didn't find any uses of KOBJOPLOOKUP other than those generated by makeobjsop.awk, but there could be some outside the FreeBSD repository. I'm also unsure whether KOBJOPLOOKUP() is meant strictly for makeobjsops.awk files, versus simply being an undocumented useful macro.