[bootlin/training-materials updates] master: kernel-serial-output: Clarify the use of the counter (158470b4)

Miquel Raynal miquel.raynal at bootlin.com
Fri Sep 17 18:57:54 CEST 2021

Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/158470b4cf0c19ac02d93b66b1be1cc43dc216bb


commit 158470b4cf0c19ac02d93b66b1be1cc43dc216bb
Author: Miquel Raynal <miquel.raynal at bootlin.com>
Date:   Fri Sep 17 18:50:07 2021 +0200

    kernel-serial-output: Clarify the use of the counter
    Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>


 labs/kernel-serial-interrupt/kernel-serial-interrupt.tex | 1 +
 labs/kernel-serial-output/kernel-serial-output.tex       | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/labs/kernel-serial-interrupt/kernel-serial-interrupt.tex b/labs/kernel-serial-interrupt/kernel-serial-interrupt.tex
index 8811e8e9..1138ea48 100644
--- a/labs/kernel-serial-interrupt/kernel-serial-interrupt.tex
+++ b/labs/kernel-serial-interrupt/kernel-serial-interrupt.tex
@@ -98,6 +98,7 @@ we can read from:
 struct serial_dev {
         void __iomem *regs;
         struct miscdevice miscdev;
+        unsigned int counter
         char buf[SERIAL_BUFSIZE];
         unsigned int buf_rd;
         unsigned int buf_wr;
diff --git a/labs/kernel-serial-output/kernel-serial-output.tex b/labs/kernel-serial-output/kernel-serial-output.tex
index 9503c87f..44917b03 100644
--- a/labs/kernel-serial-output/kernel-serial-output.tex
+++ b/labs/kernel-serial-output/kernel-serial-output.tex
@@ -189,8 +189,10 @@ application that uses the UART.
 \section{Ioctl operations}
 We would like to maintain a count of the number of characters
-written through the serial port. So we need to implement two
-\code{unlocked_ioctl()} operations:
+written through the serial port. In order to do this, register a counter
+variable in the main driver structure, and increment it when
+appropriate. Then, we need to implement two \code{unlocked_ioctl()}
  \item \code{SERIAL_RESET_COUNTER}, which as its name says, will

More information about the training-materials-updates mailing list