diff mbox series

kconfig: Invalidate all symbols after changing to y or m.

Message ID 202002040408.01448ioc013868@www262.sakura.ne.jp (mailing list archive)
State New, archived
Headers show
Series kconfig: Invalidate all symbols after changing to y or m. | expand

Commit Message

Tetsuo Handa Feb. 4, 2020, 4:08 a.m. UTC
Since commit 89b9060987d98833 ("kconfig: Add yes2modconfig and
mod2yesconfig targets.") forgot to clear SYMBOL_VALID bit after
changing to y or m, these targets did not save the changes.
Call sym_clear_all_valid() so that all symbols are revalidated.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
 scripts/kconfig/confdata.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Masahiro Yamada Feb. 5, 2020, 4:42 a.m. UTC | #1
Hi.

On Tue, Feb 4, 2020 at 1:09 PM Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
>
> Since commit 89b9060987d98833 ("kconfig: Add yes2modconfig and
> mod2yesconfig targets.") forgot to clear SYMBOL_VALID bit after
> changing to y or m, these targets did not save the changes.
> Call sym_clear_all_valid() so that all symbols are revalidated.
>
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>


My previous comment:
"sym_add_change_count(1); seems the convention way
to inform kconfig of some options being updated."
was misleading. Sorry.


conf_write() skips symbol invalidation
when conf_get_change() returns non-zero value.

        if (!conf_get_changed())
                sym_clear_all_valid();

I do not know why this if-conditional exists here...

Anyway, this patch fixes the issue.

Applied. Thanks.



> ---
>  scripts/kconfig/confdata.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
> index 11f6c72c2eee..aa70360f27c1 100644
> --- a/scripts/kconfig/confdata.c
> +++ b/scripts/kconfig/confdata.c
> @@ -1331,9 +1331,8 @@ void conf_rewrite_mod_or_yes(enum conf_def_mode mode)
>
>         for_all_symbols(i, sym) {
>                 if (sym_get_type(sym) == S_TRISTATE &&
> -                   sym->def[S_DEF_USER].tri == old_val) {
> +                   sym->def[S_DEF_USER].tri == old_val)
>                         sym->def[S_DEF_USER].tri = new_val;
> -                       sym_add_change_count(1);
> -               }
>         }
> +       sym_clear_all_valid();
>  }
> --
> 2.11.0
>
diff mbox series

Patch

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 11f6c72c2eee..aa70360f27c1 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -1331,9 +1331,8 @@  void conf_rewrite_mod_or_yes(enum conf_def_mode mode)
 
 	for_all_symbols(i, sym) {
 		if (sym_get_type(sym) == S_TRISTATE &&
-		    sym->def[S_DEF_USER].tri == old_val) {
+		    sym->def[S_DEF_USER].tri == old_val)
 			sym->def[S_DEF_USER].tri = new_val;
-			sym_add_change_count(1);
-		}
 	}
+	sym_clear_all_valid();
 }