[lkml]   [2002]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [TRIVIAL PATCH] Remove list_t infection.

On 2002.09.04 Rusty Russell wrote:
>In message <> you wri
>I'm confused, but I do know three things:
>1) list_t *bad*,
>2) Grand renaming of "struct list_head" *bad*, and

Why not something like:

struct list_node {
struct list_node *prev;
struct list_node *next;

struct list {
struct list_node *prev;
struct list_node *next;

list_length(struct list *l)
list_add(struct list_node *new, struct list *head)
list_splice(struct list *list, struct list *head)


#define list_sublist_from(node) ((struct list *)node)

So people would be forced to think if he is using a 'list_head'
as a node or as a sublist, and do the right casts to shut up the
compiler (that's why you can't do a typedef list_node list..., for
the compiler to scream...)

J.A. Magallon <> \ Software is like sex: \ It's better when it's free
Mandrake Linux release 9.0 (Cooker) for i586
Linux 2.4.20-pre5-j0 (gcc 3.2 (Mandrake Linux 9.0 3.2-1mdk))
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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