public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix undesirable side effect of adding "visible" menu attribute
@ 2010-12-09  8:11 Jan Beulich
  2010-12-09 15:58 ` Arnaud Lacombe
  2010-12-16 21:26 ` Michal Marek
  0 siblings, 2 replies; 12+ messages in thread
From: Jan Beulich @ 2010-12-09  8:11 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Arnaud Lacombe, mchehab, Michal Marek

This lead to non-selected, non-user-selectable options to be written
out to .config. This is not only pointless, but also preventing the
user to be prompted should any of those options eventually become
visible (e.g. by de-selecting the *_AUTO options the "visible"
attribute was added for.

Furthermore it is quite logical for the "visible" attribute of a menu
to control the visibility of all contained prompts, which is what the
patch does.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

---
 scripts/kconfig/menu.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

--- 2.6.37-rc5/scripts/kconfig/menu.c
+++ 2.6.37-rc5-kconfig-propagate-visibility/scripts/kconfig/menu.c
@@ -140,6 +140,20 @@ struct property *menu_add_prop(enum prop
 		}
 		if (current_entry->prompt && current_entry != &rootmenu)
 			prop_warn(prop, "prompt redefined");
+
+		/* Apply all upper menus' visibilities to actual prompts. */
+		if(type == P_PROMPT) {
+			struct menu *menu = current_entry;
+
+			while ((menu = menu->parent) != NULL) {
+				if (!menu->visibility)
+					continue;
+				prop->visible.expr
+					= expr_alloc_and(prop->visible.expr,
+							 menu->visibility);
+			}
+		}
+
 		current_entry->prompt = prop;
 	}
 	prop->text = prompt;




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-12-29 22:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-09  8:11 [PATCH] fix undesirable side effect of adding "visible" menu attribute Jan Beulich
2010-12-09 15:58 ` Arnaud Lacombe
2010-12-09 16:07   ` Arnaud Lacombe
2010-12-09 16:40     ` Jan Beulich
2010-12-09 16:08   ` Jan Beulich
2010-12-16 21:26 ` Michal Marek
2010-12-16 23:49   ` Arnaud Lacombe
2010-12-17  2:03     ` Arnaud Lacombe
2010-12-17  7:53       ` Jan Beulich
2010-12-29  9:19     ` Michal Marek
2010-12-29 15:17       ` Arnaud Lacombe
2010-12-29 22:32         ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox