From: Randy Dunlap <rdunlap@infradead.org>
To: Jani Nikula <jani.nikula@linux.intel.com>,
Kees Cook <keescook@chromium.org>,
Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] docs: Introduce deprecated APIs list
Date: Wed, 17 Oct 2018 10:08:55 -0700 [thread overview]
Message-ID: <70d6b61f-25af-f903-0693-46e649c08aff@infradead.org> (raw)
In-Reply-To: <875zy0ki3r.fsf@intel.com>
On 10/17/18 3:00 AM, Jani Nikula wrote:
> On Tue, 16 Oct 2018, Randy Dunlap <rdunlap@infradead.org> wrote:
>> On 10/16/18 7:17 PM, Kees Cook wrote:
>>> As discussed in the "API replacement/deprecation" thread[1], this
>>> makes an effort to document what things shouldn't get (re)added to the
>>> kernel, by introducing Documentation/process/deprecated.rst. It also
>>> adds the overflow kerndoc to ReST output, and tweaks the struct_size()
>>> documentation to parse correctly.
>>>
>>> [1] https://lists.linuxfoundation.org/pipermail/ksummit-discuss/2018-September/005282.html
>>>
>>> Signed-off-by: Kees Cook <keescook@chromium.org>
>>> ---
>>> Documentation/driver-api/basics.rst | 3 +
>>> Documentation/process/deprecated.rst | 99 ++++++++++++++++++++++++++++
>>> Documentation/process/index.rst | 1 +
>>> include/linux/overflow.h | 2 +-
>>> 4 files changed, 104 insertions(+), 1 deletion(-)
>>> create mode 100644 Documentation/process/deprecated.rst
>>
>>
>>> diff --git a/include/linux/overflow.h b/include/linux/overflow.h
>>> index 40b48e2133cb..2f224f43dd06 100644
>>> --- a/include/linux/overflow.h
>>> +++ b/include/linux/overflow.h
>>> @@ -291,7 +291,7 @@ static inline __must_check size_t __ab_c_size(size_t n, size_t size, size_t c)
>>> }
>>>
>>> /**
>>> - * struct_size() - Calculate size of structure with trailing array.
>>> + * function struct_size() - Calculate size of structure with trailing array.
>>
>> That syntax is not explained nor documented in Documentation/doc-guide/kernel-doc.rst.
>>
>> Is the root problem that the function name begins with "struct"?
>> Please explain in the patch description.
>
> Indeed, shouldn't be needed.
>
> BR,
> Jani.
>
>>
>>> * @p: Pointer to the structure.
>>> * @member: Name of the array member.
>>> * @n: Number of elements in the array.
>>
>>
>> thanks.
Well, this is just a guess (no testing), but in scripts/kernel-doc (at line
1907 in 4.19-rc8), we can see:
if ($identifier =~ m/^struct/) {
$decl_type = 'struct';
} elsif ($identifier =~ m/^union/) {
$decl_type = 'union';
} elsif ($identifier =~ m/^enum/) {
$decl_type = 'enum';
} elsif ($identifier =~ m/^typedef/) {
$decl_type = 'typedef';
} else {
$decl_type = 'function';
}
I wouldn't be surprised if a function named "struct_size" looks like a
type struct. Maybe it needs to be more strict, with either a space or
word boundary at the end of each type string. E.g.:
if ($identifier =~ m/^struct\b/) {
$decl_type = 'struct';
} elsif ($identifier =~ m/^union\b/) {
$decl_type = 'union';
} elsif ($identifier =~ m/^enum\b/) {
$decl_type = 'enum';
} elsif ($identifier =~ m/^typedef\b/) {
$decl_type = 'typedef';
} else {
$decl_type = 'function';
}
--
~Randy
next prev parent reply other threads:[~2018-10-17 17:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-17 2:17 [PATCH] docs: Introduce deprecated APIs list Kees Cook
2018-10-17 3:25 ` Randy Dunlap
2018-10-17 10:00 ` Jani Nikula
2018-10-17 17:08 ` Randy Dunlap [this message]
2018-10-17 22:37 ` Kees Cook
2018-10-17 22:41 ` Randy Dunlap
2018-10-17 23:34 ` Randy Dunlap
2018-10-17 12:50 ` Jonathan Corbet
2018-10-17 22:51 ` Kees Cook
2018-10-21 15:11 ` Miguel Ojeda
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=70d6b61f-25af-f903-0693-46e649c08aff@infradead.org \
--to=rdunlap@infradead.org \
--cc=corbet@lwn.net \
--cc=jani.nikula@linux.intel.com \
--cc=keescook@chromium.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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;
as well as URLs for NNTP newsgroup(s).