From patchwork Sat Aug 14 21:29:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 119602 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 o7ELTjTh026732 for ; Sat, 14 Aug 2010 21:29:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756103Ab0HNV3D (ORCPT ); Sat, 14 Aug 2010 17:29:03 -0400 Received: from pfepb.post.tele.dk ([195.41.46.236]:37373 "EHLO pfepb.post.tele.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755411Ab0HNV3C (ORCPT ); Sat, 14 Aug 2010 17:29:02 -0400 Received: from merkur.ravnborg.org (x1-6-00-1e-2a-84-ae-3e.k225.webspeed.dk [80.163.61.94]) by pfepb.post.tele.dk (Postfix) with ESMTP id 1A159F84018; Sat, 14 Aug 2010 23:29:01 +0200 (CEST) Date: Sat, 14 Aug 2010 23:29:00 +0200 From: Sam Ravnborg To: Michal Marek , linux-kbuild , lkml Subject: [PATCH] kconfig: fix savedefconfig with choice marked optional Message-ID: <20100814212900.GA29962@merkur.ravnborg.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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.3 (demeter.kernel.org [140.211.167.41]); Sat, 14 Aug 2010 21:29:45 +0000 (UTC) diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index c39327e..515253f 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -497,7 +497,9 @@ int conf_write_defconfig(const char *filename) /* * If symbol is a choice value and equals to the * default for a choice - skip. - * But only if value is bool and equal to "y" . + * But only if value is bool and equal to "y" and + * choice is not "optional". + * (If choice is "optional" then all values can be "n") */ if (sym_is_choice_value(sym)) { struct symbol *cs; @@ -505,7 +507,7 @@ int conf_write_defconfig(const char *filename) cs = prop_get_symbol(sym_get_choice_prop(sym)); ds = sym_choice_default(cs); - if (sym == ds) { + if (!sym_is_optional(cs) && sym == ds) { if ((sym->type == S_BOOLEAN) && sym_get_tristate_value(sym) == yes) goto next_menu;