Reference

gone_in(9)

deprecation notice functions

NAME

gone_in, gone_in_dev – deprecation notice functions

SYNOPSIS

#include <sys/systm.h>

void

gone_in(int major, const char *msg, ...);

void

gone_in_dev(device_t dev, int major, const char *msg, ...);

DESCRIPTION

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");
}

HISTORY

The gone_in functions first appeared in FreeBSD 11.

History