public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kconfig: nuke second argument of conf_write_symbol()
@ 2010-12-05  6:33 Arnaud Lacombe
  2010-12-15  6:26 ` Arnaud Lacombe
  2010-12-15 13:28 ` Michal Marek
  0 siblings, 2 replies; 3+ messages in thread
From: Arnaud Lacombe @ 2010-12-05  6:33 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Arnaud Lacombe

Replacing S_TRISTATE by S_BOOLEAN is a no-op for conf_write_symbol().

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
---
 scripts/kconfig/confdata.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index f349bdc..6fd43d7 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -440,12 +440,11 @@ static void conf_write_string(bool headerfile, const char *name,
 	fputs("\"\n", out);
 }
 
-static void conf_write_symbol(struct symbol *sym, enum symbol_type type,
-                              FILE *out, bool write_no)
+static void conf_write_symbol(struct symbol *sym, FILE *out, bool write_no)
 {
 	const char *str;
 
-	switch (type) {
+	switch (sym->type) {
 	case S_BOOLEAN:
 	case S_TRISTATE:
 		switch (sym_get_tristate_value(sym)) {
@@ -532,7 +531,7 @@ int conf_write_defconfig(const char *filename)
 						goto next_menu;
 				}
 			}
-			conf_write_symbol(sym, sym->type, out, true);
+			conf_write_symbol(sym, out, true);
 		}
 next_menu:
 		if (menu->list != NULL) {
@@ -633,14 +632,8 @@ int conf_write(const char *name)
 			if (!(sym->flags & SYMBOL_WRITE))
 				goto next;
 			sym->flags &= ~SYMBOL_WRITE;
-			type = sym->type;
-			if (type == S_TRISTATE) {
-				sym_calc_value(modules_sym);
-				if (modules_sym->curr.tri == no)
-					type = S_BOOLEAN;
-			}
 			/* Write config symbol to file */
-			conf_write_symbol(sym, type, out, true);
+			conf_write_symbol(sym, out, true);
 		}
 
 next:
@@ -842,7 +835,7 @@ int conf_write_autoconf(void)
 			continue;
 
 		/* write symbol to config file */
-		conf_write_symbol(sym, sym->type, out, false);
+		conf_write_symbol(sym, out, false);
 
 		/* update autoconf and tristate files */
 		switch (sym->type) {
-- 
1.7.2.30.gc37d7.dirty


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kconfig: nuke second argument of conf_write_symbol()
  2010-12-05  6:33 [PATCH] kconfig: nuke second argument of conf_write_symbol() Arnaud Lacombe
@ 2010-12-15  6:26 ` Arnaud Lacombe
  2010-12-15 13:28 ` Michal Marek
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaud Lacombe @ 2010-12-15  6:26 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek

Hi,

On Sun, Dec 5, 2010 at 1:33 AM, Arnaud Lacombe <lacombar@gmail.com> wrote:
> Replacing S_TRISTATE by S_BOOLEAN is a no-op for conf_write_symbol().
>
> Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
> ---
>  scripts/kconfig/confdata.c |   17 +++++------------
>  1 files changed, 5 insertions(+), 12 deletions(-)
>
ping ?

 - Arnaud

> diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
> index f349bdc..6fd43d7 100644
> --- a/scripts/kconfig/confdata.c
> +++ b/scripts/kconfig/confdata.c
> @@ -440,12 +440,11 @@ static void conf_write_string(bool headerfile, const char *name,
>        fputs("\"\n", out);
>  }
>
> -static void conf_write_symbol(struct symbol *sym, enum symbol_type type,
> -                              FILE *out, bool write_no)
> +static void conf_write_symbol(struct symbol *sym, FILE *out, bool write_no)
>  {
>        const char *str;
>
> -       switch (type) {
> +       switch (sym->type) {
>        case S_BOOLEAN:
>        case S_TRISTATE:
>                switch (sym_get_tristate_value(sym)) {
> @@ -532,7 +531,7 @@ int conf_write_defconfig(const char *filename)
>                                                goto next_menu;
>                                }
>                        }
> -                       conf_write_symbol(sym, sym->type, out, true);
> +                       conf_write_symbol(sym, out, true);
>                }
>  next_menu:
>                if (menu->list != NULL) {
> @@ -633,14 +632,8 @@ int conf_write(const char *name)
>                        if (!(sym->flags & SYMBOL_WRITE))
>                                goto next;
>                        sym->flags &= ~SYMBOL_WRITE;
> -                       type = sym->type;
> -                       if (type == S_TRISTATE) {
> -                               sym_calc_value(modules_sym);
> -                               if (modules_sym->curr.tri == no)
> -                                       type = S_BOOLEAN;
> -                       }
>                        /* Write config symbol to file */
> -                       conf_write_symbol(sym, type, out, true);
> +                       conf_write_symbol(sym, out, true);
>                }
>
>  next:
> @@ -842,7 +835,7 @@ int conf_write_autoconf(void)
>                        continue;
>
>                /* write symbol to config file */
> -               conf_write_symbol(sym, sym->type, out, false);
> +               conf_write_symbol(sym, out, false);
>
>                /* update autoconf and tristate files */
>                switch (sym->type) {
> --
> 1.7.2.30.gc37d7.dirty
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kconfig: nuke second argument of conf_write_symbol()
  2010-12-05  6:33 [PATCH] kconfig: nuke second argument of conf_write_symbol() Arnaud Lacombe
  2010-12-15  6:26 ` Arnaud Lacombe
@ 2010-12-15 13:28 ` Michal Marek
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Marek @ 2010-12-15 13:28 UTC (permalink / raw)
  To: Arnaud Lacombe; +Cc: linux-kbuild

On Sun, Dec 05, 2010 at 01:33:16AM -0500, Arnaud Lacombe wrote:
> Replacing S_TRISTATE by S_BOOLEAN is a no-op for conf_write_symbol().

Nice cleanup, applied to kbuild-2.6.git#kconfig, thanks.

Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-15 13:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-05  6:33 [PATCH] kconfig: nuke second argument of conf_write_symbol() Arnaud Lacombe
2010-12-15  6:26 ` Arnaud Lacombe
2010-12-15 13:28 ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox