Skip to content

Commit

Permalink
kernel-doc: small kernel-doc optimization
Browse files Browse the repository at this point in the history
Get the kernel version string only once from the environment, thus slightly
speeding up kernel-doc.

Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Randy Dunlap <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Borislav Petkov authored and Linus Torvalds committed May 9, 2007
1 parent 66effdc commit 0366299
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/kernel-doc
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ sub get_kernel_version() {
}
return $version;
}
my $kernelversion = get_kernel_version();

# generate a sequence of code that will splice in highlighting information
# using the s// operator.
Expand Down Expand Up @@ -610,7 +611,7 @@ sub output_function_xml(%) {
print "<refmeta>\n";
print " <refentrytitle><phrase>".$args{'function'}."</phrase></refentrytitle>\n";
print " <manvolnum>9</manvolnum>\n";
print " <refmiscinfo class=\"version\">" . get_kernel_version() . "</refmiscinfo>\n";
print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
print "</refmeta>\n";
print "<refnamediv>\n";
print " <refname>".$args{'function'}."</refname>\n";
Expand Down Expand Up @@ -687,7 +688,7 @@ sub output_struct_xml(%) {
print "<refmeta>\n";
print " <refentrytitle><phrase>".$args{'type'}." ".$args{'struct'}."</phrase></refentrytitle>\n";
print " <manvolnum>9</manvolnum>\n";
print " <refmiscinfo class=\"version\">" . get_kernel_version() . "</refmiscinfo>\n";
print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
print "</refmeta>\n";
print "<refnamediv>\n";
print " <refname>".$args{'type'}." ".$args{'struct'}."</refname>\n";
Expand Down Expand Up @@ -772,7 +773,7 @@ sub output_enum_xml(%) {
print "<refmeta>\n";
print " <refentrytitle><phrase>enum ".$args{'enum'}."</phrase></refentrytitle>\n";
print " <manvolnum>9</manvolnum>\n";
print " <refmiscinfo class=\"version\">" . get_kernel_version() . "</refmiscinfo>\n";
print " <refmiscinfo class=\"version\">" . $kernelversion . "</refmiscinfo>\n";
print "</refmeta>\n";
print "<refnamediv>\n";
print " <refname>enum ".$args{'enum'}."</refname>\n";
Expand Down

0 comments on commit 0366299

Please sign in to comment.