kconfig: obey KCONFIG_ALLCONFIG choices with randconfig.
authorPaul Mundt <lethal@linux-sh.org>
Sat, 22 Dec 2007 22:03:30 +0000 (14:03 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 23 Dec 2007 20:54:37 +0000 (12:54 -0800)
Currently when using KCONFIG_ALLCONFIG with randconfig the choice options
are clobbered.  As recommended by Roman, this adds an is_new test to see
whether to select a new option or obey the existing one.

This is a resend of the earlier patch a couple of weeks ago, since there
was no reply.  Original thread is at http://lkml.org/lkml/2007/11/28/94

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/kconfig/conf.c

index a38787a881ea29bd876efdcbc483867827189b9d..8d6f17490c5efe753e34b28e38158997f6226567 100644 (file)
@@ -374,7 +374,8 @@ static int conf_choice(struct menu *menu)
                                continue;
                        break;
                case set_random:
-                       def = (random() % cnt) + 1;
+                       if (is_new)
+                               def = (random() % cnt) + 1;
                case set_default:
                case set_yes:
                case set_mod: