From patchwork Thu Feb 17 19:27:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 571711 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1HJcarr030599 for ; Thu, 17 Feb 2011 19:38:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753135Ab1BQTig (ORCPT ); Thu, 17 Feb 2011 14:38:36 -0500 Received: from e2.ny.us.ibm.com ([32.97.182.142]:55364 "EHLO e2.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752166Ab1BQTif (ORCPT ); Thu, 17 Feb 2011 14:38:35 -0500 Received: from d01dlp01.pok.ibm.com (d01dlp01.pok.ibm.com [9.56.224.56]) by e2.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p1HJIbTQ000964; Thu, 17 Feb 2011 14:20:32 -0500 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 328C538C8436; Thu, 17 Feb 2011 14:28:52 -0500 (EST) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p1HJRZsk324274; Thu, 17 Feb 2011 14:27:35 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p1HJRZNp031998; Thu, 17 Feb 2011 14:27:35 -0500 Received: from kernel.beaverton.ibm.com (kernel.beaverton.ibm.com [9.47.67.96]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p1HJRY4x031667; Thu, 17 Feb 2011 14:27:34 -0500 Received: by kernel.beaverton.ibm.com (Postfix, from userid 1056) id 47A861E754B; Thu, 17 Feb 2011 11:27:33 -0800 (PST) From: John Stultz To: LKML Cc: John Stultz , Roman Zippel , Grant Likely , linux-kbuild@vger.kernel.org, Jason Hui Subject: [PATCH] [RFC] Allow configs from choice blocks to be selected. Date: Thu, 17 Feb 2011 11:27:28 -0800 Message-Id: <1297970848-4371-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.3.2.146.gca209 X-Content-Scanned: Fidelis XPS MAILER Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 17 Feb 2011 19:38:36 +0000 (UTC) diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index a796c95..284b223 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -203,8 +203,6 @@ static void sym_calc_visibility(struct symbol *sym) sym->visible = tri; sym_set_changed(sym); } - if (sym_is_choice_value(sym)) - return; /* defaulting to "yes" if no explicit "depends on" are given */ tri = yes; if (sym->dir_dep.expr) @@ -235,9 +233,23 @@ static void sym_calc_visibility(struct symbol *sym) struct symbol *sym_choice_default(struct symbol *sym) { struct symbol *def_sym; + struct symbol *ret = NULL; struct property *prop; struct expr *e; + /* check to see if any are selected */ + prop = sym_get_choice_prop(sym); + expr_list_for_each_sym(prop->expr, e, def_sym) + if (def_sym->rev_dep.tri != no) { + if (ret) + fprintf(stderr, "warning: conflicting selects " + "on choice block: %s\n", sym->name); + else + ret = def_sym; + } + if (ret) + return ret; + /* any of the defaults visible? */ for_all_defaults(sym, prop) { prop->visible.tri = expr_calc_value(prop->visible.expr);