aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kernel-doc
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2016-06-07 03:53:39 -0400
committerJani Nikula <jani.nikula@intel.com>2016-06-10 04:29:19 -0400
commit1ad560e43c911e19751df65dd2af21341d02eac5 (patch)
treec456738cec086620be8e288c367718dcd44fa53d /scripts/kernel-doc
parentda9726ecfba202514d984129c3537b028519cdb8 (diff)
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-xscripts/kernel-doc27
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($) {
2730 return $text; 2730 return $text;
2731} 2731}
2732 2732
2733sub process_file($) { 2733sub map_filename($) {
2734 my $file; 2734 my $file;
2735 my $identifier;
2736 my $func;
2737 my $descr;
2738 my $in_purpose = 0;
2739 my $initial_section_counter = $section_counter;
2740 my ($orig_file) = @_; 2735 my ($orig_file) = @_;
2741 my $leading_space;
2742 2736
2743 if (defined($ENV{'SRCTREE'})) { 2737 if (defined($ENV{'SRCTREE'})) {
2744 $file = "$ENV{'SRCTREE'}" . "/" . $orig_file; 2738 $file = "$ENV{'SRCTREE'}" . "/" . $orig_file;
2745 } 2739 } else {
2746 else {
2747 $file = $orig_file; 2740 $file = $orig_file;
2748 } 2741 }
2742
2749 if (defined($source_map{$file})) { 2743 if (defined($source_map{$file})) {
2750 $file = $source_map{$file}; 2744 $file = $source_map{$file};
2751 } 2745 }
2752 2746
2747 return $file;
2748}
2749
2750sub process_file($) {
2751 my $file;
2752 my $identifier;
2753 my $func;
2754 my $descr;
2755 my $in_purpose = 0;
2756 my $initial_section_counter = $section_counter;
2757 my ($orig_file) = @_;
2758 my $leading_space;
2759
2760 $file = map_filename($orig_file);
2761
2753 if (!open(IN,"<$file")) { 2762 if (!open(IN,"<$file")) {
2754 print STDERR "Error: Cannot open file $file\n"; 2763 print STDERR "Error: Cannot open file $file\n";
2755 ++$errors; 2764 ++$errors;