kconfig: remove unneeded variable in get_prompt_str()
PATCH 1/3 kconfig: remove unneeded variable in get_prompt_str()
The variable 'accessible' is redundant.
Signed-off-by Masahiro Yamada <[email protected]>
---
scripts/kconfig/menu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
scripts/kconfig/menu.c +1 -3
@@ -724,10 +724,8 @@ static void get_prompt_str(struct gstr *r, struct property *prop, menu = prop->menu;for (i =0 ; menu != &rootmenu && i <8 ; menu = menu->parent) { -bool accessible =menu_is_visible (menu); - submenu[i++] = menu; -if (location ==NULL && accessible) +if (location ==NULL &&menu_is_visible (menu)) location = menu; }if (head && location) {
Signature · 1 line
2.34.1
PATCH 2/3 kconfig: remove const qualifier from str_get()
update_text() apparently edits the buffer returned by str_get(). (and there is no reason why it shouldn't)
Remove 'const' quailifier and casting.
Signed-off-by Masahiro Yamada <[email protected]>
---
scripts/kconfig/lkc.h | 2 +- scripts/kconfig/mconf.c | 4 ++-- scripts/kconfig/util.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
scripts/kconfig/lkc.h +1 -1
@@ -76,7 +76,7 @@ struct gstr str_new(void);void str_free (struct gstr *gs);void str_append (struct gstr *gs,const char *s);void str_printf (struct gstr *gs,const char *fmt, ...); -const char *str_get (struct gstr *gs); +char *str_get (struct gstr *gs);/* menu.c */ void _menu_init (void );
scripts/kconfig/mconf.c +2 -2
@@ -440,8 +440,8 @@ static void search_conf(void) res =get_relations_str (sym_arr, &head);set_subtitle (); - dres =show_textbox_ext ("Search Results" , (char *) -str_get (&res),0 ,0 , keys, &vscroll, + dres =show_textbox_ext ("Search Results" ,str_get (&res),0 ,0 , + keys, &vscroll, &hscroll, &update_text, (void *) &data); again = false;
scripts/kconfig/util.c +1 -1
@@ -74,7 +74,7 @@ void str_printf(struct gstr *gs, const char *fmt, ...) }/* Retrieve value of growable string */ -const char *str_get (struct gstr *gs) +char *str_get (struct gstr *gs) {return gs->s; }
Signature · 1 line
2.34.1
PATCH 3/3 kconfig: remove redundant (void *) cast in search_conf()
In reply to Masahiro YamadaThe (void *) cast is redundant because the last argument of show_textbox_ext() is an opaque pointer.
Signed-off-by Masahiro Yamada <[email protected]>
---
scripts/kconfig/mconf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
scripts/kconfig/mconf.c +1 -2
@@ -441,8 +441,7 @@ static void search_conf(void) res =get_relations_str (sym_arr, &head);set_subtitle (); dres =show_textbox_ext ("Search Results" ,str_get (&res),0 ,0 , - keys, &vscroll, - &hscroll, &update_text, (void *) + keys, &vscroll, &hscroll, &update_text, &data); again = false;for (i =0 ; i <JUMP_NB && keys[i]; i++)
Signature · 1 line
2.34.1