]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
docs: kdoc: fix logic to handle unissued warnings
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 19 Jan 2026 12:04:56 +0000 (13:04 +0100)
committerJonathan Corbet <corbet@lwn.net>
Tue, 20 Jan 2026 22:31:05 +0000 (15:31 -0700)
commit292eca3163218f2185a8eabe59f4a576bb9e05f8
tree76fb4dcb760140701d4b9854f5403df26b3af0ad
parent20f73d6fc298a22d97286e8fd8529c064d1a33f5
docs: kdoc: fix logic to handle unissued warnings

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/
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <95109a6585171da4d6900049deaa2634b41ee743.1768823489.git.mchehab+huawei@kernel.org>
tools/lib/python/kdoc/kdoc_parser.py