All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Paul Sokolovsky <pmiscml@gmail.com>
Cc: linux-kernel@vger.kernel.org, kernel-discuss@handhelds.org,
	Anton Vorontsov <cbou@mail.ru>
Subject: Re: [RFC] Virtual methods for devices and generalized GPIO support using it
Date: Wed, 28 Mar 2007 09:32:57 -0700	[thread overview]
Message-ID: <460A98B9.9040602@zytor.com> (raw)
In-Reply-To: <881020209.20070327113610@gmail.com>

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

  reply	other threads:[~2007-03-28 16:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-27  8:36 [RFC] Virtual methods for devices and generalized GPIO support using it Paul Sokolovsky
2007-03-28 16:32 ` H. Peter Anvin [this message]
2007-03-28 23:52   ` Paul Sokolovsky
2007-03-29  0:08     ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=460A98B9.9040602@zytor.com \
    --to=hpa@zytor.com \
    --cc=cbou@mail.ru \
    --cc=kernel-discuss@handhelds.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmiscml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.