[bootlin/training-materials updates] master: kernel-dma: Clarify the file->private_data pointer (3548f1e1)
Miquel Raynal
miquel.raynal at bootlin.com
Thu Jul 27 19:59:53 CEST 2023
Repository : https://github.com/bootlin/training-materials
On branch : master
Link : https://github.com/bootlin/training-materials/commit/3548f1e163f4d5e60fd344d31bd54493e9467b4a
>---------------------------------------------------------------
commit 3548f1e163f4d5e60fd344d31bd54493e9467b4a
Author: Miquel Raynal <miquel.raynal at bootlin.com>
Date: Thu Jul 27 19:58:51 2023 +0200
kernel-dma: Clarify the file->private_data pointer
Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
>---------------------------------------------------------------
3548f1e163f4d5e60fd344d31bd54493e9467b4a
labs/kernel-serial-output/kernel-serial-output.tex | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/labs/kernel-serial-output/kernel-serial-output.tex b/labs/kernel-serial-output/kernel-serial-output.tex
index 24e27c5a..44876feb 100644
--- a/labs/kernel-serial-output/kernel-serial-output.tex
+++ b/labs/kernel-serial-output/kernel-serial-output.tex
@@ -119,8 +119,8 @@ pointer to the \code{serial_dev} structure. However, as the
the address of the parent structure:
\begin{verbatim}
-struct serial_dev *serial =
- container_of(file->private_data, struct serial_dev, miscdev);
+struct miscdevice *miscdev_ptr = file->private_data;
+struct serial_dev *serial = container_of(miscdev_ptr, struct serial_dev, miscdev);
\end{verbatim}
See \url{https://radek.io/2012/11/10/magical-container_of-macro/}
More information about the training-materials-updates
mailing list