Commit 1d7e1d4517f11ebeb80f92e227c8fdbc3215385c
Committed by
Linus Torvalds
1 parent
dd535a5965
Exists in
master
and in
20 other branches
[PATCH] kernel-doc: consistent text/man mode output
Add a space between data type and struct field name in man-mode bitfield struct output so that they don't run together. For text-mode struct output, print the struct 'purpose' or short description (as done in man-mode output). For text-mode enum output, print the enum 'purpose' or short description (as done in man-mode output). For text-mode typedef output, print the typedef 'purpose' or short description (as done in man-mode output). 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 5 additions and 3 deletions Side-by-side Diff
scripts/kernel-doc
... | ... | @@ -1056,7 +1056,8 @@ |
1056 | 1056 | # pointer-to-function |
1057 | 1057 | print ".BI \" ".$1."\" ".$parameter." \") (".$2.")"."\"\n;\n"; |
1058 | 1058 | } elsif ($type =~ m/^(.*?)\s*(:.*)/) { |
1059 | - print ".BI \" ".$1."\" ".$parameter.$2." \""."\"\n;\n"; | |
1059 | + # bitfield | |
1060 | + print ".BI \" ".$1."\ \" ".$parameter.$2." \""."\"\n;\n"; | |
1060 | 1061 | } else { |
1061 | 1062 | $type =~ s/([^\*])$/$1 /; |
1062 | 1063 | print ".BI \" ".$type."\" ".$parameter." \""."\"\n;\n"; |
... | ... | @@ -1169,6 +1170,7 @@ |
1169 | 1170 | my $count; |
1170 | 1171 | print "Enum:\n\n"; |
1171 | 1172 | |
1173 | + print "enum ".$args{'enum'}." - ".$args{'purpose'}."\n\n"; | |
1172 | 1174 | print "enum ".$args{'enum'}." {\n"; |
1173 | 1175 | $count = 0; |
1174 | 1176 | foreach $parameter (@{$args{'parameterlist'}}) { |
... | ... | @@ -1197,7 +1199,7 @@ |
1197 | 1199 | my $count; |
1198 | 1200 | print "Typedef:\n\n"; |
1199 | 1201 | |
1200 | - print "typedef ".$args{'typedef'}."\n"; | |
1202 | + print "typedef ".$args{'typedef'}." - ".$args{'purpose'}."\n"; | |
1201 | 1203 | output_section_text(@_); |
1202 | 1204 | } |
1203 | 1205 | |
... | ... | @@ -1206,7 +1208,7 @@ |
1206 | 1208 | my %args = %{$_[0]}; |
1207 | 1209 | my ($parameter); |
1208 | 1210 | |
1209 | - print $args{'type'}." ".$args{'struct'}.":\n\n"; | |
1211 | + print $args{'type'}." ".$args{'struct'}." - ".$args{'purpose'}."\n\n"; | |
1210 | 1212 | print $args{'type'}." ".$args{'struct'}." {\n"; |
1211 | 1213 | foreach $parameter (@{$args{'parameterlist'}}) { |
1212 | 1214 | if ($parameter =~ /^#/) { |