make buildkernel passes
Details
- Reviewers
glebius melifaro jhb - Group Reviewers
Src Committers - Commits
- rG33c670c373c0: netlink.h: Align macro declarations with tabs
rG5143d8c4434c: netlink: Use __align_up() instead of homegrown roundup2 macro
rG9df901c8f8c8: netlink: Pop NLMSG_ALIGNTO and NLMSG_ALIGN out of the #ifndef _KERNEL block
rGc7919fb92d20: netlink: Do not cast to int in NLMSG_HDRLEN and _NLMSG_LEN
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Some other cleanups to consider as separate commits: Just use the userspace version of NLMSG_ALIGNTO and NLMSG_ALIGN always (so move them above the #ifndef _KERNEL). Also, replace roundup2() with just using __align_up() from <sys/cdefs.h> unconditionally.
I'm also not convinced that NLMSG_HDRLEN isn't in practice the same for both userspace and the kernel.
sys/netlink/netlink.h | ||
---|---|---|
213 | sizeof() already returns a size_t, so you can just remove this cast instead | |
226 | I'm not sure you need this cast either |
I'm fine with doing all this at once, though you might want to update the log to mention using __align_up and reducing duplication, etc.
sys/netlink/netlink.h | ||
---|---|---|
226 | You can use tabs to align the macro value now while you are here. |
Let’s make sure that the constants /macro still has the same type as in Linux and check that, for example, net/bird2 compiles without additional warnings after this change