From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Markus Heiser <markus.heiser@darmarit.de>
Cc: Linux Doc Mailing List <linux-doc@vger.kernel.org>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@infradead.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 00/17] kernel-doc: add supported to document nested structs/
Date: Wed, 11 Oct 2017 16:17:53 -0300 [thread overview]
Message-ID: <20171011161753.400cc1d6@vento.lan> (raw)
In-Reply-To: <20171009101955.4a860821@vento.lan>
Em Mon, 9 Oct 2017 10:19:55 -0300
Mauro Carvalho Chehab <mchehab@s-opensource.com> escreveu:
> > > I really don't want to add that much noise to the docs build; I think it
> > > will defeat any hope of cleaning up the warnings we already have. I
> > > wonder if we could suppress warnings about nested structs by default, and
> > > add a flag or envar to turn them back on for those who want them?
> >
> > This is what I vote for: +1
> >
> > > In truth, now that I look, the real problem is that the warnings are
> > > repeated many times - as in, like 100 times:
> > >
> > >> ./include/net/cfg80211.h:4115: warning: Function parameter or member 'wext.ibss' not described in 'wireless_dev'
> > >> ./include/net/cfg80211.h:4115: warning: Function parameter or member 'wext.ibss' not described in 'wireless_dev'
> > > <107 instances deleted...>
> > >> ./include/net/cfg80211.h:4115: warning: Function parameter or member 'wext.ibss' not described in 'wireless_dev'
> > >
> > > That's not something that used to happen, and is certainly not helpful.
> > > Figuring that out would help a lot. Can I get you to take a look at
> > > what's going on here?
> >
> > Hi Jon, if you grep for
> >
> > .. kernel-doc:: include/net/cfg80211.h
> >
> > e.g. by: grep cfg80211.h Documentation/driver-api/80211/cfg80211.rst | wc -l
> > you will see, that this directive is used 110 times in one reST file. If you
> > have 5 warnings about the kernel-doc markup in include/net/cfg80211.h you will
> > get 550 warnings about kernel-doc markup just for just one source code file.
> >
> > This is because the kernel-doc parser is an external process which is called
> > (in this example) 110 times for one reST file and one source code file. If
> > include/net/cfg80211.h is referred in other reST files, we got accordingly
> > more and more warnings .. thats really noise.
>
> I guess the solution here is simple: if any output selection argument
> is passed (-export, -internal, -function, -nofunction), only report
> warnings for things that match the output criteria.
>
> Not sure how easy is to implement that. I'll take a look.
It is actually very easy to suppress those warnings. See the enclosed
proof of concept patch.
Please notice that this patch is likely incomplete: all it does is that,
if --function or --nofunction is used, it won't print any warnings
for structs or enums.
I didn't check yet if this is not making it too silent.
If we're going to follow this way, IMHO, the best would be to define
a warning function and move the needed checks for $output_selection
and for $function for it to do the right thing, printing warnings only
for the stuff that will be output.
Jon,
Please let me know if you prefer go though this way or if, instead, you
opt to replace the kernel-doc perl script by a Sphinx module.
If you decide to keep with the perl script for now, I can work on an
improved version of this PoC.
Regards,
Mauro
scripts: kernel-doc: shut up enum/struct warnings if parsing only functions
There are two command line parameters that restrict the kernel-doc output
to output only functions. If this is used, it doesn't make any sense to
produce warnings about enums and structs. So, shut up such warnings.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 049044d95c0e..b4eebea6a8d6 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1138,16 +1138,20 @@ sub dump_enum($$) {
push @parameterlist, $arg;
if (!$parameterdescs{$arg}) {
$parameterdescs{$arg} = $undescribed;
- print STDERR "${file}:$.: warning: Enum value '$arg' ".
- "not described in enum '$declaration_name'\n";
+ if ($output_selection != OUTPUT_INCLUDE &&
+ $output_selection != OUTPUT_EXCLUDE) {
+ print STDERR "${file}:$.: warning: Enum value '$arg' not described in enum '$declaration_name'\n";
+ }
}
$_members{$arg} = 1;
}
while (my ($k, $v) = each %parameterdescs) {
if (!exists($_members{$k})) {
- print STDERR "${file}:$.: warning: Excess enum value " .
- "'$k' description in '$declaration_name'\n";
+ if ($output_selection != OUTPUT_INCLUDE &&
+ $output_selection != OUTPUT_EXCLUDE) {
+ print STDERR "${file}:$.: warning: Excess enum value '$k' description in '$declaration_name'\n";
+ }
}
}
@@ -1353,9 +1357,12 @@ sub push_parameter($$$$) {
if (!defined $parameterdescs{$param} && $param !~ /^#/) {
$parameterdescs{$param} = $undescribed;
- print STDERR
- "${file}:$.: warning: Function parameter or member '$param' not described in '$declaration_name'\n";
- ++$warnings;
+ if ($output_selection != OUTPUT_INCLUDE &&
+ $output_selection != OUTPUT_EXCLUDE) {
+ print STDERR
+ "${file}:$.: warning: Function parameter or member '$param' not described in '$declaration_name'\n";
+ ++$warnings;
+ }
}
$param = xml_escape($param);
next prev parent reply other threads:[~2017-10-11 19:18 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-04 11:48 [PATCH v3 00/17] kernel-doc: add supported to document nested structs/ Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 01/17] docs: kernel-doc.rst: better describe kernel-doc arguments Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 02/17] docs: kernel-doc.rst: improve private members description Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 03/17] docs: kernel-doc.rst: improve function documentation section Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 04/17] docs: kernel-doc.rst: improve structs chapter Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 05/17] docs: kernel-doc.rst: improve typedef documentation Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 06/17] docs: kernel-doc.rst: add documentation about man pages Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 07/17] docs: get rid of kernel-doc-nano-HOWTO.txt Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 08/17] scripts: kernel-doc: get rid of unused output formats Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 09/17] scripts: kernel-doc: improve argument handling Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 10/17] scripts: kernel-doc: change default to ReST format Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 11/17] scripts: kernel-doc: replace tabs by spaces Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 12/17] scripts: kernel-doc: parse next structs/unions Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 13/17] scripts: kernel-doc: get rid of $nested parameter Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 14/17] scripts: kernel-doc: print the declaration name on warnings Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 15/17] scripts: kernel-doc: handle nested struct function arguments Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 16/17] scripts: kernel-doc: improve nested logic to handle multiple identifiers Mauro Carvalho Chehab
2017-10-04 11:48 ` [PATCH v3 17/17] w1_netlink.h: add support for nested structs Mauro Carvalho Chehab
2017-10-07 16:34 ` [PATCH v3 00/17] kernel-doc: add supported to document nested structs/ Jonathan Corbet
2017-10-08 10:07 ` Markus Heiser
2017-10-09 13:19 ` Mauro Carvalho Chehab
2017-10-11 19:17 ` Mauro Carvalho Chehab [this message]
2017-12-18 15:26 ` Mauro Carvalho Chehab
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=20171011161753.400cc1d6@vento.lan \
--to=mchehab@s-opensource.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=markus.heiser@darmarit.de \
--cc=mchehab@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;
as well as URLs for NNTP newsgroup(s).