linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Jani Nikula <jani.nikula@intel.com>,
	Markus Heiser <markus.heiser@darmarit.de>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Grant Likely <grant.likely@secretlab.ca>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Keith Packard <keithp@keithp.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-doc@vger.kernel.org, Hans Verkuil <hverkuil@xs4all.nl>
Subject: [docs-next PATCH 4/9] kernel-doc: abstract filename mapping
Date: Fri, 10 Jun 2016 17:16:58 +0300	[thread overview]
Message-ID: <1ad560e43c911e19751df65dd2af21341d02eac5.1465567017.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1465567017.git.jani.nikula@intel.com>
In-Reply-To: <cover.1465567017.git.jani.nikula@intel.com>

Reduce duplication in follow-up work. No functional changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 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

  parent reply	other threads:[~2016-06-10 14:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 14:16 [docs-next PATCH 0/9] Documentation/sphinx follow-up Jani Nikula
2016-06-10 14:16 ` [docs-next PATCH 1/9] kernel-doc: remove old debug cruft from dump_section() Jani Nikula
2016-06-10 14:16 ` [docs-next PATCH 2/9] kernel-doc: do not warn about duplicate default section names Jani Nikula
2016-06-10 14:16 ` [docs-next PATCH 3/9] kernel-doc: add missing semi-colons in option parsing Jani Nikula
2016-06-10 14:16 ` Jani Nikula [this message]
2016-06-10 14:16 ` [docs-next PATCH 5/9] kernel-doc: add support for specifying extra files for EXPORT_SYMBOLs Jani Nikula
2016-06-10 14:17 ` [docs-next PATCH 6/9] kernel-doc: unify all EXPORT_SYMBOL scanning to one place Jani Nikula
2016-06-10 14:17 ` [docs-next PATCH 7/9] Documentation/sphinx: remove unnecessary temporary variable Jani Nikula
2016-06-10 14:17 ` [docs-next PATCH 8/9] Documentation/sphinx: use a more sensible string split in kernel-doc extension Jani Nikula
2016-06-10 14:17 ` [docs-next PATCH 9/9] Documentation/sphinx: add support for specifying extra export files Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ad560e43c911e19751df65dd2af21341d02eac5.1465567017.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=corbet@lwn.net \
    --cc=daniel.vetter@ffwll.ch \
    --cc=grant.likely@secretlab.ca \
    --cc=hverkuil@xs4all.nl \
    --cc=keithp@keithp.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.heiser@darmarit.de \
    --cc=mchehab@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).