From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Cc: John David Yost <johnyost@ptd.net>
Subject: [PATCH 1/4] localmodconfig: Comments and cleanup for streamline_config.pl
Date: Tue, 19 Jun 2012 22:06:09 -0400 [thread overview]
Message-ID: <20120620025004.191014401@goodmis.org> (raw)
In-Reply-To: 20120620020608.911616775@goodmis.org
[-- Attachment #1: Type: text/plain, Size: 2061 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
Added some more comments and cleaned up part of the the code to use
a named variable instead of one of the special $1 perl variables.
No functional changes.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
scripts/kconfig/streamline_config.pl | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index bccf07dd..5c1ce87 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -186,6 +186,7 @@ sub read_kconfig {
$state = "NEW";
$config = $2;
+ # Add depends for 'if' nesting
for (my $i = 0; $i < $iflevel; $i++) {
if ($i) {
$depends{$config} .= " " . $ifdeps[$i];
@@ -204,10 +205,11 @@ sub read_kconfig {
# Get the configs that select this config
} elsif ($state ne "NONE" && /^\s*select\s+(\S+)/) {
- if (defined($selects{$1})) {
- $selects{$1} .= " " . $config;
+ my $conf = $1;
+ if (defined($selects{$conf})) {
+ $selects{$conf} .= " " . $config;
} else {
- $selects{$1} = $config;
+ $selects{$conf} = $config;
}
# configs without prompts must be selected
@@ -250,6 +252,7 @@ if ($kconfig) {
read_kconfig($kconfig);
}
+# Makefiles can use variables to define their dependencies
sub convert_vars {
my ($line, %vars) = @_;
@@ -293,6 +296,7 @@ foreach my $makefile (@makefiles) {
my $objs;
+ # Convert variables in a line (could define configs)
$_ = convert_vars($_, %make_vars);
# collect objects after obj-$(CONFIG_FOO_BAR)
@@ -373,7 +377,8 @@ while (<LIN>) {
close (LIN);
# add to the configs hash all configs that are needed to enable
-# a loaded module.
+# a loaded module. This is a direct obj-${CONFIG_FOO} += bar.o
+# where we know we need bar.o so we add FOO to the list.
my %configs;
foreach my $module (keys(%modules)) {
if (defined($objects{$module})) {
--
1.7.10
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-06-20 2:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-20 2:06 [PATCH 0/4] localmodconfig: Improve the number of modules removed Steven Rostedt
2012-06-20 2:06 ` Steven Rostedt [this message]
2012-06-20 2:06 ` [PATCH 2/4] localmodconfig: Read in orig config file to avoid extra processing Steven Rostedt
2012-06-20 2:06 ` Steven Rostedt
2012-06-20 2:06 ` [PATCH 3/4] localmodconfig: Check if configs are already set for selects Steven Rostedt
2012-06-20 2:06 ` [PATCH 4/4] localmodconfig: Add debug environment variable LOCALMODCONFIG_DEBUG Steven Rostedt
-- strict thread matches above, loose matches on Subject: below --
2012-07-30 19:43 [PATCH 0/4] [GIT PULL] localmodconfig: Improve module config removal Steven Rostedt
2012-07-30 19:43 ` [PATCH 1/4] localmodconfig: Comments and cleanup for streamline_config.pl Steven Rostedt
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=20120620025004.191014401@goodmis.org \
--to=rostedt@goodmis.org \
--cc=johnyost@ptd.net \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.