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
1609 self.entry.brcount += r.group(2).count('{')1609 self.entry.brcount += r.group(2).count('{')
1610 self.entry.brcount -= r.group(2).count('}')1610 self.entry.brcount -= r.group(2).count('}')
1611 1611
1612 self.entry.brcount = max(self.entry.brcount, 0)1612 if r.group(2) == ';' and self.entry.brcount <= 0:
1613
1614 if r.group(2) == ';' and self.entry.brcount == 0:
1615 self.dump_declaration(ln, self.entry.prototype)1613 self.dump_declaration(ln, self.entry.prototype)
1616 self.reset_state(ln)1614 self.reset_state(ln)
1617 break1615 break

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t