wg: More style cleanups and minor updates to if_wg.c
commit359ddb36f15f52006ff841b1779737b6ac042d0b
authorAaron LI <aly@aaronly.me>
Fri, 29 Dec 2023 14:42:49 +0000 (29 22:42 +0800)
committerAaron LI <aly@aaronly.me>
Thu, 8 Feb 2024 06:44:46 +0000 (8 14:44 +0800)
treecc743d7c43aa6cdb9956802c4c726b4d19e78a90
parenta7f975c01da5c41d9b0df084cad48f2eb36457d8
wg: More style cleanups and minor updates to if_wg.c

- Clean up header inclusions.
- Add 'WG_PKT_WITH_PADDING()' and 'WG_PKT_DATA_MINLEN' macros to help
  simplify some code.
- Remove unnecessary assignments that are already ensured by
  kmalloc(M_ZERO).
- Rename some variables for consistency.
- Use 'int' instead of 'u_int' for cpu, in consistent with 'ncpus'.
- Use 'memcmp()' instead of 'bmcp()' for consistent with other parts.
- Remove the KKASSERT() of lock assertion from 'wg_aip_remove()', as
  it's quite obvious and thus unnecessary.
- Various style adjustments and cleanups.
sys/net/wg/if_wg.c