diff options
author | Jani Nikula <jani.nikula@intel.com> | 2016-06-07 09:53:39 +0200 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2016-06-10 10:29:19 +0200 |
commit | 1ad560e43c911e19751df65dd2af21341d02eac5 (patch) | |
tree | c456738cec086620be8e288c367718dcd44fa53d /scripts/kernel-doc | |
parent | kernel-doc: add missing semi-colons in option parsing (diff) | |
download | linux-1ad560e43c911e19751df65dd2af21341d02eac5.tar.xz linux-1ad560e43c911e19751df65dd2af21341d02eac5.zip |
kernel-doc: abstract filename mapping
Reduce duplication in follow-up work. No functional changes.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'scripts/kernel-doc')
-rwxr-xr-x | scripts/kernel-doc | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index a6f82c812c15..516d95fcefb7 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -2730,26 +2730,35 @@ sub local_unescape($) { return $text; } -sub process_file($) { +sub map_filename($) { my $file; - my $identifier; - my $func; - my $descr; - my $in_purpose = 0; - my $initial_section_counter = $section_counter; my ($orig_file) = @_; - my $leading_space; if (defined($ENV{'SRCTREE'})) { $file = "$ENV{'SRCTREE'}" . "/" . $orig_file; - } - else { + } else { $file = $orig_file; } + if (defined($source_map{$file})) { $file = $source_map{$file}; } + return $file; +} + +sub process_file($) { + my $file; + my $identifier; + my $func; + my $descr; + my $in_purpose = 0; + my $initial_section_counter = $section_counter; + my ($orig_file) = @_; + my $leading_space; + + $file = map_filename($orig_file); + if (!open(IN,"<$file")) { print STDERR "Error: Cannot open file $file\n"; ++$errors; |