Commit 27205744 authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[PATCH] kernel-doc: make parameter description indentation uniform

- In parameter descriptions, strip all whitespace between the parameter
  name (e.g., @len) and its description so that the description is
  indented uniformly in text and man page modes.  Previously, spaces
  or tabs (which are used for cleaner source code viewing) affected
  the produced output in a negative way.

Before (man mode):
       to            Destination address, in user space.
       from        Source address, in kernel space.
       n              Number of bytes to copy.

After (man mode):
       to          Destination address, in user space.
       from        Source address, in kernel space.
       n           Number of bytes to copy.

- Fix/clarify a few function description comments.
Signed-off-by: default avatarRandy Dunlap <rdunlap@xenotime.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c751c1db
...@@ -1262,7 +1262,9 @@ sub output_intro_text(%) { ...@@ -1262,7 +1262,9 @@ sub output_intro_text(%) {
} }
## ##
# generic output function for typedefs # generic output function for all types (function, struct/union, typedef, enum);
# calls the generated, variable output_ function name based on
# functype and output_mode
sub output_declaration { sub output_declaration {
no strict 'refs'; no strict 'refs';
my $name = shift; my $name = shift;
...@@ -1278,8 +1280,7 @@ sub output_declaration { ...@@ -1278,8 +1280,7 @@ sub output_declaration {
} }
## ##
# generic output function - calls the right one based # generic output function - calls the right one based on current output mode.
# on current output mode.
sub output_intro { sub output_intro {
no strict 'refs'; no strict 'refs';
my $func = "output_intro_".$output_mode; my $func = "output_intro_".$output_mode;
...@@ -1781,7 +1782,8 @@ sub process_file($) { ...@@ -1781,7 +1782,8 @@ sub process_file($) {
$in_doc_sect = 1; $in_doc_sect = 1;
$contents = $newcontents; $contents = $newcontents;
if ($contents ne "") { if ($contents ne "") {
if (substr($contents, 0, 1) eq " ") { while ((substr($contents, 0, 1) eq " ") ||
substr($contents, 0, 1) eq "\t") {
$contents = substr($contents, 1); $contents = substr($contents, 1);
} }
$contents .= "\n"; $contents .= "\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