From 9e4311d75588215f3316910c02c1ffad9d8cbdcd Mon Sep 17 00:00:00 2001 From: Cheng-Yang Chou Date: Thu, 10 Apr 2025 11:37:11 +0800 Subject: [PATCH] Fix formatting of unsigned int major Wrap the type and name in \cpp|...| for consistency with other parameters in the sentence. --- lkmpg.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lkmpg.tex b/lkmpg.tex index cbe9c577..0b99d918 100644 --- a/lkmpg.tex +++ b/lkmpg.tex @@ -1024,7 +1024,7 @@ \subsection{Registering A Device} int register_chrdev(unsigned int major, const char *name, struct file_operations *fops); \end{code} -Where unsigned int major is the major number you want to request, \cpp|const char *name| is the name of the device as it will appear in \verb|/proc/devices| and \cpp|struct file_operations *fops| is a pointer to the \cpp|file_operations| table for your driver. +Where \cpp|unsigned int major| is the major number you want to request, \cpp|const char *name| is the name of the device as it will appear in \verb|/proc/devices| and \cpp|struct file_operations *fops| is a pointer to the \cpp|file_operations| table for your driver. A negative return value means the registration failed. Note that we didn't pass the minor number to \cpp|register_chrdev|. That is because the kernel doesn't care about the minor number; only our driver uses it.