From patchwork Mon Jul 30 19:43:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 1256311 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 89B81E00C6 for ; Mon, 30 Jul 2012 19:46:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754842Ab2G3TpE (ORCPT ); Mon, 30 Jul 2012 15:45:04 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.122]:19735 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754558Ab2G3TpD (ORCPT ); Mon, 30 Jul 2012 15:45:03 -0400 X-Authority-Analysis: v=2.0 cv=IOWA+3TG c=1 sm=0 a=s5Htg7xnQOKvHEu9STBOug==:17 a=OpT9cpI26MMA:10 a=Ciwy3NGCPMMA:10 a=htdQP7KTs1wA:10 a=5SG0PmZfjMsA:10 a=bbbx4UPp9XUA:10 a=meVymXHHAAAA:8 a=20KFwNOVAAAA:8 a=5abIMfYh5AcOCafACo8A:9 a=QEXdDO2ut3YA:10 a=jEp0ucaQiEUA:10 a=jeBq3FmKZ4MA:10 a=8YtL82kW95GMLmQlbVgA:9 a=s5Htg7xnQOKvHEu9STBOug==:117 X-Cloudmark-Score: 0 X-Originating-IP: 72.230.195.127 Received: from [72.230.195.127] ([72.230.195.127:52001] helo=gandalf.stny.rr.com) by hrndva-oedge02.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 98/4F-02978-E34E6105; Mon, 30 Jul 2012 19:45:02 +0000 Received: from rostedt by gandalf.stny.rr.com with local (Exim 4.80) (envelope-from ) id 1Svvtl-0002xO-OD; Mon, 30 Jul 2012 15:45:01 -0400 Message-Id: <20120730194501.681442369@goodmis.org> User-Agent: quilt/0.60-1 Date: Mon, 30 Jul 2012 15:43:17 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Linus Torvalds Subject: [PATCH 1/4] localmodconfig: Comments and cleanup for streamline_config.pl References: <20120730194316.768288008@goodmis.org> Content-Disposition: inline; filename=0001-localmodconfig-Comments-and-cleanup-for-streamline_c.patch Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org From: Steven Rostedt 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 --- 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 () { 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})) {