lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 28 Mar 2007 09:32:57 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Paul Sokolovsky <pmiscml@...il.com>
CC:	linux-kernel@...r.kernel.org, kernel-discuss@...dhelds.org,
	Anton Vorontsov <cbou@...l.ru>
Subject: Re: [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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