mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Prateekshit Jaiswal via B4 Relay <devnull+prateekshitjaiswal73.gmail.com@kernel.org>
To: Jonathan Corbet <corbet@lwn.net>,
	 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: [PATCH 0/2] docs: kdoc: print each warning once, and only for selected symbols
Date: Sat, 14 Nov 2026 11:44:07 +0530	[thread overview]
Message-ID: <20261114-kdoc-dup-warnings-v1-0-265f89bc3f9c@gmail.com> (raw)

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(-)
---
base-commit: 2138148bf44fd84d3e0a863f0e8cb3627cdcc606
change-id: 20261114-kdoc-dup-warnings-785f4a72b806

Best regards,
-- 
Prateekshit Jaiswal <prateekshitjaiswal73@gmail.com>



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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14  6:14 Prateekshit Jaiswal via B4 Relay [this message]
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

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=20261114-kdoc-dup-warnings-v1-0-265f89bc3f9c@gmail.com \
    --to=devnull+prateekshitjaiswal73.gmail.com@kernel.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=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 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®