public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Hunter <david.hunter.linux@gmail.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: David Hunter <david.hunter.linux@gmail.com>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	shuah@kernel.org, javier.carrasco.cruz@gmail.com,
	Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH v2 6/7] streamline_config.pl: process config options set to "y"
Date: Mon, 14 Oct 2024 10:13:36 -0400	[thread overview]
Message-ID: <20241014141345.5680-7-david.hunter.linux@gmail.com> (raw)
In-Reply-To: <20241014141345.5680-1-david.hunter.linux@gmail.com>

An assumption made in this script is that the config options do not need
to be processed because they will simply be in the new config file. This
assumption is incorrect.

Process the config entries set to "y" because those config entries might
have dependencies set to "m". If a config entry is set to "m" and is not
loaded directly into the machine, the script will currently turn off
that config entry; however, if that turned off config entry is a
dependency for a "y" option. that means the config entry set to "y"
will also be turned off later when the conf executive file is called.

Here is a model of the problem (arrows show dependency):

Original config file
Config_1 (m) <-- Config_2 (y)

Config_1 is not loaded in this example, so it is turned off.
After scripts/kconfig/streamline_config.pl, but before scripts/kconfig/conf
Config_1 (n) <-- Config_2 (y)

After  scripts/kconfig/conf
Config_1 (n) <-- Config_2 (n)

It should also be noted that any module in the dependency chain will
also be turned off, even if that module is loaded directly onto the
computer. Here is an example:

Original config file
Config_1 (m) <-- Config_2 (y) <-- Config_3 (m)

Config_3 will be loaded in this example.
After scripts/kconfig/streamline_config.pl, but before scripts/kconfig/conf
Config_1 (n) <-- Config_2 (y) <-- Config_3 (m)

After scripts/kconfig/conf
Config_1 (n) <-- Config_2 (n) <-- Config_3 (n)

Signed-off-by: David Hunter <david.hunter.linux@gmail.com>
---
V1 https://lore.kernel.org/all/20240913171205.22126-8-david.hunter.linux@gmail.com/

V2
        - change subject
        - changed part of the code that only processed config options 
          set to "m" so that config options set to "y" are processed. I
          forgot to put this in v1 when making the series patch.
        - removed an unneccessary condition that would have skipped a
          dependency loop.
---
 scripts/kconfig/streamline_config.pl | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 4149c4b344db..c3b434220c9f 100755
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -473,6 +473,11 @@ foreach my $line (@config_file) {
 
     if (/(CONFIG_[$valid]*)=(m|y)/) {
 	$orig_configs{$1} = $2;
+	# all configs options set to 'y' need to be processed
+	if ($2 eq "y") {
+            $configs{$1}= $2;
+        }
+
     }
 }
 
@@ -499,8 +504,8 @@ sub parse_config_depends
 
 	    $p =~ s/^[^$valid]*[$valid]+//;
 
-	    # We only need to process if the depend config is a module
-	    if (!defined($orig_configs{$conf}) || $orig_configs{$conf} eq "y") {
+	    # Make sure that this config exists in the current .config file
+	    if (!defined($orig_configs{$conf})) {
 		next;
 	    }
 
@@ -600,12 +605,6 @@ sub loop_depend {
 
       forloop:
 	foreach my $config (keys %configs) {
-
-	    # If this config is not a module, we do not need to process it
-	    if (defined($orig_configs{$config}) && $orig_configs{$config} ne "m") {
-		next forloop;
-	    }
-
 	    $config =~ s/^CONFIG_//;
 	    $depconfig = $config;
 
-- 
2.43.0


  parent reply	other threads:[~2024-10-14 14:14 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 14:13 [PATCH v3 0/7] streamline_config.pl: fix: process configs set to "y" David Hunter
2024-10-14 14:13 ` [PATCH v2 1/7] streamline_config.pl: fix missing variable operator in debug print David Hunter
2024-11-05 23:05   ` Masahiro Yamada
2024-10-14 14:13 ` [PATCH v2 2/7] streamline_config.pl: ensure all defaults are tracked David Hunter
2024-10-15 23:09   ` Steven Rostedt
2024-11-05 23:05     ` Masahiro Yamada
2024-11-26 23:48       ` David Hunter
2024-11-27  1:09         ` Steven Rostedt
2024-11-05 23:05   ` Masahiro Yamada
2024-10-14 14:13 ` [PATCH v2 3/7] streamline_config.pl: remove prompt warnings for configs with defaults David Hunter
2024-11-05 23:13   ` Masahiro Yamada
2024-10-14 14:13 ` [PATCH v1 4/7] streamline_config.pl: include tool to learn about a config option David Hunter
2024-11-05 23:15   ` Masahiro Yamada
2024-10-14 14:13 ` [PATCH v2 5/7] streamline_config.pl: fix: implement choice for kconfigs David Hunter
2024-10-17 22:32   ` Steven Rostedt
2024-11-05 23:33   ` Masahiro Yamada
2024-11-27 13:18     ` David Hunter
2024-11-30  9:41       ` Masahiro Yamada
2024-10-14 14:13 ` David Hunter [this message]
2024-10-15 23:20   ` [PATCH v2 6/7] streamline_config.pl: process config options set to "y" Steven Rostedt
2024-11-05 23:44     ` Masahiro Yamada
2024-10-14 14:13 ` [PATCH v2 7/7] streamline_config.pl: check prompt for bool options David Hunter
2024-11-05 23:45   ` Masahiro Yamada
2024-11-27 13:26     ` David Hunter
2024-11-27 22:50       ` Masahiro Yamada
2024-11-28 15:04         ` David Hunter
2024-10-17 22:37 ` [PATCH v3 0/7] streamline_config.pl: fix: process configs set to "y" Steven Rostedt
2024-10-18 14:30   ` Steven Rostedt
2024-11-27 23:05     ` David Hunter
2024-11-27 23:26       ` 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=20241014141345.5680-7-david.hunter.linux@gmail.com \
    --to=david.hunter.linux@gmail.com \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=shuah@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox