lkml.org 
[lkml]   [1999]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Request for comments (kdev_t and friends...)
Andries.Brouwer@cwi.nl wrote:
>
> 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.

Maybe it is something he never want's but it is something
he does indeed very frequently. Basicaly NOT going to
a pointer in a first place just helps to identify correctly
all the places where this kdev_t get's used ;-)

--Marcin Dalecki

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.068 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site