Re: Improved <linux/lists.h>

From: Borislav Deianov (borislav@lix.polytechnique.fr)
Date: Wed Feb 23 2000 - 08:24:15 EST


On Tue, Feb 22, 2000 at 07:02:53PM -0500, Jeff Garzik wrote:
>
> One technique which is used in the kernel is to, if possible, place the
> primary list_head member of a structure at the top of the struct.
>
> This allows you to reference the structure itself as if it were a list,
> sometimes saving you a few keystrokes...

Sounds dodgy to me... You still need a cast, and then one day you'll
forget and rearange the fields of your struct and the compiler won't
even warn you. Maybe places in the kernel that do that should be
fixed?

Best,
Borislav

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



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:33 EST