[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20070507111311.443719f7.randy.dunlap@oracle.com>
Date: Mon, 7 May 2007 11:13:11 -0700
From: Randy Dunlap <randy.dunlap@...cle.com>
To: lkml <linux-kernel@...r.kernel.org>,
akpm <akpm@...ux-foundation.org>
Cc: Borislav Petkov <bbpetkov@...oo.de>
Subject: [PATCH] kernel-doc: small kernel-doc optimization
From: Borislav Petkov <bbpetkov@...oo.de>
Get the kernel version string only once from the environment, thus slightly
speeding up kernel-doc.
Signed-off-by: Borislav Petkov <bbpetkov@...oo.de>
Signed-off-by: Randy Dunlap <randy.dunlap@...cle.com>
---
scripts/kernel-doc | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- linux-2621-mm1.orig/scripts/kernel-doc
+++ linux-2621-mm1/scripts/kernel-doc
@@ -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.
@@ -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";
@@ -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";
@@ -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";
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists