From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
linux-kernel@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Jani Nikula <jani.nikula@intel.com>,
Jonathan Corbet <corbet@lwn.net>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Randy Dunlap <rdunlap@infradead.org>
Subject: [PATCH v2 1/4] scripts/kernel-doc: fix logic to handle unissued warnings
Date: Mon, 12 Jan 2026 16:06:50 +0100 [thread overview]
Message-ID: <afac0e4eec12bd5cc9a5040359f26058a3c1df1e.1768229902.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1768229902.git.mchehab+huawei@kernel.org>
Changeset 469c1c9eb6c9 ("kernel-doc: Issue warnings that were silently discarded")
didn't properly addressed the missing messages behavior, as
it was calling directly python logger low-level function,
instead of using the expected method to emit warnings.
Basically, there are two methods to log messages:
- self.config.log.warning() - This is the raw level to emit a
warning. It just writes the a message at stderr, via python
logging, as it is initialized as:
self.config.log = logging.getLogger("kernel-doc")
- self.config.warning() - This is where we actually consider a
message as a warning, properly incrementing error count.
Due to that, several parsing error messages are internally considered
as success, causing -Werror to not work on such messages.
While here, ensure that the last ignored entry will also be handled
by adding an extra check at the end of the parse handler.
Fixes: 469c1c9eb6c9 ("kernel-doc: Issue warnings that were silently discarded")
Closes: https://lore.kernel.org/linux-doc/20260112091053.00cee29a@foz.lan/
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
tools/lib/python/kdoc/kdoc_parser.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/kdoc_parser.py
index a9a37519145d..aed07fdaa561 100644
--- a/tools/lib/python/kdoc/kdoc_parser.py
+++ b/tools/lib/python/kdoc/kdoc_parser.py
@@ -459,7 +459,7 @@ class KernelDoc:
#
if self.entry and self.entry not in self.entries:
for log_msg in self.entry.warnings:
- self.config.log.warning(log_msg)
+ self.config.warning(log_msg)
self.entry = KernelEntry(self.config, self.fname, ln)
@@ -1741,6 +1741,10 @@ class KernelDoc:
# Hand this line to the appropriate state handler
self.state_actions[self.state](self, ln, line)
+ if self.entry and self.entry not in self.entries:
+ for log_msg in self.entry.warnings:
+ self.config.warning(log_msg)
+
except OSError:
self.config.log.error(f"Error: Cannot open file {self.fname}")
--
2.52.0
next prev parent reply other threads:[~2026-01-12 15:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-12 15:06 [PATCH v2 0/4] fix -Werror issues Mauro Carvalho Chehab
2026-01-12 15:06 ` Mauro Carvalho Chehab [this message]
2026-01-12 15:06 ` [PATCH v2 2/4] scripts/kernel-doc: avoid error_count overflows Mauro Carvalho Chehab
2026-01-12 15:06 ` [PATCH v2 3/4] scripts/kernel-doc: ensure that comments are using our coding style Mauro Carvalho Chehab
2026-01-12 15:43 ` Jonathan Corbet
2026-01-12 15:57 ` Mauro Carvalho Chehab
2026-01-12 15:06 ` [PATCH v2 4/4] scripts/kernel-doc: some fixes to kernel-doc comments 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=afac0e4eec12bd5cc9a5040359f26058a3c1df1e.1768229902.git.mchehab+huawei@kernel.org \
--to=mchehab+huawei@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=corbet@lwn.net \
--cc=jani.nikula@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rdunlap@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
all inboxes | Powered by JetHome®