Skip to content

Commit 5219f18

Browse files
author
Jonathan Corbet
committed
docs: Special-case function-pointer parameters in kernel-doc
Add yet another regex to kernel-doc to trap @param() references separately and not produce corrupt RST markup. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
1 parent ef00028 commit 5219f18

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

scripts/kernel-doc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ my $anon_struct_union = 0;
212212
my $type_constant = '\%([-_\w]+)';
213213
my $type_func = '(\w+)\(\)';
214214
my $type_param = '\@(\w+)';
215+
my $type_fp_param = '\@(\w+)\(\)'; # Special RST handling for func ptr params
215216
my $type_struct = '\&((struct\s*)*[_\w]+)';
216217
my $type_struct_xml = '\\&amp;((struct\s*)*[_\w]+)';
217218
my $type_env = '(\$\w+)';
@@ -292,6 +293,7 @@ my @highlights_rst = (
292293
# Note: need to escape () to avoid func matching later
293294
[$type_member_func, "\\:c\\:type\\:`\$1\$2\\\\(\\\\) <\$1>`"],
294295
[$type_member, "\\:c\\:type\\:`\$1\$2 <\$1>`"],
296+
[$type_fp_param, "**\$1\\\\(\\\\)**"],
295297
[$type_func, "\\:c\\:func\\:`\$1()`"],
296298
[$type_struct_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"],
297299
[$type_enum_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"],

0 commit comments

Comments
 (0)