All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Timur Tabi <timur@freescale.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: Can kernel-doc process simple macros?
Date: Mon, 05 Jan 2009 15:50:34 -0800	[thread overview]
Message-ID: <49629CCA.90405@oracle.com> (raw)
In-Reply-To: <ed82fe3e0901051536n5858d823r4c2a7f8eaa74ca4e@mail.gmail.com>

Timur Tabi wrote:
> How can I get kernel-doc to document a line like this:
> 
> #define MY_CONSTANT 10
> 
> The documentation doesn't say anything about macros, but Google
> searches imply that there is some support for macros in kernel-doc.

kernel-doc supports macros that look like functions.  E.g., from
include/linux/kernel.h:

/**
 * container_of - cast a member of a structure out to the containing structure
 * @ptr:	the pointer to the member.
 * @type:	the type of the container struct this is embedded in.
 * @member:	the name of the member within the struct.
 *
 */
#define container_of(ptr, type, member) ({			\
	const typeof( ((type *)0)->member ) *__mptr = (ptr);	\
	(type *)( (char *)__mptr - offsetof(type,member) );})


However, it does not supports simple macros that are just value names
like your example.  But it does support enums, so you could possibly
change the #defined values to enums and have kernel-doc for them.
Or we could see what it would take to support simple macro values
in kernel-doc...

~Randy

      reply	other threads:[~2009-01-05 23:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-05 23:36 Can kernel-doc process simple macros? Timur Tabi
2009-01-05 23:50 ` Randy Dunlap [this message]

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=49629CCA.90405@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=timur@freescale.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.