Commit 272057447f646c51bc77c60044eb21c683fa366d

Authored by Randy Dunlap
Committed by Linus Torvalds
1 parent c751c1dbb1

[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: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 7 additions and 5 deletions Side-by-side Diff

... ... @@ -1262,7 +1262,9 @@
1262 1262 }
1263 1263  
1264 1264 ##
1265   -# generic output function for typedefs
  1265 +# generic output function for all types (function, struct/union, typedef, enum);
  1266 +# calls the generated, variable output_ function name based on
  1267 +# functype and output_mode
1266 1268 sub output_declaration {
1267 1269 no strict 'refs';
1268 1270 my $name = shift;
... ... @@ -1278,8 +1280,7 @@
1278 1280 }
1279 1281  
1280 1282 ##
1281   -# generic output function - calls the right one based
1282   -# on current output mode.
  1283 +# generic output function - calls the right one based on current output mode.
1283 1284 sub output_intro {
1284 1285 no strict 'refs';
1285 1286 my $func = "output_intro_".$output_mode;
... ... @@ -1781,8 +1782,9 @@
1781 1782 $in_doc_sect = 1;
1782 1783 $contents = $newcontents;
1783 1784 if ($contents ne "") {
1784   - if (substr($contents, 0, 1) eq " ") {
1785   - $contents = substr($contents, 1);
  1785 + while ((substr($contents, 0, 1) eq " ") ||
  1786 + substr($contents, 0, 1) eq "\t") {
  1787 + $contents = substr($contents, 1);
1786 1788 }
1787 1789 $contents .= "\n";
1788 1790 }