Compile time assert a valid subsystem for all VNET init and uninit functions.

Using VNET init and uninit functions outside the given range has undefined
behaviour.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2019-10-07 14:24:59 +00:00
parent 204e2f30d9
commit 4715738b12
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=353275

View File

@ -326,6 +326,8 @@ struct vnet_sysinit {
};
#define VNET_SYSINIT(ident, subsystem, order, func, arg) \
CTASSERT((subsystem) > SI_SUB_VNET && \
(subsystem) <= SI_SUB_VNET_DONE); \
static struct vnet_sysinit ident ## _vnet_init = { \
subsystem, \
order, \
@ -338,6 +340,8 @@ struct vnet_sysinit {
vnet_deregister_sysinit, &ident ## _vnet_init)
#define VNET_SYSUNINIT(ident, subsystem, order, func, arg) \
CTASSERT((subsystem) > SI_SUB_VNET && \
(subsystem) <= SI_SUB_VNET_DONE); \
static struct vnet_sysinit ident ## _vnet_uninit = { \
subsystem, \
order, \