mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: prateekshitjaiswal73@gmail.com, Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.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
Subject: Re: [PATCH 2/2] docs: kdoc: don't print warnings of stored entries twice
Date: Sat, 14 Nov 2026 12:18:00 -0800	[thread overview]
Message-ID: <2f7b7068-caf7-4e85-902e-9307be815ecb@infradead.org> (raw)
In-Reply-To: <20261114-kdoc-dup-warnings-v1-2-265f89bc3f9c@gmail.com>



On 11/13/26 10:14 PM, Prateekshit Jaiswal via B4 Relay wrote:
> From: Prateekshit Jaiswal <prateekshitjaiswal73@gmail.com>
> 
> Commit 469c1c9eb6c9 ("kernel-doc: Issue warnings that were silently
> discarded") was meant to print warnings of entries that never reach
> the output step. With no symbol filter, kernel-doc now prints the
> warnings of every documented symbol twice:
> 
>   $ ./scripts/kernel-doc -none -Wall drivers/gpu/drm/i915/display/intel_dkl_phy.c
>   Warning: drivers/gpu/drm/i915/display/intel_dkl_phy.c:47 No description found for return value of 'intel_dkl_phy_read'
>   Warning: drivers/gpu/drm/i915/display/intel_dkl_phy.c:47 No description found for return value of 'intel_dkl_phy_read'
> 
> The flush uses "self.entry not in self.entries" to tell stored entries
> from discarded ones. output_declaration() stores a new KdocItem built
> from the entry, never the KernelEntry itself, so that test is always
> true. Every stored entry then warns once in the parser and once in the
> output plugin.
> 
> Those parser-side prints also ignore the later symbol filter, so
> "-function intel_dkl_phy_write" still warns about intel_dkl_phy_read().
> Commit 292eca316321 ("docs: kdoc: fix logic to handle unissued
> warnings") routes the flush through config.warning(), which increments
> the warning count. -Werror then reports "2 warnings as errors" for a
> single warning, and a -function run fails because of a different
> symbol.
> 
> Mark the entry as stored in output_declaration(), flush warnings only
> for entries that were not stored, and add tests for both cases. This
> needs the previous patch. Without it, symbols selected with -function
> or -export would lose their warnings.
> 
> Running "kernel-doc -none -Wall" over the 10320 .c and .h files with
> kernel-doc comments, the output shrinks from 87900 to 49625 lines,
> while the set of distinct lines stays the same.
> 
> The problem was found, and the fix and tests drafted, with the help of
> an AI coding assistant (Claude Code); I have reviewed and tested the
> result.
> 
> Fixes: 469c1c9eb6c9 ("kernel-doc: Issue warnings that were silently discarded")
> Signed-off-by: Prateekshit Jaiswal <prateekshitjaiswal73@gmail.com>

Thank you very much. I had complained about this issue.

Tested-by: Randy Dunlap <rdunlap@infradead.org>

This reduces a full "make W=1 mandocs" from 31341 lines down to
21373 lines. That eliminates a LOT of noise/duplication when
reviewing/looking at warnings.

> ---
>  tools/lib/python/kdoc/kdoc_parser.py |  4 ++-
>  tools/unittests/test_kdoc_parser.py  | 55 ++++++++++++++++++++++++++++++++++++
>  2 files changed, 58 insertions(+), 1 deletion(-)

-- 
~Randy

      reply	other threads:[~2026-11-14 20:18 UTC|newest]

Thread overview: 4+ 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 via B4 Relay
2026-11-14  6:14 ` [PATCH 1/2] docs: kdoc: emit warnings for symbols selected with -function/-export 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 via B4 Relay
2026-11-14 20:18   ` Randy Dunlap [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=2f7b7068-caf7-4e85-902e-9307be815ecb@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=prateekshitjaiswal73@gmail.com \
    --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 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®