From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Michal Marek <mmarek@suse.cz>
Cc: linux-arch@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>,
Sam Ravnborg <sam@ravnborg.org>,
linux-kbuild@vger.kernel.org,
Randy Dunlap <randy.dunlap@oracle.com>,
Vegard Nossum <vegard.nossum@gmail.com>
Subject: Re: kbuild: fixing the select problem
Date: Thu, 06 May 2010 15:48:35 -0500 [thread overview]
Message-ID: <1273178915.2881.20.camel@mulgrave.site> (raw)
In-Reply-To: <1273157554.23208.69.camel@mulgrave.site>
On Thu, 2010-05-06 at 09:52 -0500, James Bottomley wrote:
> The list is
>
> USB_ARCH_HAS_HCD has 4 defaults
> DEFCONFIG_LIST has 5 defaults
> MAC80211_RC_DEFAULT has 2 defaults
> X86_L1_CACHE_SHIFT has 2 defaults
> SPLIT_PTLOCK_CPUS has 2 defaults
> X86_MINIMUM_CPU_FAMILY has 3 defaults
> DEFAULT_TCP_CONG has 2 defaults
> DEFCONFIG_LIST has 5 defaults
> USB_ARCH_HAS_HCD has 4 defaults
> X86_L1_CACHE_SHIFT has 2 defaults
> X86_MINIMUM_CPU_FAMILY has 3 defaults
> SPLIT_PTLOCK_CPUS has 2 defaults
> DEFAULT_TCP_CONG has 2 defaults
> MAC80211_RC_DEFAULT has 2 defaults
Here's a patch that alters the default processing to the needed form and
checks the old vs new values. I've been running randconfigs but I can't
get the warning to trip ... have at it.
James
---
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 6c8fbbb..722bc4e 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -115,14 +115,31 @@ struct property *sym_get_env_prop(struct symbol *sym)
struct property *sym_get_default_prop(struct symbol *sym)
{
- struct property *prop;
+ struct property *prop, *ret = NULL;
+ tristate old_val = no, val = no;
for_all_defaults(sym, prop) {
prop->visible.tri = expr_calc_value(prop->visible.expr);
- if (prop->visible.tri != no)
- return prop;
+ if (prop->visible.tri != no) {
+ tristate v = expr_calc_value(prop->expr);
+ if (!ret)
+ old_val = v;
+ if (v >= val) {
+ val = v;
+ ret = prop;
+ }
+ }
}
- return NULL;
+ /*
+ * Previously, we took the first valid default we found (this
+ * is now old_val). In the new scheme, the value is the or of
+ * all the defaults.
+ */
+ if (old_val != val)
+ menu_warn(ret->menu, "ERROR: new parser has inconsistent "
+ "values for %s (%d != %d)\n", sym->name,
+ old_val, val);
+ return ret;
}
static struct property *sym_get_range_prop(struct symbol *sym)
next prev parent reply other threads:[~2010-05-06 20:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-05 21:49 kbuild: fixing the select problem James Bottomley
2010-05-05 21:49 ` James Bottomley
2010-05-06 6:47 ` Geert Uytterhoeven
2010-05-06 6:47 ` Geert Uytterhoeven
2010-05-06 13:17 ` James Bottomley
2010-05-06 13:17 ` James Bottomley
2010-05-06 13:36 ` Geert Uytterhoeven
2010-05-06 16:47 ` Valdis.Kletnieks
2010-05-06 16:47 ` Valdis.Kletnieks
2010-05-06 17:25 ` Geert Uytterhoeven
2010-05-06 17:25 ` Geert Uytterhoeven
2010-05-06 14:24 ` Michal Marek
2010-05-06 14:24 ` Michal Marek
2010-05-06 14:52 ` James Bottomley
2010-05-06 14:52 ` James Bottomley
2010-05-06 20:48 ` James Bottomley [this message]
2010-05-06 20:59 ` Randy Dunlap
2010-05-06 21:05 ` James Bottomley
2010-05-06 16:52 ` Vegard Nossum
2010-05-07 11:31 ` Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1273178915.2881.20.camel@mulgrave.site \
--to=james.bottomley@hansenpartnership.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=randy.dunlap@oracle.com \
--cc=sam@ravnborg.org \
--cc=vegard.nossum@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox