aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kernel-doc
diff options
context:
space:
mode:
authorRandy Dunlap <randy.dunlap@oracle.com>2009-06-09 11:50:38 -0400
committerSam Ravnborg <sam@ravnborg.org>2009-06-09 17:02:30 -0400
commitb9d97328e27b9272ed2ff2ad18de61aa1bf12af8 (patch)
tree1b5ec2ded4c266846c499958a38b2259c605f656 /scripts/kernel-doc
parentef53dae8658cf0e93d380983824a661067948d87 (diff)
kernel-doc: cleanup perl script
Various cleanups of scripts/kernel-doc: - don't use **/ as an ending kernel-doc block since it's not preferred; - typos/spellos - add whitespace around ==, after comma, & around . operator; Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-xscripts/kernel-doc174
1 files changed, 87 insertions, 87 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 3208a3a7e7fe..5c58478eb914 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -5,7 +5,7 @@ use strict;
5## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## 5## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
6## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ## 6## Copyright (C) 2000, 1 Tim Waugh <twaugh@redhat.com> ##
7## Copyright (C) 2001 Simon Huggins ## 7## Copyright (C) 2001 Simon Huggins ##
8## Copyright (C) 2005-2008 Randy Dunlap ## 8## Copyright (C) 2005-2009 Randy Dunlap ##
9## ## 9## ##
10## #define enhancements by Armin Kuster <akuster@mvista.com> ## 10## #define enhancements by Armin Kuster <akuster@mvista.com> ##
11## Copyright (c) 2000 MontaVista Software, Inc. ## 11## Copyright (c) 2000 MontaVista Software, Inc. ##
@@ -85,7 +85,7 @@ use strict;
85# 85#
86# /** 86# /**
87# * my_function 87# * my_function
88# **/ 88# */
89# 89#
90# If the Description: header tag is omitted, then there must be a blank line 90# If the Description: header tag is omitted, then there must be a blank line
91# after the last parameter specification. 91# after the last parameter specification.
@@ -105,7 +105,7 @@ use strict;
105# */ 105# */
106# etc. 106# etc.
107# 107#
108# Beside functions you can also write documentation for structs, unions, 108# Besides functions you can also write documentation for structs, unions,
109# enums and typedefs. Instead of the function name you must write the name 109# enums and typedefs. Instead of the function name you must write the name
110# of the declaration; the struct/union/enum/typedef must always precede 110# of the declaration; the struct/union/enum/typedef must always precede
111# the name. Nesting of declarations is not supported. 111# the name. Nesting of declarations is not supported.
@@ -223,7 +223,7 @@ sub usage {
223} 223}
224 224
225# read arguments 225# read arguments
226if ($#ARGV==-1) { 226if ($#ARGV == -1) {
227 usage(); 227 usage();
228} 228}
229 229
@@ -240,12 +240,12 @@ my $man_date = ('January', 'February', 'March', 'April', 'May', 'June',
240 " " . ((localtime)[5]+1900); 240 " " . ((localtime)[5]+1900);
241 241
242# Essentially these are globals 242# Essentially these are globals
243# They probably want to be tidied up made more localised or summat. 243# They probably want to be tidied up, made more localised or something.
244# CAVEAT EMPTOR! Some of the others I localised may not want to be which 244# CAVEAT EMPTOR! Some of the others I localised may not want to be, which
245# could cause "use of undefined value" or other bugs. 245# could cause "use of undefined value" or other bugs.
246my ($function, %function_table,%parametertypes,$declaration_purpose); 246my ($function, %function_table, %parametertypes, $declaration_purpose);
247my ($type,$declaration_name,$return_type); 247my ($type, $declaration_name, $return_type);
248my ($newsection,$newcontents,$prototype,$filelist, $brcount, %source_map); 248my ($newsection, $newcontents, $prototype, $filelist, $brcount, %source_map);
249 249
250if (defined($ENV{'KBUILD_VERBOSE'})) { 250if (defined($ENV{'KBUILD_VERBOSE'})) {
251 $verbose = "$ENV{'KBUILD_VERBOSE'}"; 251 $verbose = "$ENV{'KBUILD_VERBOSE'}";
@@ -279,10 +279,10 @@ my $doc_special = "\@\%\$\&";
279my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start. 279my $doc_start = '^/\*\*\s*$'; # Allow whitespace at end of comment start.
280my $doc_end = '\*/'; 280my $doc_end = '\*/';
281my $doc_com = '\s*\*\s*'; 281my $doc_com = '\s*\*\s*';
282my $doc_decl = $doc_com.'(\w+)'; 282my $doc_decl = $doc_com . '(\w+)';
283my $doc_sect = $doc_com.'(['.$doc_special.']?[\w\s]+):(.*)'; 283my $doc_sect = $doc_com . '([' . $doc_special . ']?[\w\s]+):(.*)';
284my $doc_content = $doc_com.'(.*)'; 284my $doc_content = $doc_com . '(.*)';
285my $doc_block = $doc_com.'DOC:\s*(.*)?'; 285my $doc_block = $doc_com . 'DOC:\s*(.*)?';
286 286
287my %constants; 287my %constants;
288my %parameterdescs; 288my %parameterdescs;
@@ -485,12 +485,12 @@ sub output_enum_html(%) {
485 my %args = %{$_[0]}; 485 my %args = %{$_[0]};
486 my ($parameter); 486 my ($parameter);
487 my $count; 487 my $count;
488 print "<h2>enum ".$args{'enum'}."</h2>\n"; 488 print "<h2>enum " . $args{'enum'} . "</h2>\n";
489 489
490 print "<b>enum ".$args{'enum'}."</b> {<br>\n"; 490 print "<b>enum " . $args{'enum'} . "</b> {<br>\n";
491 $count = 0; 491 $count = 0;
492 foreach $parameter (@{$args{'parameterlist'}}) { 492 foreach $parameter (@{$args{'parameterlist'}}) {
493 print " <b>".$parameter."</b>"; 493 print " <b>" . $parameter . "</b>";
494 if ($count != $#{$args{'parameterlist'}}) { 494 if ($count != $#{$args{'parameterlist'}}) {
495 $count++; 495 $count++;
496 print ",\n"; 496 print ",\n";
@@ -502,7 +502,7 @@ sub output_enum_html(%) {
502 print "<h3>Constants</h3>\n"; 502 print "<h3>Constants</h3>\n";
503 print "<dl>\n"; 503 print "<dl>\n";
504 foreach $parameter (@{$args{'parameterlist'}}) { 504 foreach $parameter (@{$args{'parameterlist'}}) {
505 print "<dt><b>".$parameter."</b>\n"; 505 print "<dt><b>" . $parameter . "</b>\n";
506 print "<dd>"; 506 print "<dd>";
507 output_highlight($args{'parameterdescs'}{$parameter}); 507 output_highlight($args{'parameterdescs'}{$parameter});
508 } 508 }
@@ -516,9 +516,9 @@ sub output_typedef_html(%) {
516 my %args = %{$_[0]}; 516 my %args = %{$_[0]};
517 my ($parameter); 517 my ($parameter);
518 my $count; 518 my $count;
519 print "<h2>typedef ".$args{'typedef'}."</h2>\n"; 519 print "<h2>typedef " . $args{'typedef'} . "</h2>\n";
520 520
521 print "<b>typedef ".$args{'typedef'}."</b>\n"; 521 print "<b>typedef " . $args{'typedef'} . "</b>\n";
522 output_section_html(@_); 522 output_section_html(@_);
523 print "<hr>\n"; 523 print "<hr>\n";
524} 524}
@@ -528,8 +528,8 @@ sub output_struct_html(%) {
528 my %args = %{$_[0]}; 528 my %args = %{$_[0]};
529 my ($parameter); 529 my ($parameter);
530 530
531 print "<h2>".$args{'type'}." ".$args{'struct'}. " - " .$args{'purpose'}."</h2>\n"; 531 print "<h2>" . $args{'type'} . " " . $args{'struct'} . " - " . $args{'purpose'} . "</h2>\n";
532 print "<b>".$args{'type'}." ".$args{'struct'}."</b> {<br>\n"; 532 print "<b>" . $args{'type'} . " " . $args{'struct'} . "</b> {<br>\n";
533 foreach $parameter (@{$args{'parameterlist'}}) { 533 foreach $parameter (@{$args{'parameterlist'}}) {
534 if ($parameter =~ /^#/) { 534 if ($parameter =~ /^#/) {
535 print "$parameter<br>\n"; 535 print "$parameter<br>\n";
@@ -561,7 +561,7 @@ sub output_struct_html(%) {
561 $parameter_name =~ s/\[.*//; 561 $parameter_name =~ s/\[.*//;
562 562
563 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 563 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
564 print "<dt><b>".$parameter."</b>\n"; 564 print "<dt><b>" . $parameter . "</b>\n";
565 print "<dd>"; 565 print "<dd>";
566 output_highlight($args{'parameterdescs'}{$parameter_name}); 566 output_highlight($args{'parameterdescs'}{$parameter_name});
567 } 567 }
@@ -576,9 +576,9 @@ sub output_function_html(%) {
576 my ($parameter, $section); 576 my ($parameter, $section);
577 my $count; 577 my $count;
578 578
579 print "<h2>" .$args{'function'}." - ".$args{'purpose'}."</h2>\n"; 579 print "<h2>" . $args{'function'} . " - " . $args{'purpose'} . "</h2>\n";
580 print "<i>".$args{'functiontype'}."</i>\n"; 580 print "<i>" . $args{'functiontype'} . "</i>\n";
581 print "<b>".$args{'function'}."</b>\n"; 581 print "<b>" . $args{'function'} . "</b>\n";
582 print "("; 582 print "(";
583 $count = 0; 583 $count = 0;
584 foreach $parameter (@{$args{'parameterlist'}}) { 584 foreach $parameter (@{$args{'parameterlist'}}) {
@@ -587,7 +587,7 @@ sub output_function_html(%) {
587 # pointer-to-function 587 # pointer-to-function
588 print "<i>$1</i><b>$parameter</b>) <i>($2)</i>"; 588 print "<i>$1</i><b>$parameter</b>) <i>($2)</i>";
589 } else { 589 } else {
590 print "<i>".$type."</i> <b>".$parameter."</b>"; 590 print "<i>" . $type . "</i> <b>" . $parameter . "</b>";
591 } 591 }
592 if ($count != $#{$args{'parameterlist'}}) { 592 if ($count != $#{$args{'parameterlist'}}) {
593 $count++; 593 $count++;
@@ -603,7 +603,7 @@ sub output_function_html(%) {
603 $parameter_name =~ s/\[.*//; 603 $parameter_name =~ s/\[.*//;
604 604
605 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next; 605 ($args{'parameterdescs'}{$parameter_name} ne $undescribed) || next;
606 print "<dt><b>".$parameter."</b>\n"; 606 print "<dt><b>" . $parameter . "</b>\n";
607 print "<dd>"; 607 print "<dd>";
608 output_highlight($args{'parameterdescs'}{$parameter_name});