From f5a1a363e5dcca91d577b0d93a4e3f0d3c99ca0c Mon Sep 17 00:00:00 2001
From: Danny Auble <da@schedmd.com>
Date: Wed, 20 Aug 2014 16:01:16 -0700
Subject: [PATCH] Remove unneeded parameter from function.

---
 src/sview/common.c | 8 +++-----
 src/sview/popups.c | 8 ++++----
 src/sview/sview.h  | 3 +--
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/sview/common.c b/src/sview/common.c
index 8f554fe5d79..86f4e269fbe 100644
--- a/src/sview/common.c
+++ b/src/sview/common.c
@@ -1911,8 +1911,7 @@ extern void remove_old(GtkTreeModel *model, int updated)
 	gtk_tree_path_free(path);
 }
 
-extern GtkWidget *create_pulldown_combo(display_data_t *display_data,
-					int count)
+extern GtkWidget *create_pulldown_combo(display_data_t *display_data)
 {
 	GtkListStore *store = NULL;
 	GtkWidget *combo = NULL;
@@ -1921,12 +1920,11 @@ extern GtkWidget *create_pulldown_combo(display_data_t *display_data,
 	int i=0;
 
 	store = gtk_list_store_new(2, G_TYPE_INT, G_TYPE_STRING);
-	for(i=0; i<count; i++) {
-		if (display_data[i].id == -1)
-			break;
+	while (display_data[i].id != -1) {
 		gtk_list_store_append(store, &iter);
 		gtk_list_store_set(store, &iter, 0, display_data[i].id,
 				   1, display_data[i].name, -1);
+		i++;
 	}
 	combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
 
diff --git a/src/sview/popups.c b/src/sview/popups.c
index af335c70320..b5c0e258f6b 100644
--- a/src/sview/popups.c
+++ b/src/sview/popups.c
@@ -697,7 +697,7 @@ extern void create_search_popup(GtkAction *action, gpointer user_data)
 		};
 
 		sview_search_info.search_type = SEARCH_JOB_STATE;
-		entry = create_pulldown_combo(pulldown_display_data, JOB_END);
+		entry = create_pulldown_combo(pulldown_display_data);
 		label = gtk_label_new("Which state?");
 	} else if (!strcmp(name, "partition_name")) {
 		sview_search_info.search_type = SEARCH_PARTITION_NAME;
@@ -713,7 +713,7 @@ extern void create_search_popup(GtkAction *action, gpointer user_data)
 		};
 
 		sview_search_info.search_type = SEARCH_PARTITION_STATE;
-		entry = create_pulldown_combo(pulldown_display_data, 5);
+		entry = create_pulldown_combo(pulldown_display_data);
 		label = gtk_label_new("Which state?");
 	} else if (!strcmp(name, "node_name")) {
 		sview_search_info.search_type = SEARCH_NODE_NAME;
@@ -758,7 +758,7 @@ extern void create_search_popup(GtkAction *action, gpointer user_data)
 		};
 
 		sview_search_info.search_type = SEARCH_NODE_STATE;
-		entry = create_pulldown_combo(pulldown_display_data, PAGE_CNT);
+		entry = create_pulldown_combo(pulldown_display_data);
 		label = gtk_label_new("Which state?");
 	} else if ((cluster_flags & CLUSTER_FLAG_BG)
 		   && !strcmp(name, "bg_block_name")) {
@@ -808,7 +808,7 @@ extern void create_search_popup(GtkAction *action, gpointer user_data)
 			}
 		}
 		sview_search_info.search_type = SEARCH_BLOCK_STATE;
-		entry = create_pulldown_combo(pulldown_display_data, PAGE_CNT);
+		entry = create_pulldown_combo(pulldown_display_data);
 		label = gtk_label_new("Which state?");
 	} else if (!strcmp(name, "reservation_name")) {
 		sview_search_info.search_type = SEARCH_RESERVATION_NAME;
diff --git a/src/sview/sview.h b/src/sview/sview.h
index baf288810a3..483a0b8000b 100644
--- a/src/sview/sview.h
+++ b/src/sview/sview.h
@@ -622,8 +622,7 @@ extern gboolean delete_popups(void);
 extern void *popup_thr(popup_info_t *popup_win);
 extern void set_for_update(GtkTreeModel *model, int updated);
 extern void remove_old(GtkTreeModel *model, int updated);
-extern GtkWidget *create_pulldown_combo(display_data_t *display_data,
-					int count);
+extern GtkWidget *create_pulldown_combo(display_data_t *display_data);
 extern char *str_tolower(char *upper_str);
 extern char *get_reason(void);
 extern void display_admin_edit(GtkTable *table, void *type_msg, int *row,
-- 
GitLab