gone_in9
Deprecation notice functions
Usage
#include <sys/systm.h>
void
gone_in(int major, const char *msg, ...);
void
gone_in_dev(device_t dev, int major, const char *msg, ...);
Overview
The gone_in functions are used to provide a notice that the kernel is actively using a driver or some other functionality that is deprecated, and is planned for removal in a future FreeBSD release. The notice is sent to the kernel dmesg(8) log and will appear on the console. The major argument specifies the major version of the FreeBSD release that will remove the deprecated functionality. The notice shall be printed only once, thus gone_in functions are safe to use in often executed code paths.
gone_in_dev will prepend driver name before the notice.
In releases before major the provided notice will be appended with“ To be removed in FreeBSDmajor”.
Examples
void
example_api(foo_t *args)
{
gone_in(16, "Warning! %s[%u] uses obsolete API. ",
curthread->td_proc->p_comm, curthread->td_proc->p_pid);
/* API implementation omitted. */
}
int
example_driver_attach(struct example_driver_softc *sc)
{
/* Attach code omitted. */
gone_in_dev(sc->dev, 16, "driver is deprecated");
}
Releases
15 releases since FreeBSD 12.4-RELEASE; the text changed 5 times.