public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next 0/2] Kconfig: clean code
@ 2022-09-12  9:48 Zeng Heng
  2022-09-12  9:48 ` [PATCH -next 1/2] Kconfig: remove unused argment 'ch' Zeng Heng
  2022-09-12  9:48 ` [PATCH -next 2/2] Kconfig: remove unused function 'menu_get_root_menu' Zeng Heng
  0 siblings, 2 replies; 6+ messages in thread
From: Zeng Heng @ 2022-09-12  9:48 UTC (permalink / raw)
  To: masahiroy; +Cc: linux-kbuild, linux-kernel, weiyongjun1

A patch set abount clean code for Kconfig. 

Zeng Heng (2):
  Kconfig: remove unused argment 'ch'
  Kconfig: remove unused function 'menu_get_root_menu'

 scripts/kconfig/conf.c | 2 +-
 scripts/kconfig/lkc.h  | 3 +--
 scripts/kconfig/menu.c | 5 -----
 3 files changed, 2 insertions(+), 8 deletions(-)

-- 
2.25.1


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

* [PATCH -next 1/2] Kconfig: remove unused argment 'ch'
  2022-09-12  9:48 [PATCH -next 0/2] Kconfig: clean code Zeng Heng
@ 2022-09-12  9:48 ` Zeng Heng
  2022-09-13 16:35   ` Masahiro Yamada
  2022-09-12  9:48 ` [PATCH -next 2/2] Kconfig: remove unused function 'menu_get_root_menu' Zeng Heng
  1 sibling, 1 reply; 6+ messages in thread
From: Zeng Heng @ 2022-09-12  9:48 UTC (permalink / raw)
  To: masahiroy; +Cc: linux-kbuild, linux-kernel, weiyongjun1

Remove unused argment 'ch' in sym_set_choice_value

Signed-off-by: Zeng Heng <zengheng4@huawei.com>
---
 scripts/kconfig/conf.c | 2 +-
 scripts/kconfig/lkc.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 4178065ca27f..635265a18a07 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -551,7 +551,7 @@ static int conf_choice(struct menu *menu)
 			print_help(child);
 			continue;
 		}
-		sym_set_choice_value(sym, child->sym);
+		sym_set_choice_value(child->sym);
 		for (child = child->list; child; child = child->next) {
 			indent += 2;
 			conf(child);
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index fa8c010aa683..279d56a44136 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -124,7 +124,7 @@ static inline struct symbol *sym_get_choice_value(struct symbol *sym)
 	return (struct symbol *)sym->curr.val;
 }
 
-static inline bool sym_set_choice_value(struct symbol *ch, struct symbol *chval)
+static inline bool sym_set_choice_value(struct symbol *chval)
 {
 	return sym_set_tristate_value(chval, yes);
 }
-- 
2.25.1


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

* [PATCH -next 2/2] Kconfig: remove unused function 'menu_get_root_menu'
  2022-09-12  9:48 [PATCH -next 0/2] Kconfig: clean code Zeng Heng
  2022-09-12  9:48 ` [PATCH -next 1/2] Kconfig: remove unused argment 'ch' Zeng Heng
@ 2022-09-12  9:48 ` Zeng Heng
  2022-09-13 16:37   ` Masahiro Yamada
  1 sibling, 1 reply; 6+ messages in thread
From: Zeng Heng @ 2022-09-12  9:48 UTC (permalink / raw)
  To: masahiroy; +Cc: linux-kbuild, linux-kernel, weiyongjun1

There is nowhere calling `menu_get_root_menu` function,
so remove it.

Signed-off-by: Zeng Heng <zengheng4@huawei.com>
---
 scripts/kconfig/lkc.h  | 1 -
 scripts/kconfig/menu.c | 5 -----
 2 files changed, 6 deletions(-)

diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 279d56a44136..a61907686d22 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -98,7 +98,6 @@ bool menu_is_empty(struct menu *menu);
 bool menu_is_visible(struct menu *menu);
 bool menu_has_prompt(struct menu *menu);
 const char *menu_get_prompt(struct menu *menu);
