Skip to contentSkip to conversation

gconfig: remove misleading parentheses around a condition

PATCH In review Nicolas Iooss 2 participants 2 messages Mar 13, 2017 – Mar 21, 2017

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

PATCH 1/1 gconfig: remove misleading parentheses around a condition

When building the kernel with clang, the compiler complains about the presence of a condition inside two pairs of parentheses:

scripts/kconfig/gconf.c:917:19: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
} else if ((col == COL_OPTION)) {
~~~~^~~~~~~~~~~~~
scripts/kconfig/gconf.c:917:19: note: remove extraneous parentheses around the comparison to silence this warning
} else if ((col == COL_OPTION)) {
~ ^ ~
scripts/kconfig/gconf.c:917:19: note: use '=' to turn this equality comparison into an assignment
} else if ((col == COL_OPTION)) {
^~
=

Silence this warning by removing a level of parentheses.

---
 scripts/kconfig/gconf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kconfig/gconf.c +1 -1
index 26d208b435a0..cfddddb9c9d7 100644
@@ -914,7 +914,7 @@ on_treeview2_button_press_event(GtkWidget * widget,
 			current = menu;
 			display_tree_part();
 			gtk_widget_set_sensitive(back_btn, TRUE);
-		} else if ((col == COL_OPTION)) {
+		} else if (col == COL_OPTION) {
 			toggle_sym_value(menu);
 			gtk_tree_view_expand_row(view, path, TRUE);
 		}
Signature · 1 line
2.12.0
#1 lore raw

2017-03-14 4:33 GMT+09:00 Nicolas Iooss <[email protected]>:

Quoted 17 lines

When building the kernel with clang, the compiler complains about the presence of a condition inside two pairs of parentheses:

scripts/kconfig/gconf.c:917:19: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
} else if ((col == COL_OPTION)) {
~~~~^~~~~~~~~~~~~
scripts/kconfig/gconf.c:917:19: note: remove extraneous parentheses around the comparison to silence this warning
} else if ((col == COL_OPTION)) {
~ ^ ~
scripts/kconfig/gconf.c:917:19: note: use '=' to turn this equality comparison into an assignment
} else if ((col == COL_OPTION)) {
^~
=

Quoted 3 lines

Silence this warning by removing a level of parentheses.

Applied to linux-kbuild/fixes. Thanks!

Signature · 2 lines
Best Regards
Masahiro Yamada