From: Jonathan Corbet <corbet@lwn.net>
To: Simon Sudarushkin via B4 Relay
<devnull+simonsudarushkin.gmail.com@kernel.org>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Simon Sudarushkin <simonsudarushkin@gmail.com>
Subject: Re: [PATCH] docs: kdoc_output: don't add a man page tail for filtered-out symbols
Date: Mon, 02 Nov 2026 09:29:27 -0700 [thread overview]
Message-ID: <874idzci3c.fsf@trenco.lwn.net> (raw)
In-Reply-To: <20260929-kdoc-man-filter-v1-1-5f70268885d1@gmail.com>
Simon Sudarushkin via B4 Relay
<devnull+simonsudarushkin.gmail.com@kernel.org> writes:
> From: Simon Sudarushkin <simonsudarushkin@gmail.com>
>
> ManFormat.msg() appends the "SEE ALSO" tail after every call to the base
> class msg(), even when the -e, -i, -s or --nosymbol filters dropped the
> symbol and nothing was written for it. With -s, every other symbol in
> the file leaves a stray "SEE ALSO" block behind the requested page. With
> -e on a file that exports nothing, the output is only such blocks, with
> no .TH header at all:
>
> $ tools/docs/kernel-doc -man -s string_get_size lib/string_helpers.c \
> | grep -c 'SEE ALSO'
> 13
> $ tools/docs/kernel-doc -man -e include/rdma/ib_mad.h | grep -c '^\.TH'
> 0
>
> Only add the tail when the base class produced a page, and add unit
> tests for both cases.
>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Closes: https://lore.kernel.org/all/fc7978bb-a71f-456d-84bb-670c8f0426ed@infradead.org/
> Fixes: 104e0a682e12 ("tools: kernel-doc: add a see also section at man pages")
> Assisted-by: LLM
> Signed-off-by: Simon Sudarushkin <simonsudarushkin@gmail.com>
> ---
> Randy, this takes a different route from your patch in August [1]: the
> out_tail() call stays in ManFormat.msg() and is skipped when the base
> class produced no page, so OutputFormat does not need to know about it.
> DOC blocks that are shown keep their tail, since they get their own .TH.
>
> [1] https://lore.kernel.org/all/20260816054826.3988516-1-rdunlap@infradead.org/
> ---
> tools/lib/python/kdoc/kdoc_output.py | 5 +++-
> tools/unittests/test_kdoc_parser.py | 52 ++++++++++++++++++++++++++++++++++++
> 2 files changed, 56 insertions(+), 1 deletion(-)
Applied, thanks.
jon
prev parent reply other threads:[~2026-11-02 16:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 13:36 Simon Sudarushkin via B4 Relay
2026-09-30 0:29 ` Randy Dunlap
2026-11-02 16:29 ` 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=874idzci3c.fsf@trenco.lwn.net \
--to=corbet@lwn.net \
--cc=devnull+simonsudarushkin.gmail.com@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab+huawei@kernel.org \
--cc=mchehab@kernel.org \
--cc=rdunlap@infradead.org \
--cc=simonsudarushkin@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®