-struct menu *menu_get_root_menu(struct menu *menu);
 struct menu *menu_get_parent_menu(struct menu *menu);
 bool menu_has_help(struct menu *menu);
 const char *menu_get_help(struct menu *menu);
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 3d6f7cba8846..62b6313f51c8 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -661,11 +661,6 @@ const char *menu_get_prompt(struct menu *menu)
 	return NULL;
 }
 
-struct menu *menu_get_root_menu(struct menu *menu)
-{
-	return &rootmenu;
-}
-
 struct menu *menu_get_parent_menu(struct menu *menu)
 {
 	enum prop_type type;
-- 
2.25.1


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

* Re: [PATCH -next 1/2] Kconfig: remove unused argment 'ch'
  2022-09-12  9:48 ` [PATCH -next 1/2] Kconfig: remove unused argment 'ch' Zeng Heng
@ 2022-09-13 16:35   ` Masahiro Yamada
  2022-09-14  1:34     ` Zeng Heng
  0 siblings, 1 reply; 6+ messages in thread
From: Masahiro Yamada @ 2022-09-13 16:35 UTC (permalink / raw)
  To: Zeng Heng
  Cc: Linux Kbuild mailing list, Linux Kernel Mailing List, Wei Yongjun

On Mon, Sep 12, 2022 at 6:41 PM Zeng Heng <zengheng4@huawei.com> wrote:
>
> Remove unused argment 'ch' in sym_set_choice_value
>
> Signed-off-by: Zeng Heng <zengheng4@huawei.com>


Can you remove sym_set_choice_value() and
call sym_set_tristate_value(chval, yes) directly?





> ---
>  scripts/kconfig/conf.c | 2 +-
>  scripts/kconfig/lkc.h  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
> index 4178065ca27f..635265a18a07 100644
> --- a/scripts/kconfig/conf.c
> +++ b/scripts/kconfig/conf.c
> @@ -551,7 +551,7 @@ static int conf_choice(struct menu *menu)
>                         print_help(child);
>                         continue;
>                 }
> -               sym_set_choice_value(sym, child->sym);
> +               sym_set_choice_value(child->sym);
>                 for (child = child->list; child; child = child->next) {
>                         indent += 2;
>                         conf(child);
> diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
> index fa8c010aa683..279d56a44136 100644
> --- a/scripts/kconfig/lkc.h
> +++ b/scripts/kconfig/lkc.h
> @@ -124,7 +124,7 @@ static inline struct symbol *sym_get_choice_value(struct symbol *sym)
>         return (struct symbol *)sym->curr.val;
>  }
>
> -static inline bool sym_set_choice_value(struct symbol *ch, struct symbol *chval)
> +static inline bool sym_set_choice_value(struct symbol *chval)
>  {
>         return sym_set_tristate_value(chval, yes);
>  }
> --
> 2.25.1
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH -next 2/2] Kconfig: remove unused function 'menu_get_root_menu'
  2022-09-12  9:48 ` [PATCH -next 2/2] Kconfig: remove unused function 'menu_get_root_menu' Zeng Heng
@ 2022-09-13 16:37   ` Masahiro Yamada
  0 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2022-09-13 16:37 UTC (permalink / raw)
  To: Zeng Heng
  Cc: Linux Kbuild mailing list, Linux Kernel Mailing List, Wei Yongjun

On Mon, Sep 12, 2022 at 6:41 PM Zeng Heng <zengheng4@huawei.com> wrote:
>
> There is nowhere calling `menu_get_root_menu` function,
> so remove it.
>
> Signed-off-by: Zeng Heng <zengheng4@huawei.com>


Applied to linux-kbuild. Thanks.


> ---
>  scripts/kconfig/lkc.h  | 1 -
>  scripts/kconfig/menu.c | 5 -----
>  2 files changed, 6 deletions(-)
>
> diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
> index 279d56a44136..a61907686d22 100644
> --- a/scripts/kconfig/lkc.h
> +++ b/scripts/kconfig/lkc.h
> @@ -98,7 +98,6 @@ bool menu_is_empty(struct menu *menu);
>  bool menu_is_visible(struct menu *menu);
>  bool menu_has_prompt(struct menu *menu);
>  const char *menu_get_prompt(struct menu *menu);
> -struct menu *menu_get_root_menu(struct menu *menu);
>  struct menu *menu_get_parent_menu(struct menu *menu);
>  bool menu_has_help(struct menu *menu);
>  const char *menu_get_help(struct menu *menu);
> diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
> index 3d6f7cba8846..62b6313f51c8 100644
> --- a/scripts/kconfig/menu.c
> +++ b/scripts/kconfig/menu.c
> @@ -661,11 +661,6 @@ const char *menu_get_prompt(struct menu *menu)
>         return NULL;
>  }
>
> -struct menu *menu_get_root_menu(struct menu *menu)
> -{
> -       return &rootmenu;
> -}
> -
>  struct menu *menu_get_parent_menu(struct menu *menu)
>  {
>         enum prop_type type;
> --
> 2.25.1
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH -next 1/2] Kconfig: remove unused argment 'ch'
  2022-09-13 16:35   ` Masahiro Yamada
@ 2022-09-14  1:34     ` Zeng Heng
  0 siblings, 0 replies; 6+ messages in thread
From: Zeng Heng @ 2022-09-14  1:34 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Linux Kbuild mailing list, Linux Kernel Mailing List, liwei391,
	weiyongjun (A)

Yes, I would replace sym_set_choice_value with sym_set_tristate_value at v2.


在 2022/9/14 0:35, Masahiro Yamada 写道:
> On Mon, Sep 12, 2022 at 6:41 PM Zeng Heng <zengheng4@huawei.com> wrote:
>> Remove unused argment 'ch' in sym_set_choice_value
>>
>> Signed-off-by: Zeng Heng <zengheng4@huawei.com>
>
> Can you remove sym_set_choice_value() and
> call sym_set_tristate_value(chval, yes) directly?
>
>
>
>
>
>> ---
>>   scripts/kconfig/conf.c | 2 +-
>>   scripts/kconfig/lkc.h  | 2 +-
>>   2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
>> index 4178065ca27f..635265a18a07 100644
>> --- a/scripts/kconfig/conf.c
>> +++ b/scripts/kconfig/conf.c
>> @@ -551,7 +551,7 @@ static int conf_choice(struct menu *menu)
>>                          print_help(child);
>>                          continue;
>>                  }
>> -               sym_set_choice_value(sym, child->sym);
>> +               sym_set_choice_value(child->sym);
>>                  for (child = child->list; child; child = child->next) {
>>                          indent += 2;
>>                          conf(child);
>> diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
>> index fa8c010aa683..279d56a44136 100644
>> --- a/scripts/kconfig/lkc.h
>> +++ b/scripts/kconfig/lkc.h
>> @@ -124,7 +124,7 @@ static inline struct symbol *sym_get_choice_value(struct symbol *sym)
>>          return (struct symbol *)sym->curr.val;
>>   }
>>
>> -static inline bool sym_set_choice_value(struct symbol *ch, struct symbol *chval)
>> +static inline bool sym_set_choice_value(struct symbol *chval)
>>   {
>>          return sym_set_tristate_value(chval, yes);
>>   }
>> --
>> 2.25.1
>>
>

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

end of thread, other threads:[~2022-09-14  1:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-12  9:48 [PATCH -next 0/2] Kconfig: clean code Zeng Heng
2022-09-12  9:48 ` [PATCH -next 1/2] Kconfig: remove unused argment 'ch' Zeng Heng
2022-09-13 16:35   ` Masahiro Yamada
2022-09-14  1:34     ` Zeng Heng
2022-09-12  9:48 ` [PATCH -next 2/2] Kconfig: remove unused function 'menu_get_root_menu' Zeng Heng
2022-09-13 16:37   ` Masahiro Yamada

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