scripts/lib/kdoc/kdoc_files.py: don't try to join None

If out_msg() returns None, it means that an unknown declaration
was found. Avoid letting the script crash on such case.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/4334d16f14cfd93e611b290fb56c35d236cadcb7.1744685912.git.mchehab+huawei@kernel.org
This commit is contained in:
Mauro Carvalho Chehab
2025-04-15 11:12:48 +08:00
committed by Jonathan Corbet
parent f0ba72e655
commit 439111ee0c

View File

@@ -270,13 +270,16 @@ class KernelFiles():
msg = ""
for name, arg in self.results[fname]:
msg += self.out_msg(fname, name, arg)
m = self.out_msg(fname, name, arg)
if msg is None:
if m is None:
ln = arg.get("ln", 0)
dtype = arg.get('type', "")
self.config.log.warning("%s:%d Can't handle %s",
fname, ln, dtype)
else:
msg += m
if msg:
yield fname, msg