History

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.

Jonathan Corbet committed 1 year ago

Commit bfa5bb31 parent 09b92971 file · +1 −3Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/lib/kdoc/kdoc_parser.py+1−3
@@ -1609,9 +1609,7 @@ class KernelDoc: · 1608 unmodified lines
16091609 self.entry.brcount += r.group(2).count('{')
16101610 self.entry.brcount -= r.group(2).count('}')
16111611
1612− self.entry.brcount = max(self.entry.brcount, 0)
1613−
1614− if r.group(2) == ';' and self.entry.brcount == 0:
1612+ if r.group(2) == ';' and self.entry.brcount <= 0:
16151613 self.dump_declaration(ln, self.entry.prototype)
16161614 self.reset_state(ln)
16171615 break