Commit 3c308798 authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

scripts: kernel-doc whitespace cleanup

Whitespace cleanup only:  convert some series of spaces to tabs.
Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2d3466a3
...@@ -381,10 +381,10 @@ sub output_highlight { ...@@ -381,10 +381,10 @@ sub output_highlight {
eval $dohighlight; eval $dohighlight;
die $@ if $@; die $@ if $@;
foreach $line (split "\n", $contents) { foreach $line (split "\n", $contents) {
if ($line eq ""){ if ($line eq ""){
print $lineprefix, $blankline; print $lineprefix, $blankline;
} else { } else {
$line =~ s/\\\\\\/\&/g; $line =~ s/\\\\\\/\&/g;
print $lineprefix, $line; print $lineprefix, $line;
} }
print "\n"; print "\n";
...@@ -414,7 +414,7 @@ sub output_enum_html(%) { ...@@ -414,7 +414,7 @@ sub output_enum_html(%) {
print "<b>enum ".$args{'enum'}."</b> {<br>\n"; print "<b>enum ".$args{'enum'}."</b> {<br>\n";
$count = 0; $count = 0;
foreach $parameter (@{$args{'parameterlist'}}) { foreach $parameter (@{$args{'parameterlist'}}) {
print " <b>".$parameter."</b>"; print " <b>".$parameter."</b>";
if ($count != $#{$args{'parameterlist'}}) { if ($count != $#{$args{'parameterlist'}}) {
$count++; $count++;
print ",\n"; print ",\n";
...@@ -462,7 +462,7 @@ sub output_struct_html(%) { ...@@ -462,7 +462,7 @@ sub output_struct_html(%) {
my $parameter_name = $parameter; my $parameter_name = $parameter;
$parameter_name =~ s/\[.*//; $parameter_name =~ s/\[.*//;
($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
$type = $args{'parametertypes'}{$parameter}; $type = $args{'parametertypes'}{$parameter};
if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
# pointer-to-function # pointer-to-function
...@@ -483,7 +483,7 @@ sub output_struct_html(%) { ...@@ -483,7 +483,7 @@ sub output_struct_html(%) {
my $parameter_name = $parameter; my $parameter_name = $parameter;
$parameter_name =~ s/\[.*//; $parameter_name =~ s/\[.*//;
($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
print "<dt><b>".$parameter."</b>\n"; print "<dt><b>".$parameter."</b>\n";
print "<dd>"; print "<dd>";
output_highlight($args{'parameterdescs'}{$parameter_name}); output_highlight($args{'parameterdescs'}{$parameter_name});
...@@ -525,7 +525,7 @@ sub output_function_html(%) { ...@@ -525,7 +525,7 @@ sub output_function_html(%) {
my $parameter_name = $parameter; my $parameter_name = $parameter;
$parameter_name =~ s/\[.*//; $parameter_name =~ s/\[.*//;
($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
print "<dt><b>".$parameter."</b>\n"; print "<dt><b>".$parameter."</b>\n";
print "<dd>"; print "<dd>";
output_highlight($args{'parameterdescs'}{$parameter_name}); output_highlight($args{'parameterdescs'}{$parameter_name});
...@@ -691,7 +691,7 @@ sub output_struct_xml(%) { ...@@ -691,7 +691,7 @@ sub output_struct_xml(%) {
$parameter_name =~ s/\[.*//; $parameter_name =~ s/\[.*//;
defined($args{'parameterdescs'}{$parameter_name}) || next; defined($args{'parameterdescs'}{$parameter_name}) || next;
($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
$type = $args{'parametertypes'}{$parameter}; $type = $args{'parametertypes'}{$parameter};
if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
# pointer-to-function # pointer-to-function
...@@ -767,11 +767,11 @@ sub output_enum_xml(%) { ...@@ -767,11 +767,11 @@ sub output_enum_xml(%) {
print "enum ".$args{'enum'}." {\n"; print "enum ".$args{'enum'}." {\n";
$count = 0; $count = 0;
foreach $parameter (@{$args{'parameterlist'}}) { foreach $parameter (@{$args{'parameterlist'}}) {
print " $parameter"; print " $parameter";
if ($count != $#{$args{'parameterlist'}}) { if ($count != $#{$args{'parameterlist'}}) {
$count++; $count++;
print ","; print ",";
} }
print "\n"; print "\n";
} }
print "};"; print "};";
...@@ -1007,7 +1007,7 @@ sub output_enum_man(%) { ...@@ -1007,7 +1007,7 @@ sub output_enum_man(%) {
print "enum ".$args{'enum'}." {\n"; print "enum ".$args{'enum'}." {\n";
$count = 0; $count = 0;
foreach my $parameter (@{$args{'parameterlist'}}) { foreach my $parameter (@{$args{'parameterlist'}}) {
print ".br\n.BI \" $parameter\"\n"; print ".br\n.BI \" $parameter\"\n";
if ($count == $#{$args{'parameterlist'}}) { if ($count == $#{$args{'parameterlist'}}) {
print "\n};\n"; print "\n};\n";
last; last;
...@@ -1054,7 +1054,7 @@ sub output_struct_man(%) { ...@@ -1054,7 +1054,7 @@ sub output_struct_man(%) {
my $parameter_name = $parameter; my $parameter_name = $parameter;
$parameter_name =~ s/\[.*//; $parameter_name =~ s/\[.*//;
($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
$type = $args{'parametertypes'}{$parameter}; $type = $args{'parametertypes'}{$parameter};
if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
# pointer-to-function # pointer-to-function
...@@ -1077,7 +1077,7 @@ sub output_struct_man(%) { ...@@ -1077,7 +1077,7 @@ sub output_struct_man(%) {
my $parameter_name = $parameter; my $parameter_name = $parameter;
$parameter_name =~ s/\[.*//; $parameter_name =~ s/\[.*//;
($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
print ".IP \"".$parameter."\" 12\n"; print ".IP \"".$parameter."\" 12\n";
output_highlight($args{'parameterdescs'}{$parameter_name}); output_highlight($args{'parameterdescs'}{$parameter_name});
} }
...@@ -1187,7 +1187,7 @@ sub output_enum_text(%) { ...@@ -1187,7 +1187,7 @@ sub output_enum_text(%) {
print "enum ".$args{'enum'}." {\n"; print "enum ".$args{'enum'}." {\n";
$count = 0; $count = 0;
foreach $parameter (@{$args{'parameterlist'}}) { foreach $parameter (@{$args{'parameterlist'}}) {
print "\t$parameter"; print "\t$parameter";
if ($count != $#{$args{'parameterlist'}}) { if ($count != $#{$args{'parameterlist'}}) {
$count++; $count++;
print ","; print ",";
...@@ -1232,7 +1232,7 @@ sub output_struct_text(%) { ...@@ -1232,7 +1232,7 @@ sub output_struct_text(%) {
my $parameter_name = $parameter; my $parameter_name = $parameter;
$parameter_name =~ s/\[.*//; $parameter_name =~ s/\[.*//;
($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
$type = $args{'parametertypes'}{$parameter}; $type = $args{'parametertypes'}{$parameter};
if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
# pointer-to-function # pointer-to-function
...@@ -1252,7 +1252,7 @@ sub output_struct_text(%) { ...@@ -1252,7 +1252,7 @@ sub output_struct_text(%) {
my $parameter_name = $parameter; my $parameter_name = $parameter;
$parameter_name =~ s/\[.*//; $parameter_name =~ s/\[.*//;
($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
print "$parameter\n\t"; print "$parameter\n\t";
print $args{'parameterdescs'}{$parameter_name}."\n"; print $args{'parameterdescs'}{$parameter_name}."\n";
} }
...@@ -1284,7 +1284,7 @@ sub output_declaration { ...@@ -1284,7 +1284,7 @@ sub output_declaration {
( $function_only == 1 && defined($function_table{$name})) || ( $function_only == 1 && defined($function_table{$name})) ||
( $function_only == 2 && !defined($function_table{$name}))) ( $function_only == 2 && !defined($function_table{$name})))
{ {
&$func(@_); &$func(@_);
$section_counter++; $section_counter++;
} }
} }
...@@ -1317,8 +1317,8 @@ sub dump_struct($$) { ...@@ -1317,8 +1317,8 @@ sub dump_struct($$) {
my $file = shift; my $file = shift;
if ($x =~/(struct|union)\s+(\w+)\s*{(.*)}/) { if ($x =~/(struct|union)\s+(\w+)\s*{(.*)}/) {
$declaration_name = $2; $declaration_name = $2;
my $members = $3; my $members = $3;
# ignore embedded structs or unions # ignore embedded structs or unions
$members =~ s/{.*?}//g; $members =~ s/{.*?}//g;
...@@ -1345,7 +1345,7 @@ sub dump_struct($$) { ...@@ -1345,7 +1345,7 @@ sub dump_struct($$) {
}); });
} }
else { else {
print STDERR "Error(${file}:$.): Cannot parse struct or union!\n"; print STDERR "Error(${file}:$.): Cannot parse struct or union!\n";
++$errors; ++$errors;
} }
} }
...@@ -1356,15 +1356,15 @@ sub dump_enum($$) { ...@@ -1356,15 +1356,15 @@ sub dump_enum($$) {
$x =~ s@/\*.*?\*/@@gos; # strip comments. $x =~ s@/\*.*?\*/@@gos; # strip comments.
if ($x =~ /enum\s+(\w+)\s*{(.*)}/) { if ($x =~ /enum\s+(\w+)\s*{(.*)}/) {
$declaration_name = $1; $declaration_name = $1;
my $members = $2; my $members = $2;
foreach my $arg (split ',', $members) { foreach my $arg (split ',', $members) {
$arg =~ s/^\s*(\w+).*/$1/; $arg =~ s/^\s*(\w+).*/$1/;
push @parameterlist, $arg; push @parameterlist, $arg;
if (!$parameterdescs{$arg}) { if (!$parameterdescs{$arg}) {
$parameterdescs{$arg} = $undescribed; $parameterdescs{$arg} = $undescribed;
print STDERR "Warning(${file}:$.): Enum value '$arg' ". print STDERR "Warning(${file}:$.): Enum value '$arg' ".
"not described in enum '$declaration_name'\n"; "not described in enum '$declaration_name'\n";
} }
...@@ -1382,7 +1382,7 @@ sub dump_enum($$) { ...@@ -1382,7 +1382,7 @@ sub dump_enum($$) {
}); });
} }
else { else {
print STDERR "Error(${file}:$.): Cannot parse enum!\n"; print STDERR "Error(${file}:$.): Cannot parse enum!\n";
++$errors; ++$errors;
} }
} }
...@@ -1393,12 +1393,12 @@ sub dump_typedef($$) { ...@@ -1393,12 +1393,12 @@ sub dump_typedef($$) {
$x =~ s@/\*.*?\*/@@gos; # strip comments. $x =~ s@/\*.*?\*/@@gos; # strip comments.
while (($x =~ /\(*.\)\s*;$/) || ($x =~ /\[*.\]\s*;$/)) { while (($x =~ /\(*.\)\s*;$/) || ($x =~ /\[*.\]\s*;$/)) {
$x =~ s/\(*.\)\s*;$/;/; $x =~ s/\(*.\)\s*;$/;/;
$x =~ s/\[*.\]\s*;$/;/; $x =~ s/\[*.\]\s*;$/;/;
} }
if ($x =~ /typedef.*\s+(\w+)\s*;/) { if ($x =~ /typedef.*\s+(\w+)\s*;/) {
$declaration_name = $1; $declaration_name = $1;
output_declaration($declaration_name, output_declaration($declaration_name,
'typedef', 'typedef',
...@@ -1410,7 +1410,7 @@ sub dump_typedef($$) { ...@@ -1410,7 +1410,7 @@ sub dump_typedef($$) {
}); });
} }
else { else {
print STDERR "Error(${file}:$.): Cannot parse typedef!\n"; print STDERR "Error(${file}:$.): Cannot parse typedef!\n";
++$errors; ++$errors;
} }
} }
...@@ -1424,14 +1424,14 @@ sub create_parameterlist($$$) { ...@@ -1424,14 +1424,14 @@ sub create_parameterlist($$$) {
# temporarily replace commas inside function pointer definition # temporarily replace commas inside function pointer definition
while ($args =~ /(\([^\),]+),/) { while ($args =~ /(\([^\),]+),/) {
$args =~ s/(\([^\),]+),/$1#/g; $args =~ s/(\([^\),]+),/$1#/g;
} }
foreach my $arg (split($splitter, $args)) { foreach my $arg (split($splitter, $args)) {
# strip comments # strip comments
$arg =~ s/\/\*.*\*\///; $arg =~ s/\/\*.*\*\///;
# strip leading/trailing spaces # strip leading/trailing spaces
$arg =~ s/^\s*//; $arg =~ s/^\s*//;
$arg =~ s/\s*$//; $arg =~ s/\s*$//;
$arg =~ s/\s+/ /; $arg =~ s/\s+/ /;
...@@ -1514,15 +1514,15 @@ sub push_parameter($$$) { ...@@ -1514,15 +1514,15 @@ sub push_parameter($$$) {
$parameterdescs{$param_name} = $undescribed; $parameterdescs{$param_name} = $undescribed;
if (($type eq 'function') || ($type eq 'enum')) { if (($type eq 'function') || ($type eq 'enum')) {
print STDERR "Warning(${file}:$.): Function parameter ". print STDERR "Warning(${file}:$.): Function parameter ".
"or member '$param' not " . "or member '$param' not " .
"described in '$declaration_name'\n"; "described in '$declaration_name'\n";
} }
print STDERR "Warning(${file}:$.):". print STDERR "Warning(${file}:$.):".
" No description found for parameter '$param'\n"; " No description found for parameter '$param'\n";
++$warnings; ++$warnings;
} }
} }
push @parameterlist, $param; push @parameterlist, $param;
$parametertypes{$param} = $type; $parametertypes{$param} = $type;
...@@ -1664,10 +1664,10 @@ sub process_state3_function($$) { ...@@ -1664,10 +1664,10 @@ sub process_state3_function($$) {
# do nothing # do nothing
} }
elsif ($x =~ /([^\{]*)/) { elsif ($x =~ /([^\{]*)/) {
$prototype .= $1; $prototype .= $1;
} }
if (($x =~ /\{/) || ($x =~ /\#define/) || ($x =~ /;/)) { if (($x =~ /\{/) || ($x =~ /\#define/) || ($x =~ /;/)) {
$prototype =~ s@/\*.*?\*/@@gos; # strip comments. $prototype =~ s@/\*.*?\*/@@gos; # strip comments.
$prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's. $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
$prototype =~ s@^\s+@@gos; # strip leading spaces $prototype =~ s@^\s+@@gos; # strip leading spaces
dump_function($prototype,$file); dump_function($prototype,$file);
...@@ -1688,17 +1688,17 @@ sub process_state3_type($$) { ...@@ -1688,17 +1688,17 @@ sub process_state3_type($$) {
} }
while (1) { while (1) {
if ( $x =~ /([^{};]*)([{};])(.*)/ ) { if ( $x =~ /([^{};]*)([{};])(.*)/ ) {
$prototype .= $1 . $2; $prototype .= $1 . $2;
($2 eq '{') && $brcount++; ($2 eq '{') && $brcount++;
($2 eq '}') && $brcount--; ($2 eq '}') && $brcount--;
if (($2 eq ';') && ($brcount == 0)) { if (($2 eq ';') && ($brcount == 0)) {
dump_declaration($prototype,$file); dump_declaration($prototype,$file);
reset_state(); reset_state();
last; last;
} }
$x = $3; $x = $3;
} else { } else {
$prototype .= $x; $prototype .= $x;
last; last;
} }
...@@ -1756,7 +1756,7 @@ sub process_file($) { ...@@ -1756,7 +1756,7 @@ sub process_file($) {
} else { } else {
$section = $1; $section = $1;
} }
} }
elsif (/$doc_decl/o) { elsif (/$doc_decl/o) {
$identifier = $1; $identifier = $1;
if (/\s*([\w\s]+?)\s*-/) { if (/\s*([\w\s]+?)\s*-/) {
...@@ -1849,13 +1849,13 @@ sub process_file($) { ...@@ -1849,13 +1849,13 @@ sub process_file($) {
} }
} elsif ($state == 3) { # scanning for function '{' (end of prototype) } elsif ($state == 3) { # scanning for function '{' (end of prototype)
if ($decl_type eq 'function') { if ($decl_type eq 'function') {
process_state3_function($_, $file); process_state3_function($_, $file);
} else { } else {
process_state3_type($_, $file); process_state3_type($_, $file);
} }
} elsif ($state == 4) { } elsif ($state == 4) {
# Documentation block # Documentation block
if (/$doc_block/) { if (/$doc_block/) {
dump_section($section, $contents); dump_section($section, $contents);
output_intro({'sectionlist' => \@sectionlist, output_intro({'sectionlist' => \@sectionlist,
'sections' => \%sections }); 'sections' => \%sections });
...@@ -1873,7 +1873,7 @@ sub process_file($) { ...@@ -1873,7 +1873,7 @@ sub process_file($) {
} else { } else {
$section = $1; $section = $1;
} }
} }
elsif (/$doc_end/) elsif (/$doc_end/)
{ {
dump_section($section, $contents); dump_section($section, $contents);
...@@ -1900,8 +1900,8 @@ sub process_file($) { ...@@ -1900,8 +1900,8 @@ sub process_file($) {
{ {
$contents .= $1 . "\n"; $contents .= $1 . "\n";
} }
} }
} }
} }
if ($initial_section_counter == $section_counter) { if ($initial_section_counter == $section_counter) {
print STDERR "Warning(${file}): no structured comments found\n"; print STDERR "Warning(${file}): no structured comments found\n";
......
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