diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index a325a0c890dc8e0a49ce4992ca4735ba5b5d1530..e5bf649e516a1d38bb9cc0ebf226b989246d09ac 100755
--- a/scripts/kernel-doc
+++ b/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 "\n";
print " ".$args{'function'}."\n";
print " 9\n";
- print " " . get_kernel_version() . "\n";
+ print " " . $kernelversion . "\n";
print "\n";
print "\n";
print " ".$args{'function'}."\n";
@@ -687,7 +688,7 @@ sub output_struct_xml(%) {
print "\n";
print " ".$args{'type'}." ".$args{'struct'}."\n";
print " 9\n";
- print " " . get_kernel_version() . "\n";
+ print " " . $kernelversion . "\n";
print "\n";
print "\n";
print " ".$args{'type'}." ".$args{'struct'}."\n";
@@ -772,7 +773,7 @@ sub output_enum_xml(%) {
print "\n";
print " enum ".$args{'enum'}."\n";
print " 9\n";
- print " " . get_kernel_version() . "\n";
+ print " " . $kernelversion . "\n";
print "\n";
print "\n";
print " enum ".$args{'enum'}."\n";