public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Horia Geantă" <horia.geanta@freescale.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: <linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] scripts/kernel-doc: handle object-like macros
Date: Mon, 30 Jun 2014 16:51:02 +0300	[thread overview]
Message-ID: <53B16B46.7060101@freescale.com> (raw)
In-Reply-To: <53AF7F63.9080807@infradead.org>

On 6/29/2014 5:52 AM, Randy Dunlap wrote:
> On 06/23/14 05:15, Horia Geanta wrote:
>> Object-like macros are different than function-like macros:
>> https://gcc.gnu.org/onlinedocs/cpp/Object-like-Macros.html
>> https://gcc.gnu.org/onlinedocs/cpp/Function-like-Macros.html
>>
>> They are not parsed correctly, generating invalid intermediate
>> files (xmls) for cases like:
>>      #define BIT_MASK    (0xFF << BIT_SHIFT)
>> where "OxFF <<" is considered to be parameter type.
>>
>> When parsing, we can differentiate beween these two types of macros by

                                      between.

>> checking whether there is at least one whitespace b/w "#define" and
>> first opening paranthesis.
>
>                  parenthesis.

Thanks, I'll fix both typos in v2.

>
> Where did you see a problem?  I tested the patch and all of the
> Documentation/DocBook/*.xml files are the same without or with the patch.
>

Indeed, right now there is no kernel-doc for "object-like" macros in 
Docbook.

I am preparing documentation for not-yet-upstreamed code in 
drivers/crypto/caam and I thought it would be useful to use kernel-doc 
for some of the #defines.

Doc would look like this (no @param list, no "Return" section, only a 
description):

/**
  * DEFAULT_SEC_ERA - the default value for the SEC era in case the user
  * provides an unsupported value.
  */
#define DEFAULT_SEC_ERA 6

Regards,
Horia



  reply	other threads:[~2014-06-30 13:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-23 12:15 [PATCH] scripts/kernel-doc: handle object-like macros Horia Geanta
2014-06-29  2:52 ` Randy Dunlap
2014-06-30 13:51   ` Horia Geantă [this message]
2014-06-30 16:31     ` Randy Dunlap

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=53B16B46.7060101@freescale.com \
    --to=horia.geanta@freescale.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox