From patchwork Wed Jun 30 12:11:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 108822 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5UCUdxE009734 for ; Wed, 30 Jun 2010 12:30:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755868Ab0F3Maj (ORCPT ); Wed, 30 Jun 2010 08:30:39 -0400 Received: from vpn.id2.novell.com ([195.33.99.129]:56604 "EHLO vpn.id2.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752165Ab0F3Mai convert rfc822-to-8bit (ORCPT ); Wed, 30 Jun 2010 08:30:38 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 30 Jun 2010 12:30:39 +0000 (UTC) X-Greylist: delayed 1204 seconds by postgrey-1.27 at vger.kernel.org; Wed, 30 Jun 2010 08:30:38 EDT Received: from EMEA1-MTA by vpn.id2.novell.com with Novell_GroupWise; Wed, 30 Jun 2010 15:37:09 +0100 Message-Id: <4C2B50750200007800008CFC@vpn.id2.novell.com> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Wed, 30 Jun 2010 13:11:01 +0100 From: "Jan Beulich" To: , Cc: Subject: [PATCH] don't write invisible choice values Mime-Version: 1.0 Content-Disposition: inline Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org --- linux-2.6.35-rc3/scripts/kconfig/symbol.c +++ 2.6.35-rc3-kconfig-invisible-choice-values/scripts/kconfig/symbol.c @@ -222,13 +222,15 @@ static struct symbol *sym_calc_choice(st struct property *prop; struct expr *e; + /* first calculate all choice values' visibilities */ + prop = sym_get_choice_prop(sym); + expr_list_for_each_sym(prop->expr, e, def_sym) + sym_calc_visibility(def_sym); + /* is the user choice visible? */ def_sym = sym->def[S_DEF_USER].val; - if (def_sym) { - sym_calc_visibility(def_sym); - if (def_sym->visible != no) - return def_sym; - } + if (def_sym && def_sym->visible != no) + return def_sym; /* any of the defaults visible? */ for_all_defaults(sym, prop) { @@ -236,18 +238,15 @@ static struct symbol *sym_calc_choice(st if (prop->visible.tri == no) continue; def_sym = prop_get_symbol(prop); - sym_calc_visibility(def_sym); if (def_sym->visible != no) return def_sym; } /* just get the first visible value */ prop = sym_get_choice_prop(sym); - expr_list_for_each_sym(prop->expr, e, def_sym) { - sym_calc_visibility(def_sym); + expr_list_for_each_sym(prop->expr, e, def_sym) if (def_sym->visible != no) return def_sym; - } /* no choice? reset tristate value */ sym->curr.tri = no; @@ -365,12 +364,13 @@ void sym_calc_value(struct symbol *sym) if (sym_is_choice(sym)) { struct symbol *choice_sym; - int flags = sym->flags & (SYMBOL_CHANGED | SYMBOL_WRITE); prop = sym_get_choice_prop(sym); expr_list_for_each_sym(prop->expr, e, choice_sym) { - choice_sym->flags |= flags; - if (flags & SYMBOL_CHANGED) + if ((sym->flags & SYMBOL_WRITE) && + choice_sym->visible != no) + choice_sym->flags |= SYMBOL_WRITE; + if (sym->flags & SYMBOL_CHANGED) sym_set_changed(choice_sym); } }