summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2025-06-24 18:05:07 +0300
committerMasahiro Yamada <masahiroy@kernel.org>2025-07-01 14:07:34 +0300
commit9b8338fd45fc10961130bc2477aa72e4484e2732 (patch)
tree9e2a85853f52403caabc3af0a7fc7e1bdd680aa0 /scripts
parentb3841b501c4a58ba20f190afd25aa4b93cd664f9 (diff)
downloadlinux-9b8338fd45fc10961130bc2477aa72e4484e2732.tar.xz
kconfig: gconf: remove unnecessary NULL checks for tree1 and tree2
The tree1 and tree2 variables are initialized earlier in init_tree_model(), so the NULL checks are redundant. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/gconf.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 432a467e3250..2ab000adcced 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -678,8 +678,7 @@ void on_split_clicked(GtkButton * button, gpointer user_data)
gtk_widget_show(tree1_w);
gtk_window_get_default_size(GTK_WINDOW(main_wnd), &w, &h);
gtk_paned_set_position(GTK_PANED(hpaned), w / 2);
- if (tree2)
- gtk_tree_store_clear(tree2);
+ gtk_tree_store_clear(tree2);
display_list();
/* Disable back btn, like in full mode. */
@@ -691,8 +690,7 @@ void on_full_clicked(GtkButton * button, gpointer user_data)
{
view_mode = FULL_VIEW;
gtk_widget_hide(tree1_w);
- if (tree2)
- gtk_tree_store_clear(tree2);
+ gtk_tree_store_clear(tree2);
display_tree(&rootmenu);
gtk_widget_set_sensitive(back_btn, FALSE);
}
@@ -1298,8 +1296,7 @@ static void display_tree(struct menu *menu)
/* Display a part of the tree starting at current node (single/split view) */
static void display_tree_part(void)
{
- if (tree2)
- gtk_tree_store_clear(tree2);
+ gtk_tree_store_clear(tree2);
if (view_mode == SINGLE_VIEW)
display_tree(current);
else if (view_mode == SPLIT_VIEW)
@@ -1312,8 +1309,7 @@ static void display_tree_part(void)
/* Display the list in the left frame (split view) */
static void display_list(void)
{
- if (tree1)
- gtk_tree_store_clear(tree1);
+ gtk_tree_store_clear(tree1);
tree = tree1;
display_tree(&rootmenu);