From patchwork Mon Apr 29 19:51:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 2502391 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 87F1E3FD1A for ; Mon, 29 Apr 2013 19:52:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932225Ab3D2TwH (ORCPT ); Mon, 29 Apr 2013 15:52:07 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.122]:33571 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759119Ab3D2TwF (ORCPT ); Mon, 29 Apr 2013 15:52:05 -0400 X-Authority-Analysis: v=2.0 cv=GtrACzJC c=1 sm=0 a=rXTBtCOcEpjy1lPqhTCpEQ==:17 a=mNMOxpOpBa8A:10 a=Ciwy3NGCPMMA:10 a=iIjuBAqTbCMA:10 a=5SG0PmZfjMsA:10 a=bbbx4UPp9XUA:10 a=meVymXHHAAAA:8 a=10e-2EioWqEA:10 a=VwQbUJbxAAAA:8 a=MaTfSPlqobeUgB7gn_QA:9 a=QEXdDO2ut3YA:10 a=jeBq3FmKZ4MA:10 a=9sHArSNYffL3UlbgPaYA:9 a=rXTBtCOcEpjy1lPqhTCpEQ==:117 X-Cloudmark-Score: 0 X-Authenticated-User: X-Originating-IP: 74.67.115.198 Received: from [74.67.115.198] ([74.67.115.198:52778] helo=gandalf.local.home) by hrndva-oedge02.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 77/FC-22134-26FCE715; Mon, 29 Apr 2013 19:52:02 +0000 Received: from rostedt by gandalf.local.home with local (Exim 4.80) (envelope-from ) id 1UWu7F-00021G-Of; Mon, 29 Apr 2013 15:52:01 -0400 Message-Id: <20130429195201.690687280@goodmis.org> User-Agent: quilt/0.60-1 Date: Mon, 29 Apr 2013 15:51:02 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Linux Kbuild mailing list , , "Robert P. J. Day" Subject: [PATCH 2/2] localmodconfig: Process source kconfig files as they are found References: <20130429195100.202681236@goodmis.org> Content-Disposition: inline; filename=0002-localmodconfig-Process-source-kconfig-files-as-they-.patch Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org From: Steven Rostedt A bug was reported that caused localmodconfig to not keep all the dependencies of ATH9K. This was caused by the kconfig file: In drivers/net/wireless/ath/Kconfig: --- if ATH_CARDS config ATH_DEBUG bool "Atheros wireless debugging" ---help--- Say Y, if you want to debug atheros wireless drivers. Right now only ath9k makes use of this. source "drivers/net/wireless/ath/ath5k/Kconfig" source "drivers/net/wireless/ath/ath9k/Kconfig" source "drivers/net/wireless/ath/carl9170/Kconfig" source "drivers/net/wireless/ath/ath6kl/Kconfig" source "drivers/net/wireless/ath/ar5523/Kconfig" source "drivers/net/wireless/ath/wil6210/Kconfig" endif --- The current way kconfig works, it processes new source files after the first file is completed. It creates an array of new source config files and when the one file is finished, it continues with the next file. Unfortunately, this means that it loses the fact that the source file is within an "if" statement, and this means that each of these source file's configs will not have the proper dependencies set. As ATH9K requires ATH_CARDS set, the localmodconfig did not see that dependency, and did not enable ATH_CARDS. When the oldconfig was run, it forced ATH9K to be disabled. Link: http://lkml.kernel.org/r/alpine.DEB.2.02.1304291022320.9234@oneiric Cc: stable@vger.kernel.org # 3.8+ Reported-by: Robert P. J. Day Tested-by: Robert P. J. Day Signed-off-by: Steven Rostedt --- scripts/kconfig/streamline_config.pl | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index 343a568..4606cdf 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -156,7 +156,6 @@ sub read_kconfig { my $state = "NONE"; my $config; - my @kconfigs; my $cont = 0; my $line; @@ -190,7 +189,13 @@ sub read_kconfig { # collect any Kconfig sources if (/^source\s*"(.*)"/) { - $kconfigs[$#kconfigs+1] = $1; + my $kconfig = $1; + # prevent reading twice. + if (!defined($read_kconfigs{$kconfig})) { + $read_kconfigs{$kconfig} = 1; + read_kconfig($kconfig); + } + next; } # configs found @@ -250,14 +255,6 @@ sub read_kconfig { } } close($kinfile); - - # read in any configs that were found. - foreach my $kconfig (@kconfigs) { - if (!defined($read_kconfigs{$kconfig})) { - $read_kconfigs{$kconfig} = 1; - read_kconfig($kconfig); - } - } } if ($kconfig) {