]> www.infradead.org Git - users/willy/linux.git/commitdiff
docs: kdoc: simplify the PROTO continuation logic
authorJonathan Corbet <corbet@lwn.net>
Fri, 6 Jun 2025 16:34:30 +0000 (10:34 -0600)
committerJonathan Corbet <corbet@lwn.net>
Mon, 9 Jun 2025 20:37:16 +0000 (14:37 -0600)
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
scripts/lib/kdoc/kdoc_parser.py

index 2c6143f7ca0f37d915a416da6990884f5f271173..899d5446f95c3e77b063dfdeedefc95c7038c09c 100644 (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",