summaryrefslogtreecommitdiff
path: root/scripts/lib/kdoc/kdoc_parser.py
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2025-07-03 12:43:59 -0600
committerJonathan Corbet <corbet@lwn.net>2025-07-08 08:06:25 -0600
commit061a1c1a27c9ea7ae5d99f72b579d542e767a3e2 (patch)
treee78873443c3db7da8a8d7ee5ed4012f91ac6fc1d /scripts/lib/kdoc/kdoc_parser.py
parent8078e0ed1f3f3bac776b412b0f85ada86f91fef0 (diff)
docs: kdoc: remove the brcount floor in process_proto_type()
Putting the floor under brcount does not change the output in any way, just remove it. Change the termination test from ==0 to <=0 to prevent infinite loops in case somebody does something truly wacko in the code. Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Tested-by: Akira Yokosawa <akiyks@gmail.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20250703184403.274408-4-corbet@lwn.net
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
-rw-r--r--scripts/lib/kdoc/kdoc_parser.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
index d9ff2d066160..935f2a3c4b47 100644
--- a/scripts/lib/kdoc/kdoc_parser.py
+++ b/scripts/lib/kdoc/kdoc_parser.py
@@ -1609,9 +1609,7 @@ class KernelDoc:
self.entry.brcount += r.group(2).count('{')
self.entry.brcount -= r.group(2).count('}')
- self.entry.brcount = max(self.entry.brcount, 0)
-
- if r.group(2) == ';' and self.entry.brcount == 0:
+ if r.group(2) == ';' and self.entry.brcount <= 0:
self.dump_declaration(ln, self.entry.prototype)
self.reset_state(ln)
break