Commit 13901ef2 authored by Jani Nikula's avatar Jani Nikula

kernel-doc: do not regard $, %, or & prefixes as special in section names

The use of these is confusing in the script, and per this grep, they're
not used anywhere anyway:

$ git grep " \* [%$&][a-zA-Z0-9_]*:" -- *.[ch] | grep -v "\$\(Id\|Revision\|Date\)"

While at it, throw out the constants array, nothing is ever put there
again.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent c099ff69
...@@ -396,14 +396,12 @@ my $inline_doc_state; ...@@ -396,14 +396,12 @@ my $inline_doc_state;
# 'function', 'struct', 'union', 'enum', 'typedef' # 'function', 'struct', 'union', 'enum', 'typedef'
my $decl_type; my $decl_type;
my $doc_special = "\@\%\$\&";
my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start. my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start.
my $doc_end = '\*/'; my $doc_end = '\*/';
my $doc_com = '\s*\*\s*'; my $doc_com = '\s*\*\s*';
my $doc_com_body = '\s*\* ?'; my $doc_com_body = '\s*\* ?';
my $doc_decl = $doc_com . '(\w+)'; my $doc_decl = $doc_com . '(\w+)';
my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)'; my $doc_sect = $doc_com . '(\@?[\w\s]+):(.*)';
my $doc_content = $doc_com_body . '(.*)'; my $doc_content = $doc_com_body . '(.*)';
my $doc_block = $doc_com . 'DOC:\s*(.*)?'; my $doc_block = $doc_com . 'DOC:\s*(.*)?';
my $doc_inline_start = '^\s*/\*\*\s*$'; my $doc_inline_start = '^\s*/\*\*\s*$';
...@@ -411,7 +409,6 @@ my $doc_inline_sect = '\s*\*\s*(@[\w\s]+):(.*)'; ...@@ -411,7 +409,6 @@ my $doc_inline_sect = '\s*\*\s*(@[\w\s]+):(.*)';
my $doc_inline_end = '^\s*\*/\s*$'; my $doc_inline_end = '^\s*\*/\s*$';
my $export_symbol = '^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*;'; my $export_symbol = '^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*;';
my %constants;
my %parameterdescs; my %parameterdescs;
my @parameterlist; my @parameterlist;
my %sections; my %sections;
...@@ -511,11 +508,7 @@ sub dump_section { ...@@ -511,11 +508,7 @@ sub dump_section {
my $name = shift; my $name = shift;
my $contents = join "\n", @_; my $contents = join "\n", @_;
if ($name =~ m/$type_constant/) { if ($name =~ m/$type_param/) {
$name = $1;
# print STDERR "constant section '$1' = '$contents'\n";
$constants{$name} = $contents;
} elsif ($name =~ m/$type_param/) {
# print STDERR "parameter def '$1' = '$contents'\n"; # print STDERR "parameter def '$1' = '$contents'\n";
$name = $1; $name = $1;
$parameterdescs{$name} = $contents; $parameterdescs{$name} = $contents;
...@@ -2528,7 +2521,6 @@ sub dump_function($$) { ...@@ -2528,7 +2521,6 @@ sub dump_function($$) {
sub reset_state { sub reset_state {
$function = ""; $function = "";
%constants = ();
%parameterdescs = (); %parameterdescs = ();
%parametertypes = (); %parametertypes = ();
@parameterlist = (); @parameterlist = ();
...@@ -2924,7 +2916,6 @@ sub process_file($) { ...@@ -2924,7 +2916,6 @@ sub process_file($) {
dump_doc_section($file, $section, xml_escape($contents)); dump_doc_section($file, $section, xml_escape($contents));
$contents = ""; $contents = "";
$function = ""; $function = "";
%constants = ();
%parameterdescs = (); %parameterdescs = ();
%parametertypes = (); %parametertypes = ();
@parameterlist = (); @parameterlist = ();
...@@ -2942,7 +2933,6 @@ sub process_file($) { ...@@ -2942,7 +2933,6 @@ sub process_file($) {
dump_doc_section($file, $section, xml_escape($contents)); dump_doc_section($file, $section, xml_escape($contents));
$contents = ""; $contents = "";
$function = ""; $function = "";
%constants = ();
%parameterdescs = (); %parameterdescs = ();
%parametertypes = (); %parametertypes = ();
@parameterlist = (); @parameterlist = ();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment