Skip to content

Commit e551c98

Browse files
committed
Clarify kernel header inclusion
Both <linux/module.h> and <linux/kernel.h> are essential headers, and LKM should include them. Here, we do not use the fully qualified path specifying the headers.
1 parent 251adeb commit e551c98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lkmpg.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ \subsection{The Simplest Module}
269269
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).
270270
The \cpp|cleanup_module()| function is supposed to undo whatever \cpp|init_module()| did, so the module can be unloaded safely.
271271

272-
Lastly, every kernel module needs to include \verb|linux/module.h|.
272+
Lastly, every kernel module needs to include \verb|<linux/module.h>|.
273273
% TODO: adjust the section anchor
274-
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}.
274+
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}.
275275

276276
\begin{enumerate}
277277
\item A point about coding style.

0 commit comments

Comments
 (0)