From: Matthew Wilcox <willy@infradead.org>
To: Changbin Du <changbin.du@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
Jiri Kosina <trivial@kernel.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kernel-doc: trivial improvement for warning message
Date: Mon, 21 Oct 2019 11:54:06 -0700 [thread overview]
Message-ID: <20191021185406.GC9214@bombadil.infradead.org> (raw)
In-Reply-To: <20191020132323.29658-1-changbin.du@gmail.com>
On Sun, Oct 20, 2019 at 09:23:23PM +0800, Changbin Du wrote:
> The message "Function parameter or member ..." looks weird.
>
> Signed-off-by: Changbin Du <changbin.du@gmail.com>
> ---
> scripts/kernel-doc | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index 81dc91760b23..cd3d2ca52c34 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -1475,8 +1475,13 @@ sub push_parameter($$$$) {
> $parameterdescs{$param} = $undescribed;
>
> if (show_warnings($type, $declaration_name) && $param !~ /\./) {
> - print STDERR
> - "${file}:$.: warning: Function parameter or member '$param' not described in '$declaration_name'\n";
> + if ($decl_type eq "struct" or $decl_type eq 'union') {
> + print STDERR
> + "${file}:$.: warning: $decl_type member '$param' not described in '$declaration_name'\n";
> + } else {
> + print STDERR
> + "${file}:$.: warning: $decl_type parameter '$param' not described in '$declaration_name'\n";
> + }
> ++$warnings;
How about instead ...
if (show_warnings($type, $declaration_name) && $param !~ /\./) { if ($decl_type eq "struct")
$msg = "struct member";
elif ($decl_type eq "union")
$msg = "union member";
else
$msg = "function parameter";
print STDERR "${file}:$.: warning: $msg '$param' not described in '$declaration_name'\n";
(please excuse my perl, i am not a native speaker)
next prev parent reply other threads:[~2019-10-21 18:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-20 13:23 Changbin Du
2019-10-21 18:54 ` Matthew Wilcox [this message]
2019-10-23 11:27 ` Changbin Du
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=20191021185406.GC9214@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=changbin.du@gmail.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=trivial@kernel.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
all inboxes | Powered by JetHome®