From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932538AbcFJORi (ORCPT ); Fri, 10 Jun 2016 10:17:38 -0400 Received: from mga09.intel.com ([134.134.136.24]:2552 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932437AbcFJORe (ORCPT ); Fri, 10 Jun 2016 10:17:34 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,450,1459839600"; d="scan'208";a="999326850" From: Jani Nikula To: Jonathan Corbet Cc: Jani Nikula , Markus Heiser , Daniel Vetter , Grant Likely , Mauro Carvalho Chehab , Keith Packard , LKML , linux-doc@vger.kernel.org, Hans Verkuil Subject: [docs-next PATCH 4/9] kernel-doc: abstract filename mapping Date: Fri, 10 Jun 2016 17:16:58 +0300 Message-Id: <1ad560e43c911e19751df65dd2af21341d02eac5.1465567017.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reduce duplication in follow-up work. No functional changes. Signed-off-by: Jani Nikula --- scripts/kernel-doc | 27 ++++++++++++++++++--------- 1 file 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; -- 2.1.4