lkml.org 
[lkml]   [2007]   [Mar]   [28]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 28 Mar 2007 09:32:57 -0700
From"H. Peter Anvin" <>
SubjectRe: [RFC] Virtual methods for devices and generalized GPIO support using it
Paul Sokolovsky wrote:
> 
> In this respect, VTABLE(), METHOD() macros serve the same purpose as 
> container_of() and list_for_each() - they are besides offering (more) 
> convenient syntax, also carry important annotattion and educational
> messages, like "it's ok, and encouraged to embed one structure into 
> another - use it!" or "list manipulation is a trivial operation for kernel,
> and we want you to treat it as such and use in standard, easily 
> distinguishable way".
> 

You realize, right, that the Linux kernel already have a much cleaner 
way to do vtables in the kernel, without this kind of macro crappage? 
It's called an _ops table, and is used in a patternized way:

foo->x_ops->func(foo, ...);

... all over the kernel.  We like it that way.

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

\
 
 \ /
  Last update: 2007-03-28 18:35    [from the cache]
©2003-2008