Fix incorrect ioctl number field description#380
Open
ga13234624 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="lkmpg.tex">
<violation number="1" location="lkmpg.tex:1826">
P2: The sentence still incorrectly says the ioctl number encodes "the type of the parameter." The numeric ioctl value actually encodes the SIZE of the parameter (via `sizeof`), not the C type itself. Change "type of the parameter" to "size of the parameter" to match what the `_IO`/`_IOR`/`_IOW`/`_IOWR` macros actually encode.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| You can see there is an argument called \cpp|cmd| in \cpp|test_ioctl_ioctl()| function. | ||
| It is the ioctl number. | ||
| The ioctl number encodes the major device number, the type of the ioctl, the command, and the type of the parameter. | ||
| The ioctl number encodes the direction of data transfer, the type of the ioctl, the command, and the type of the parameter. |
There was a problem hiding this comment.
P2: The sentence still incorrectly says the ioctl number encodes "the type of the parameter." The numeric ioctl value actually encodes the SIZE of the parameter (via sizeof), not the C type itself. Change "type of the parameter" to "size of the parameter" to match what the _IO/_IOR/_IOW/_IOWR macros actually encode.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At lkmpg.tex, line 1826:
<comment>The sentence still incorrectly says the ioctl number encodes "the type of the parameter." The numeric ioctl value actually encodes the SIZE of the parameter (via `sizeof`), not the C type itself. Change "type of the parameter" to "size of the parameter" to match what the `_IO`/`_IOR`/`_IOW`/`_IOWR` macros actually encode.</comment>
<file context>
@@ -1823,7 +1823,7 @@ \section{Talking To Device Files}
You can see there is an argument called \cpp|cmd| in \cpp|test_ioctl_ioctl()| function.
It is the ioctl number.
-The ioctl number encodes the major device number, the type of the ioctl, the command, and the type of the parameter.
+The ioctl number encodes the direction of data transfer, the type of the ioctl, the command, and the type of the parameter.
This ioctl number is usually created by a macro call (\cpp|_IO|, \cpp|_IOR|, \cpp|_IOW| or \cpp|_IOWR| --- depending on the type) in a header file.
This header file should then be included both by the programs which will use ioctl (so they can generate the appropriate ioctl operations) and by the kernel module (so it can understand it).
</file context>
Suggested change
| The ioctl number encodes the direction of data transfer, the type of the ioctl, the command, and the type of the parameter. | |
| +The ioctl number encodes the direction of data transfer, the type of the ioctl, the command, and the size of the parameter. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The original text says the ioctl number encodes the "major device number", which is incorrect. The ioctl number does not encode the major device number.
As the following sentence notes, the number is created by the
_IO/_IOR/_IOW/_IOWRmacros, which encode the direction of data transfer, the type (magic number), the command, and the size of the parameter.Changed "major device number" to "direction of data transfer" so the description matches what these macros actually encode.
Summary by cubic
Fixes the ioctl number description in the docs: it encodes the direction of data transfer, not the major device number. Aligns the text with the
_IO,_IOR,_IOW, and_IOWRmacros.Written for commit 90f0d96. Summary will update on new commits.