From e551c98ddeb9d0d304dfd26d7345620ca2708d98 Mon Sep 17 00:00:00 2001 From: Jim Huang Date: Mon, 9 Aug 2021 22:05:08 +0800 Subject: [PATCH] Clarify kernel header inclusion Both and are essential headers, and LKM should include them. Here, we do not use the fully qualified path specifying the headers. --- lkmpg.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lkmpg.tex b/lkmpg.tex index a382cfa..9dc88db 100644 --- a/lkmpg.tex +++ b/lkmpg.tex @@ -269,9 +269,9 @@ However, many people still use \cpp|init_module()| and \cpp|cleanup_module()| fo Typically, \cpp|init_module()| either registers a handler for something with the kernel, or it replaces one of the kernel functions with its own code (usually code to do something and then call the original function). The \cpp|cleanup_module()| function is supposed to undo whatever \cpp|init_module()| did, so the module can be unloaded safely. -Lastly, every kernel module needs to include \verb|linux/module.h|. +Lastly, every kernel module needs to include \verb||. % TODO: adjust the section anchor -We needed to include \verb|linux/kernel.h| only for the macro expansion for the \cpp|pr_alert()| log level, which you'll learn about in Section \ref{sec:printk}. +We needed to include \verb|| only for the macro expansion for the \cpp|pr_alert()| log level, which you'll learn about in Section \ref{sec:printk}. \begin{enumerate} \item A point about coding style.