docs: kdoc: simplify the PROTO continuation logic

Remove the unneeded "cont" variable and tighten up the code slightly.

Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250606163438.229916-2-corbet@lwn.net
This commit is contained in:
Jonathan Corbet
2025-06-06 10:34:30 -06:00
parent ea08e53d4d
commit e8f0303e8b

View File

@@ -1688,7 +1688,6 @@ class KernelDoc:
Besides parsing kernel-doc tags, it also parses export symbols.
"""
cont = False
prev = ""
prev_ln = None
export_table = set()
@@ -1704,18 +1703,14 @@ class KernelDoc:
if self.state == state.PROTO:
if line.endswith("\\"):
prev += line.rstrip("\\")
cont = True
if not prev_ln:
prev_ln = ln
continue
if cont:
if prev:
ln = prev_ln
line = prev + line
prev = ""
cont = False
prev_ln = None
self.config.log.debug("%d %s%s: %s",