+ kconfig-reset-generated-values-only-if-kconfig-and-config-agree.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     kconfig: reset generated values only if Kconfig and .config agree.
has been added to the -mm tree.  Its filename is
     kconfig-reset-generated-values-only-if-kconfig-and-config-agree.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: kconfig: reset generated values only if Kconfig and .config agree.
From: Roman Zippel <zippel@xxxxxxxxxxxxxx>

Normally generated values (Kconfig entries without a prompt) are cleared as
they are regenerated anyway and so they appear as new should they become
visible and defaults work as expected (once a value is set defaults aren't
used anymore).

The detection whether a value is generated or not is only based on its
visibility status, which can quickly change for a lot of symbols by just
removing a single line from .config or adding a dependency to Kconfig as you
noticed.

The patch now suppresses this logic when .config and Kconfig aren't in sync
and .config needs to be updated, so that you can remove now a random value
from .config and oldconfig won't reask for many other values.

Signed-off-by: Roman Zippel <zippel@xxxxxxxxxxxxxx>
Cc: Sam Ravnborg <sam@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 scripts/kconfig/confdata.c |   37 ++++++++++++++++++++++++-----------
 1 files changed, 26 insertions(+), 11 deletions(-)

diff -puN scripts/kconfig/confdata.c~kconfig-reset-generated-values-only-if-kconfig-and-config-agree scripts/kconfig/confdata.c
--- a/scripts/kconfig/confdata.c~kconfig-reset-generated-values-only-if-kconfig-and-config-agree
+++ a/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 disagree.
+			 */
+			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);
_

Patches currently in -mm which might be from zippel@xxxxxxxxxxxxxx are

lots-of-architectures-enable-arbitary-speed-tty-support.patch
kconfig-reset-generated-values-only-if-kconfig-and-config-agree.patch
ntp-move-the-cmos-update-code-into-ntpc.patch
ntp-move-the-cmos-update-code-into-ntpc-fix.patch
ntp-move-the-cmos-update-code-into-ntpc-fix-fix.patch
hfs-convert-to-new-aops.patch
hfsplus-convert-to-new-aops.patch
fs-affs-convert-to-new-aops.patch
char-genrtc-use-wait_event_interruptible.patch
dma-mapping-prevent-dma-dependent-code-from-linking-on.patch
hfsplus-change-kmalloc-memset-to-kzalloc.patch
sys_time-speedup.patch
sys_time-speedup-build-fixes.patch
hfs-refactor-ascii-to-unicode-conversion-routine.patch
hfs-refactor-ascii-to-unicode-conversion-routine-fix.patch
hfs-add-custom-dentry-hash-and-comparison-operations.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux