I was looking up the definition of kdev_t, and I saw it defined two
entirely different ways (only once for compilation purposes, so no
compile time problems).
In the same file, <include/linux/kdev_t.h>, patched below and I only
patched the comments and did not touch the code, it was defined as (in
the comments):
(1) typedef struct { unsigned short major, minor; } kdev_t;
Which would be a long (two shorts), then actually defined later in the
code as:
(2) typedef struct {
unsigned short value;
} kdev_t;
As you can guess, Redefining the comment to be two "chars" instead of
two shorts keeps the meaningful description in the comments (there is a
major # component and a minor # component), but redefining them to be
chars (bytes) rather than shorts reflects more accurately the storage
space allotted by the actual structure (one short, not two).
I figure it's best, when possible, to have the comments match up with
reality. If someone (like myself just now) is referencing the comments
for guidance with respect to what the data structures look like, they
would have soon discoverred that the data structures looked nothing like
what the comment was describing.
I'd appreciate if someone could get this or a similar patch in, and no,
I don't need to be specially credited for making a comment change :-).
Patch follows.
--- kdev_t.h.orig 2003-01-17 21:25:18.000000000 -0500
+++ kdev_t.h 2003-01-17 21:33:57.000000000 -0500
@@ -31,7 +31,7 @@
However, for the time being we let kdev_t be almost the same as dev_t:
-typedef struct { unsigned short major, minor; } kdev_t;
+typedef struct { unsigned char major, minor; } kdev_t;
Admissible operations on an object of type kdev_t:
- passing it along
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/