Re: Request for comments (kdev_t and friends...)

Andries.Brouwer@cwi.nl
Fri, 26 Nov 1999 03:56:07 +0100 (MET)


Marcin,

I just looked at your patch, but you make things much worse.
A kdev_t is a pointer, not a struct.

Going to a pointer is trivial, I have done it maybe ten times
the past four years. Look at earlier posts of mine maybe one or
two months ago.

So, code like
if (!dev)
is OK - it tests whether the pointer is NULL.
On the other hand,
if (!kdev_t_to_nr(dev))
is terrible.

Notice that kdev_t_to_nr is something the kernel never wants
to do - it is looking at certain numbers in the struct and
assembling them to something that is written in a filesystem
or returned by the stat call.

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/