mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-13 20:12:26 +00:00
GitHub converts differently than asciidoctor... the only way to keep them consistent is to explicitly set IDs.
22 lines
367 B
C
22 lines
367 B
C
/* https://cirosantilli.com/linux-kernel-module-cheat#warn-on */
|
|
|
|
#include <linux/module.h>
|
|
#include <linux/kernel.h>
|
|
|
|
static int myinit(void)
|
|
{
|
|
pr_info("warn_on init\n");
|
|
WARN_ON("warn_on do it");
|
|
pr_info("warn_on after\n");
|
|
return 0;
|
|
}
|
|
|
|
static void myexit(void)
|
|
{
|
|
pr_info("warn_on cleanup\n");
|
|
}
|
|
|
|
module_init(myinit)
|
|
module_exit(myexit)
|
|
MODULE_LICENSE("GPL");
|