diff mbox series

[3/7] linux-kbuild: fix: ensure all defaults are tracked

Message ID 20240913171205.22126-4-david.hunter.linux@gmail.com (mailing list archive)
State New
Headers show
Series [1/7] linux-kbuild: fix: config option can be bool | expand

Commit Message

David Hunter Sept. 13, 2024, 5:11 p.m. UTC
Track default options on the second line. On the second line of some
config entries, default and depndency options sometimes appear. In those
instances, the state will be "NEW" and not "DEP".

Signed-off-by: David Hunter <david.hunter.linux@gmail.com>
---
 scripts/kconfig/streamline_config.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Masahiro Yamada Sept. 24, 2024, 3:06 a.m. UTC | #1
Same for the commit subject.



On Sat, Sep 14, 2024 at 2:12 AM David Hunter
<david.hunter.linux@gmail.com> wrote:
>
> Track default options on the second line. On the second line of some
> config entries, default and depndency options sometimes appear. In those
> instances, the state will be "NEW" and not "DEP".
>
> Signed-off-by: David Hunter <david.hunter.linux@gmail.com>
> ---
>  scripts/kconfig/streamline_config.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
> index ddc630f2264a..bb1f19a1ab5e 100755
> --- a/scripts/kconfig/streamline_config.pl
> +++ b/scripts/kconfig/streamline_config.pl
> @@ -220,7 +220,7 @@ sub read_kconfig {
>             $depends{$config} = $1;
>         } elsif ($state eq "DEP" && /^\s*depends\s+on\s+(.*)$/) {
>             $depends{$config} .= " " . $1;
> -       } elsif ($state eq "DEP" && /^\s*def(_(bool|tristate)|ault)\s+(\S.*)$/) {
> +       } elsif (($state eq "DEP" || $state eq "NEW") && /^\s*def(_(bool|tristate)|ault)\s+(\S.*)$/) {



I agree this is correct, but you can also fix it to
  $state ne "NONE"
This is more consistent with the existing code.


A few lines below, we already have this:

} elsif ($state ne "NONE" && /^\s*((bool|tristate)\s+\S|prompt\b)/) {



This will work unless you introduce a new
state, "CHOICE".

I am not sure if it is necessary.







>             my $dep = $3;
>             if ($dep !~ /^\s*(y|m|n)\s*$/) {
>                 $dep =~ s/.*\sif\s+//;
> --
> 2.43.0
>


--
Best Regards
Masahiro Yamada
David Hunter Oct. 14, 2024, 2:27 p.m. UTC | #2
https://lore.kernel.org/all/20241014141345.5680-3-david.hunter.linux@gmail.com/
diff mbox series

Patch

diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index ddc630f2264a..bb1f19a1ab5e 100755
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -220,7 +220,7 @@  sub read_kconfig {
 	    $depends{$config} = $1;
 	} elsif ($state eq "DEP" && /^\s*depends\s+on\s+(.*)$/) {
 	    $depends{$config} .= " " . $1;
-	} elsif ($state eq "DEP" && /^\s*def(_(bool|tristate)|ault)\s+(\S.*)$/) {
+	} elsif (($state eq "DEP" || $state eq "NEW") && /^\s*def(_(bool|tristate)|ault)\s+(\S.*)$/) {
 	    my $dep = $3;
 	    if ($dep !~ /^\s*(y|m|n)\s*$/) {
 		$dep =~ s/.*\sif\s+//;