From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759255AbXFVQbq (ORCPT ); Fri, 22 Jun 2007 12:31:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757568AbXFVQbi (ORCPT ); Fri, 22 Jun 2007 12:31:38 -0400 Received: from scrub.xs4all.nl ([194.109.195.176]:4551 "EHLO scrub.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753661AbXFVQbh (ORCPT ); Fri, 22 Jun 2007 12:31:37 -0400 Date: Fri, 22 Jun 2007 18:31:43 +0200 (CEST) From: Roman Zippel X-X-Sender: roman@scrub.home To: Mauro Carvalho Chehab cc: Oliver Neukum , linux-usb-devel@lists.sourceforge.net, video4linux-list@redhat.com, =?UTF-8?Q?Toralf_F=F6rster?= , luca.risolia@studio.unibo.it, Jan Engelhardt , LKML Subject: Re: Kconfig troubles when using menuconfig - Was: [patch]Re: [linux-usb-devel] linux-2.6.22-rc5-gf1518a0 build #300 failed in zc0301_core.c In-Reply-To: <1182525697.14289.47.camel@gaivota> Message-ID: References: <200706211117.55908.toralf.foerster@gmx.de> <200706211231.53898.luca.risolia@studio.unibo.it> <200706211326.45031.toralf.foerster@gmx.de> <200706211350.14526.oneukum@suse.de> <1182518566.14289.20.camel@gaivota> <1182525697.14289.47.camel@gaivota> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, 22 Jun 2007, Mauro Carvalho Chehab wrote: > I'm to keep "default y" for the menuconfig items. > > Since those don't generate any code (there's no Makefile items > associated with the menuconfig vars), I don't know that without checking Makefiles/sources, so I have to assume it may produce some infrastructure code I don't need. > this will just improve the > usability for the final user (and will allow make oldconfig to work). I'd rather change that. > There's not much sense on selecting V4L support without selecting a V4L > driver. But if only want to enable a video driver, I likely don't want a radio driver... bye, Roman Reset generates values only if Kconfig and .config agree. Signed-off-by: Roman Zippel --- scripts/kconfig/confdata.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) Index: linux-2.6/scripts/kconfig/confdata.c =================================================================== --- linux-2.6.orig/scripts/kconfig/confdata.c +++ linux-2.6/scripts/kconfig/confdata.c @@ -341,27 +341,42 @@ int conf_read(const char *name) conf_unsaved++; /* maybe print value in verbose mode... */ sym_ok: + if (!sym_is_choice(sym)) + continue; + /* The choice symbol only has a set value (and thus is not new) + * if all its visible childs have values. + */ + prop = sym_get_choice_prop(sym); + flags = sym->flags; + for (e = prop->expr; e; e = e->left.expr) + if (e->right.sym->visible != no) + flags &= e->right.sym->flags; + sym->flags &= flags | ~SYMBOL_DEF_USER; + } + + for_all_symbols(i, sym) { if (sym_has_value(sym) && !sym_is_choice_value(sym)) { - if (sym->visible == no) + /* Reset values of generates values, so they'll appear + * as new, if they should become visible, but that + * doesn't quite work if the Kconfig and the saved + * configuration disagrees. + */ + if (sym->visible == no && !conf_unsaved) sym->flags &= ~SYMBOL_DEF_USER; switch (sym->type) { case S_STRING: case S_INT: case S_HEX: - if (!sym_string_within_range(sym, sym->def[S_DEF_USER].val)) - sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER); + /* Reset a string value if it's out of range */ + if (sym_string_within_range(sym, sym->def[S_DEF_USER].val)) + break; + sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER); + conf_unsaved++; + break; default: break; } } - if (!sym_is_choice(sym)) - continue; - prop = sym_get_choice_prop(sym); - flags = sym->flags; - for (e = prop->expr; e; e = e->left.expr) - if (e->right.sym->visible != no) - flags &= e->right.sym->flags; - sym->flags &= flags | ~SYMBOL_DEF_USER; } sym_add_change_count(conf_warnings || conf_unsaved);