Skip to contentSkip to conversation

Type-change of kdev_t

DISCUSSION Roger W.Brown 2 participants 2 messages Jan 18, 2002

lore
Share & tools
lore
#0 lore raw

Hi,

I'm no kernel hacker so I am little hesitant to speak; however,
I'm looking at kdev_t.h from the linux-2.5.3-pre1 source.

The type of kdev_t has changed recently from a scalar type to a structured type. Should macro definitions such as MINOR(dev) also be revised to be consistent with the "new" kdev_t ?

Something like:

  #define MINOR(dev)  ((unsigned int) ((dev.value) & MINORMASK))

rather than

  #define MINOR(dev)  ((unsigned int) ((dev) & MINORMASK))

Then usage of the MINOR() macro remains unchanged.

Regards,

Roger Brown

#1 lore raw

On Sat, 19 Jan 2002, Roger W.Brown wrote:

|
|   Hi,
|
|       I'm no kernel hacker so I am little hesitant to speak; however,
|   I'm looking at kdev_t.h from the linux-2.5.3-pre1 source.
|
|   The type of kdev_t has changed recently from a scalar type to a
|   structured type.  Should macro definitions such as MINOR(dev) also
|   be revised to be consistent with the "new" kdev_t ?

Macros to use kdev_t also changed.

|   Something like:
|
|   #define MINOR(dev)  ((unsigned int) ((dev.value) & MINORMASK))
|
|   rather than
|
|   #define MINOR(dev)  ((unsigned int) ((dev) & MINORMASK))
|
|   Then usage of the MINOR() macro remains unchanged.

Nope, use major() and minor() instead [although I prefer the kmajor() and kminor() patch].

See http://www.osdl.org/archive/rddunlap/linux-port-25x.html,
item 7, bullet 3, which points to an email from one Linus Torvalds about the kdev_t change.

Signature · 1 line
~Randy