From: Jonathan Corbet <corbet@lwn.net>
To: Prateekshit Jaiswal via B4 Relay
<devnull+prateekshitjaiswal73.gmail.com@kernel.org>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Prateekshit Jaiswal <prateekshitjaiswal73@gmail.com>
Subject: Re: [PATCH 0/2] docs: kdoc: print each warning once, and only for selected symbols
Date: Wed, 25 Nov 2026 09:20:27 -0700 [thread overview]
Message-ID: <874id4yjas.fsf@trenco.lwn.net> (raw)
In-Reply-To: <20261114-kdoc-dup-warnings-v1-0-265f89bc3f9c@gmail.com>
Prateekshit Jaiswal via B4 Relay
<devnull+prateekshitjaiswal73.gmail.com@kernel.org> writes:
> kernel-doc currently prints every documented symbol's warnings twice.
> With -function or -export it also warns about symbols that were not
> asked for. Both come from the parser flushing warnings of entries it
> mistakenly treats as discarded; patch 2 stops that.
>
> Doing only that would uncover an older bug: the output step never
> prints warnings for symbols selected with -function or -export.
> Patch 1 restores those first, so nothing is lost at any point in the
> series.
>
> Testing:
> - tools/unittests/run.py passes after each patch. Without patch 1,
> the new OutputFilterWarnings tests for selected and exported symbols
> fail; without patch 2, test_stored_entry fails.
> - Warnings printed for intel_dkl_phy.c, before and after the series:
> -Wall: 2 and 1; -function intel_dkl_phy_read: 1 and 1;
> -function intel_dkl_phy_write: 1 and 0;
> -nosymbol intel_dkl_phy_read: 1 and 0.
> - kernel-doc -none -Wall over the 10320 .c and .h files with kernel-doc
> comments: 87900 and 49625 output lines, with the same 48026 distinct
> lines.
> - The two "Excess struct member" warnings for page_pool_params, which
> Documentation/networking/page_pool.rst pulls in with :identifiers:,
> are still printed, once each.
>
> Notes:
> - The new tests patch config.warning directly. MockKdocConfig.warning()
> is never called, because KdocConfig.__init__() sets self.warning as
> an instance attribute that shadows it, so the MockLogging handler
> does not see config.warning() messages. I can send a separate fix for
> that.
> - Plain --yaml output never printed warnings itself, so with patch 2
> it no longer shows the warnings of stored entries. With -rst or -man
> they are still printed, once, by the embedded output formats.
>
> ---
> Prateekshit Jaiswal (2):
> docs: kdoc: emit warnings for symbols selected with -function/-export
> docs: kdoc: don't print warnings of stored entries twice
>
> tools/lib/python/kdoc/kdoc_output.py | 1 +
> tools/lib/python/kdoc/kdoc_parser.py | 4 +-
> tools/unittests/test_kdoc_parser.py | 126 +++++++++++++++++++++++++++++++++++
> 3 files changed, 130 insertions(+), 1 deletion(-)
Applied, thanks.
jon
prev parent reply other threads:[~2026-11-25 16:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 6:14 [PATCH 0/2] docs: kdoc: print each warning once, and only for selected symbols Prateekshit Jaiswal
2026-11-14 6:14 ` Prateekshit Jaiswal via B4 Relay
2026-11-14 6:14 ` [PATCH 1/2] docs: kdoc: emit warnings for symbols selected with -function/-export Prateekshit Jaiswal
2026-11-14 6:14 ` Prateekshit Jaiswal via B4 Relay
2026-11-14 6:14 ` [PATCH 2/2] docs: kdoc: don't print warnings of stored entries twice Prateekshit Jaiswal
2026-11-14 6:14 ` Prateekshit Jaiswal via B4 Relay
2026-11-14 20:18 ` Randy Dunlap
2026-11-23 4:38 ` [PATCH 0/2] docs: kdoc: print each warning once, and only for selected symbols Prateekshit Jaiswal
2026-11-23 6:00 ` Jonathan Corbet
2026-11-25 16:20 ` Jonathan Corbet [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=874id4yjas.fsf@trenco.lwn.net \
--to=corbet@lwn.net \
--cc=andriy.shevchenko@linux.intel.com \
--cc=devnull+prateekshitjaiswal73.gmail.com@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=prateekshitjaiswal73@gmail.com \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.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 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.