Skip to contentSkip to conversation

kbuild: fix set but not used warnings

PATCH In review Peter Foley 3 participants 4 messages Oct 22, 2011 – Dec 11, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: fix set but not used warnings

Remove set but not used variables to fix warnings.

HOSTCC scripts/kconfig/gconf.o
/usr/src/lto/scripts/kconfig/gconf.c: In function 'change_sym_value':
/usr/src/lto/scripts/kconfig/gconf.c:833:11: warning: variable 'oldval' set but not used [-Wunused-but-set-variable] /usr/src/lto/scripts/kconfig/gconf.c: In function 'update_tree':
/usr/src/lto/scripts/kconfig/gconf.c:1281:19: warning: variable 'prop' set but not used [-Wunused-but-set-variable]

---
 scripts/kconfig/gconf.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
scripts/kconfig/gconf.c +1 -4
index b9e26a5..adc2306 100644
@@ -830,7 +830,7 @@ static void renderer_edited(GtkCellRendererText * cell,
 static void change_sym_value(struct menu *menu, gint col)
 {
 	struct symbol *sym = menu->sym;
-	tristate oldval, newval;
+	tristate newval;
 
 	if (!sym)
 		return;
@@ -847,7 +847,6 @@ static void change_sym_value(struct menu *menu, gint col)
 	switch (sym_get_type(sym)) {
 	case S_BOOLEAN:
 	case S_TRISTATE:
-		oldval = sym_get_tristate_value(sym);
 		if (!sym_tristate_within_range(sym, newval))
 			newval = yes;
 		sym_set_tristate_value(sym, newval);
@@ -1278,7 +1277,6 @@ static void update_tree(struct menu *src, GtkTreeIter * dst)
 	gboolean valid;
 	GtkTreeIter *sibling;
 	struct symbol *sym;
-	struct property *prop;
 	struct menu *menu1, *menu2;
 
 	if (src == &rootmenu)
@@ -1287,7 +1285,6 @@ static void update_tree(struct menu *src, GtkTreeIter * dst)
 	valid = gtk_tree_model_iter_children(model2, child2, dst);
 	for (child1 = src->list; child1; child1 = child1->next) {
 
-		prop = child1->prompt;
 		sym = child1->sym;
 
 	      reparse:
Signature · 1 line
1.7.7
#1 lore raw

Hi,

Quoted 10 lines · Peter Foley

Remove set but not used variables to fix warnings.

 HOSTCC  scripts/kconfig/gconf.o
/usr/src/lto/scripts/kconfig/gconf.c: In function 'change_sym_value':
/usr/src/lto/scripts/kconfig/gconf.c:833:11: warning: variable 'oldval' set but not used [-Wunused-but-set-variable] /usr/src/lto/scripts/kconfig/gconf.c: In function 'update_tree':
/usr/src/lto/scripts/kconfig/gconf.c:1281:19: warning: variable 'prop' set but not used [-Wunused-but-set-variable]

s/kbuild/kconfig/ in the subject, that help to know changes is only limited to scripts/kconfig/

- Arnaud

Quoted 49 lines

---
 scripts/kconfig/gconf.c |    5 +----

 1 files changed, 1 insertions(+), 4 deletions(-)
scripts/kconfig/gconf.c +1 -1
index b9e26a5..adc2306 100644
@@ -830,7 +830,7 @@ static void renderer_edited(GtkCellRendererText * cell,
  static void change_sym_value(struct menu *menu, gint col)
  {
        struct symbol *sym = menu->sym;
-       tristate oldval, newval;
+       tristate newval;
 
        if (!sym)
                return;
@@ -847,7 +847,6 @@ static void change_sym_value(struct menu *menu, gint col)
        switch (sym_get_type(sym)) {

       case S_BOOLEAN:
       case S_TRISTATE:
-               oldval = sym_get_tristate_value(sym); if (!sym_tristate_within_range(sym, newval)) newval = yes; sym_set_tristate_value(sym, newval);

scripts/kconfig/gconf.c +0 -2
@@ -1278,7 +1277,6 @@ static void update_tree(struct menu *src, GtkTreeIter * dst)
        gboolean valid;
        GtkTreeIter *sibling;
        struct symbol *sym;
-       struct property *prop;
        struct menu *menu1, *menu2;
 
        if (src == &rootmenu)
@@ -1287,7 +1285,6 @@ static void update_tree(struct menu *src, GtkTreeIter * dst)
        valid = gtk_tree_model_iter_children(model2, child2, dst);
        for (child1 = src->list; child1; child1 = child1->next) {
 
-               prop = child1->prompt;
                sym = child1->sym;
 

             reparse:
--
1.7.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 11 lines · Arnaud Lacombe

Hi,

Quoted 8 lines · Peter Foley

Remove set but not used variables to fix warnings.

 HOSTCC  scripts/kconfig/gconf.o
/usr/src/lto/scripts/kconfig/gconf.c: In function 'change_sym_value':
/usr/src/lto/scripts/kconfig/gconf.c:833:11: warning: variable 'oldval' set but not used [-Wunused-but-set-variable] /usr/src/lto/scripts/kconfig/gconf.c: In function 'update_tree':
/usr/src/lto/scripts/kconfig/gconf.c:1281:19: warning: variable 'prop' set but not used [-Wunused-but-set-variable]

Quoted 6 lines
Quoted 2 lines

s/kbuild/kconfig/ in the subject, that help to know changes is only limited to scripts/kconfig/

- Arnaud

Noted. Should I resend this patch?

Peter

#3 lore raw
In reply to Peter Foley
Quoted 8 lines · Peter Foley

Remove set but not used variables to fix warnings.

HOSTCC scripts/kconfig/gconf.o
/usr/src/lto/scripts/kconfig/gconf.c: In function 'change_sym_value':
/usr/src/lto/scripts/kconfig/gconf.c:833:11: warning: variable 'oldval' set but not used [-Wunused-but-set-variable] /usr/src/lto/scripts/kconfig/gconf.c: In function 'update_tree':
/usr/src/lto/scripts/kconfig/gconf.c:1281:19: warning: variable 'prop' set but not used [-Wunused-but-set-variable]

Quoted 4 lines
---
 scripts/kconfig/gconf.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

Applied to kbuild.git#kconfig.

Michal