kconfig - scan all Kconfig files
Subsystems (11)
I did a quick hack so kconfig could scan all Kconfig files in the kernel tree.
By scanning all Kconfig files we gain the following:
-> kconfig can report when a depends on refer to an undefined symbol -> kconfig can report when a select refer to an undefined symbol
Later we can push a lot of common stuff to the top-level Kconfig file. And that may in the end result in a better structure overall for Kconfig files.
When executing mconf like this:
ARCH=x86_64 scripts/kconfig/mconf Kconfig
I got the following list of warnings/errors:
arch/arm26/Kconfig:144:warning: type of 'FPE_NWFPE' redefined from 'boolean' to 'tristate'
arch/s390/Kconfig:114:warning: type of 'MATHEMU' redefined from 'tristate' to 'boolean'
arch/s390/Kconfig:524:warning: type of 'PCMCIA' redefined from 'tristate' to 'boolean'
arch/sh64/Kconfig:219:warning: type of 'SH_DMA' redefined from 'boolean' to 'tristate'
arch/um/Kconfig:31:warning: type of 'PCMCIA' redefined from 'tristate' to 'boolean'
arch/um/Kconfig:331:warning: type of 'INPUT' redefined from 'tristate' to 'boolean'
arch/arm/mach-omap1/Kconfig:41:warning: 'select' used by config symbol 'MACH_OMAP_H3' refers to undefined symbol 'GPIOEXPANDER_OMAP' arch/arm/Kconfig:592:warning: choice values currently only support a single prompt
arch/arm26/Kconfig:163:warning: choice values currently only support a single prompt
arch/cris/Kconfig:87:warning: choice values currently only support a single prompt
arch/h8300/Kconfig.cpu:181:warning: choice values currently only support a single prompt
arch/h8300/Kconfig.cpu:182:warning: defaults for choice values not supported
arch/ia64/Kconfig:325:warning: choice values currently only support a single prompt
arch/m32r/Kconfig:247:warning: choice values currently only support a single prompt
arch/sh64/Kconfig:223:warning: choice values currently only support a single prompt
arch/xtensa/Kconfig:76:warning: choice values currently only support a single prompt
arch/mips/Kconfig:1672:warning: choice values currently only support a single prompt
arch/mips/Kconfig:1678:warning: choice values currently only support a single prompt
arch/mips/Kconfig:1684:warning: choice values currently only support a single prompt
arch/h8300/Kconfig.cpu:102:warning: choice values currently only support a single prompt
arch/h8300/Kconfig.cpu:125:warning: defaults for choice values not supported
arch/h8300/Kconfig.cpu:139:warning: defaults for choice values not supported
arch/m68knommu/Kconfig:607:warning: choice values currently only support a single prompt
arch/h8300/Kconfig.cpu:107:warning: choice values currently only support a single prompt
arch/m68knommu/Kconfig:612:warning: choice values currently only support a single prompt arch/cris/arch-v10/drivers/Kconfig:607:warning: 'select' used by config symbol 'ETRAX_AXISFLASHMAP' refers to undefined symbol 'MTD_OBSOLETE_CHIPS' arch/cris/arch-v10/drivers/Kconfig:608:warning: 'select' used by config symbol 'ETRAX_AXISFLASHMAP' refers to undefined symbol 'MTD_AMDSTD' arch/h8300/Kconfig.cpu:145:warning: defaults for choice values not supported
arch/h8300/Kconfig.cpu:117:warning: defaults for choice values not supported
arch/h8300/Kconfig.cpu:131:warning: defaults for choice values not supported
arch/h8300/Kconfig.cpu:155:warning: defaults for choice values not supported
arch/h8300/Kconfig.cpu:164:warning: defaults for choice values not supported
arch/blackfin/Kconfig:548:warning: choice values currently only support a single prompt
arch/h8300/Kconfig.cpu:125:warning: defaults for choice values not supported
arch/h8300/Kconfig.cpu:139:warning: defaults for choice values not supported
arch/m68knommu/Kconfig:607:warning: choice values currently only support a single prompt
arch/blackfin/Kconfig:553:warning: choice values currently only support a single prompt
arch/m68knommu/Kconfig:612:warning: choice values currently only support a single prompt
arch/x86_64/Kconfig:132:warning: choice values currently only support a single prompt
arch/x86_64/Kconfig:168:warning: choice values currently only support a single prompt
arch/x86_64/Kconfig:151:warning: choice values currently only support a single prompt
arch/m32r/Kconfig:187:warning: defaults for choice values not supported
arch/m32r/Kconfig:343:warning: choice values currently only support a single prompt
arch/m32r/Kconfig:359:warning: choice values currently only support a single prompt
arch/m32r/Kconfig:362:warning: choice values currently only support a single prompt
arch/i386/Kconfig:1094:warning: choice values currently only support a single prompt
arch/i386/Kconfig:1100:warning: choice values currently only support a single prompt
arch/i386/Kconfig:1103:warning: choice values currently only support a single prompt
arch/blackfin/Kconfig:548:warning: choice values currently only support a single prompt
arch/h8300/Kconfig.cpu:102:warning: choice values currently only support a single prompt
arch/h8300/Kconfig.cpu:125:warning: defaults for choice values not supported
arch/h8300/Kconfig.cpu:139:warning: defaults for choice values not supported
arch/blackfin/Kconfig:553:warning: choice values currently only support a single prompt
arch/h8300/Kconfig.cpu:107:warning: choice values currently only support a single prompt
arch/arm/mm/Kconfig:541:warning: choice values currently only support a single prompt
arch/sh/Kconfig:346:warning: choice values currently only support a single prompt
arch/m32r/Kconfig:163:warning: choice values currently only support a single prompt
arch/m32r/Kconfig:164:warning: defaults for choice values not supported
arch/sh/Kconfig:343:warning: choice values currently only support a single prompt
arch/s390/Kconfig:67:warning: defaults for choice values not supported
arch/sh/mm/Kconfig:268:warning: choice values currently only support a single prompt
arch/sh/mm/Kconfig:270:warning: defaults for choice values not supported
arch/alpha/Kconfig:15:warning: defaults for choice values not supported
arch/ia64/Kconfig:26:warning: defaults for choice values not supported
arch/parisc/Kconfig:145:warning: choice values currently only support a single prompt
arch/powerpc/Kconfig:23:warning: defaults for choice values not supported
arch/s390/Kconfig:60:warning: choice values currently only support a single prompt
arch/sparc64/Kconfig:29:warning: defaults for choice values not supported
arch/x86_64/Kconfig:19:warning: defaults for choice values not supported
arch/sh/mm/Kconfig:318:warning: choice values currently only support a single prompt
arch/sh/mm/Kconfig:323:warning: choice values currently only support a single prompt
arch/sh/mm/Kconfig:329:warning: choice values currently only support a single prompt
kernel/Kconfig.hz:20:warning: choice values currently only support a single prompt
kernel/Kconfig.hz:27:warning: choice values currently only support a single prompt
kernel/Kconfig.hz:43:warning: choice values currently only support a single prompt
arch/ppc/Kconfig:795:warning: defaults for choice values not supported
arch/ppc/Kconfig:90:warning: choice values currently only support a single prompt
arch/ppc/Kconfig:94:warning: choice values currently only support a single prompt
arch/ppc/Kconfig:101:warning: choice values currently only support a single prompt
arch/ppc/Kconfig:585:warning: choice values currently only support a single prompt
arch/ppc/Kconfig:395:warning: choice values currently only support a single prompt
arch/ppc/Kconfig:399:warning: choice values currently only support a single prompt
arch/ppc/Kconfig:407:warning: choice values currently only support a single prompt
arch/ppc/Kconfig:522:warning: choice values currently only support a single prompt
arch/ppc/Kconfig:537:warning: choice values currently only support a single prompt
arch/ppc/8xx_io/Kconfig:109:warning: choice values currently only support a single prompt
arch/ppc/8xx_io/Kconfig:112:warning: choice values currently only support a single prompt
arch/ppc/8xx_io/Kconfig:117:warning: choice values currently only support a single prompt
arch/ppc/8xx_io/Kconfig:122:warning: choice values currently only support a single prompt
arch/ppc/platforms/85xx/Kconfig:20:warning: choice values currently only support a single prompt arch/ppc/platforms/85xx/Kconfig:35:warning: choice values currently only support a single prompt
arch/ppc/Kconfig:1270:warning: choice values currently only support a single prompt
arch/ppc/Kconfig:1273:warning: choice values currently only support a single prompt
arch/ppc/Kconfig:1276:warning: choice values currently only support a single prompt
arch/ppc/Kconfig:1279:warning: choice values currently only support a single prompt
arch/ppc/Kconfig.debug:20:warning: choice values currently only support a single prompt
arch/ppc/Kconfig.debug:23:warning: choice values currently only support a single prompt
arch/ppc/Kconfig.debug:26:warning: choice values currently only support a single prompt
arch/ppc/Kconfig.debug:29:warning: choice values currently only support a single prompt
arch/powerpc/Kconfig:196:warning: choice values currently only support a single prompt
arch/powerpc/Kconfig:200:warning: choice values currently only support a single prompt
arch/powerpc/Kconfig:205:warning: choice values currently only support a single prompt
arch/powerpc/platforms/44x/Kconfig:10:warning: choice values currently only support a single prompt arch/powerpc/platforms/44x/Kconfig:12:warning: defaults for choice values not supported
arch/powerpc/platforms/85xx/Kconfig:7:warning: choice values currently only support a single prompt arch/powerpc/platforms/85xx/Kconfig:13:warning: choice values currently only support a single prompt arch/powerpc/platforms/8xx/Kconfig:14:warning: choice values currently only support a single prompt arch/powerpc/platforms/8xx/Kconfig:18:warning: choice values currently only support a single prompt arch/powerpc/platforms/8xx/Kconfig:26:warning: choice values currently only support a single prompt arch/powerpc/platforms/8xx/Kconfig:53:warning: choice values currently only support a single prompt arch/powerpc/platforms/8xx/Kconfig:60:warning: choice values currently only support a single prompt arch/powerpc/platforms/prep/Kconfig:2:warning: choice values currently only support a single prompt arch/powerpc/platforms/prep/Kconfig:9:warning: defaults for choice values not supported
arch/powerpc/platforms/Kconfig:20:warning: choice values currently only support a single prompt
arch/powerpc/Kconfig:725:warning: choice values currently only support a single prompt
arch/powerpc/Kconfig:728:warning: choice values currently only support a single prompt
arch/powerpc/Kconfig:731:warning: choice values currently only support a single prompt
arch/powerpc/Kconfig:734:warning: choice values currently only support a single prompt
arch/powerpc/platforms/8xx/Kconfig:109:warning: choice values currently only support a single prompt arch/powerpc/platforms/8xx/Kconfig:112:warning: choice values currently only support a single prompt arch/powerpc/platforms/8xx/Kconfig:117:warning: choice values currently only support a single prompt arch/powerpc/platforms/8xx/Kconfig:122:warning: choice values currently only support a single prompt arch/powerpc/Kconfig.debug:66:warning: choice values currently only support a single prompt
arch/powerpc/Kconfig.debug:69:warning: choice values currently only support a single prompt
arch/powerpc/Kconfig.debug:72:warning: choice values currently only support a single prompt
arch/powerpc/Kconfig.debug:75:warning: choice values currently only support a single prompt
arch/mips/Kconfig:1277:warning: choice values currently only support a single prompt
arch/mips/Kconfig:1285:warning: choice values currently only support a single prompt
arch/mips/Kconfig:1304:warning: choice values currently only support a single prompt
arch/sh64/Kconfig:133:warning: choice values currently only support a single prompt
arch/sparc64/Kconfig:211:warning: choice values currently only support a single prompt
arch/sh64/Kconfig:136:warning: choice values currently only support a single prompt
arch/sparc64/Kconfig:203:warning: choice values currently only support a single prompt
arch/m32r/Kconfig:163:warning: choice values currently only support a single prompt
arch/m32r/Kconfig:164:warning: defaults for choice values not supported
arch/mips/Kconfig:798:warning: choice values currently only support a single prompt
arch/arm/mm/Kconfig:541:warning: choice values currently only support a single prompt
arch/mips/Kconfig:794:warning: choice values currently only support a single prompt
arch/sh/mm/Kconfig:343:warning: choice values currently only support a single prompt
arch/sparc64/Kconfig:211:warning: choice values currently only support a single prompt
arch/sh/mm/Kconfig:350:warning: choice values currently only support a single prompt
arch/sh/mm/Kconfig:353:warning: choice values currently only support a single prompt
arch/sh/mm/Kconfig:343:warning: choice values currently only support a single prompt
arch/sh64/Kconfig:133:warning: choice values currently only support a single prompt
arch/i386/Kconfig:128:warning: choice values currently only support a single prompt
arch/i386/Kconfig.cpu:138:warning: choice values currently only support a single prompt
arch/i386/Kconfig.cpu:108:warning: choice values currently only support a single prompt
arch/alpha/Kconfig:557:error: found recursive dependency: NUMA -> ARCH_SPARSEMEM_ENABLE -> ARCH_SELECT_MEMORY_MODEL -> SELECT_MEMORY_MODEL -> DISCONTIGMEM -> NUMA
-> X86_64_ACPI_NUMA -> ACPI -> ACPI_ACarch/powerpc/Kconfig:166:error: found recursive dependency: PPC_83xx -> 83xx -> PPC_83xx
-> 6xx -> PPC_STD_MMU -> SMP -> SOFTWARE_SUSPEND -> PM_STD_PARTITIONarch/alpha/Kconfig:301:error: found recursive dependency: ISA -> EISA -> ISA -> SND_WAVEFRONTinit/Kconfig:427:error: found recursive dependency: HOTPLUG -> HOTPLUG_CPU -> HOTPLUG
-> PCCARD -> PCMCIA -> NET_PCMCIA -> PCMCIA_FMVJ18Xarch/arm/Kconfig:775:error: found recursive dependency: ZBOOT_ROM -> ZBOOT_ROM_TEXT -> ZBOOT_ROM -> XIP_KERNEL -> XIP_PHYS_ADDRARCH=x86_64
Notice we now have a few _valid_ "select refter to undefined symbol".
All the "choice values currently only support a single prompt" are caused by using the same config symbol in a choice list for several architectures. That will be the biggest challenge to fix before we can introduce this patch. Maybe we can extend kconfig to accept it???
Patch follow.
I had to do: touch arch/um/Kconfig.arch
to actually run mconf.
Sam
a/Kconfig | 105 ++++++++++++++++++++++++++++++++++ b/arch/arm/Kconfig | 2 b/arch/arm26/Kconfig | 2 b/arch/avr32/Kconfig | 2 b/arch/blackfin/Kconfig | 2 b/arch/cris/Kconfig | 2 b/arch/frv/Kconfig | 2 b/arch/h8300/Kconfig | 2 b/arch/i386/Kconfig | 2 b/arch/ia64/Kconfig | 2 b/arch/m32r/Kconfig | 2 b/arch/m68k/Kconfig | 2 b/arch/m68knommu/Kconfig | 2 b/arch/mips/Kconfig | 2 b/arch/parisc/Kconfig | 2 b/arch/powerpc/Kconfig | 2 b/arch/ppc/Kconfig | 2 b/arch/s390/Kconfig | 2 b/arch/sh/Kconfig | 2 b/arch/sh64/Kconfig | 2 b/arch/sparc/Kconfig | 2 b/arch/sparc64/Kconfig | 2 b/arch/um/Kconfig | 2 b/arch/v850/Kconfig | 2 b/arch/x86_64/Kconfig | 2 b/arch/xtensa/Kconfig | 2 b/scripts/kconfig/lex.zconf.c_shipped | 19 +++--- 27 files changed, 115 insertions(+), 59 deletions(-)
scripts/kconfig/lex.zconf.c_shipped +10 -9
@@ -2293,7 +2293,16 @@ void zconf_initscan(const char *name) void zconf_nextfile(const char *name) { struct file *file = file_lookup(name); - struct buffer *buf = malloc(sizeof(*buf)); + struct buffer *buf; + if (file->flags & FILE_BUSY) { + printf("kconfig: recursive scan (%s)?\n", name); + exit(1); + } + if (file->flags & FILE_SCANNED) { + //printf("kconfig: file %s already scanned?\n", name); + return; + } + buf = malloc(sizeof(*buf)); memset(buf, 0, sizeof(*buf)); current_buf->state = YY_CURRENT_BUFFER;
@@ -2306,14 +2315,6 @@ void zconf_nextfile(const char *name) buf->parent = current_buf; current_buf = buf; - if (file->flags & FILE_BUSY) { - printf("recursive scan (%s)?\n", name); - exit(1); - } - if (file->flags & FILE_SCANNED) { - printf("file %s already scanned?\n", name); - exit(1); - } file->flags |= FILE_BUSY; file->lineno = 1; file->parent = current_file;
Kconfig new file +105 -0
105 lines not on this page · raw message
arch/arm/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see Documentation/kbuild/kconfig-language.txt. # -mainmenu "Linux Kernel Configuration" - config ARM bool default y
arch/arm26/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see Documentation/kbuild/kconfig-language.txt. # -mainmenu "Linux Kernel Configuration" - config ARM bool default y
arch/avr32/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see Documentation/kbuild/kconfig-language.txt. # -mainmenu "Linux Kernel Configuration" - config AVR32 bool default y
arch/blackfin/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see Documentation/kbuild/kconfig-language.txt. # -mainmenu "uClinux/Blackfin (w/o MMU) Kernel Configuration" - config MMU bool default n
arch/cris/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see the Configure script. # -mainmenu "Linux/CRIS Kernel Configuration" - config MMU bool default y
arch/frv/Kconfig +0 -2
@@ -57,8 +57,6 @@ config ARCH_HAS_ILOG2_U64 bool default y -mainmenu "Fujitsu FR-V Kernel Configuration" - source "init/Kconfig"
arch/h8300/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see Documentation/kbuild/config-language.txt. # -mainmenu "uClinux/h8300 (w/o MMU) Kernel Configuration" - config H8300 bool default y
arch/i386/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see Documentation/kbuild/kconfig-language.txt. # -mainmenu "Linux Kernel Configuration" - config X86_32 bool default y
arch/ia64/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see Documentation/kbuild/kconfig-language.txt. # -mainmenu "IA-64 Linux Kernel Configuration" - source "init/Kconfig" menu "Processor type and features"
arch/m32r/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see Documentation/kbuild/kconfig-language.txt. # -mainmenu "Linux/M32R Kernel Configuration" - config M32R bool default y
arch/m68k/Kconfig +0 -2
@@ -45,8 +45,6 @@ config ARCH_MAY_HAVE_PC_FDC config NO_IOPORT def_bool y -mainmenu "Linux/68k Kernel Configuration" - source "init/Kconfig" menu "Platform dependent setup"
arch/m68knommu/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see Documentation/kbuild/kconfig-language.txt. # -mainmenu "uClinux/68k (w/o MMU) Kernel Configuration" - config M68K bool default y
arch/mips/Kconfig +0 -2
@@ -4,8 +4,6 @@ config MIPS # Horrible source of confusion. Die, die, die ... select EMBEDDED -mainmenu "Linux/MIPS Kernel Configuration" - menu "Machine selection" config ZONE_DMA
arch/parisc/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see Documentation/kbuild/kconfig-language.txt. # -mainmenu "Linux/PA-RISC Kernel Configuration" - config PARISC def_bool y help
arch/powerpc/Kconfig +0 -2
@@ -2,8 +2,6 @@ # see Documentation/kbuild/kconfig-language.txt. # -mainmenu "Linux/PowerPC Kernel Configuration" - config PPC64 bool "64-bit kernel" default n
arch/ppc/Kconfig +0 -2
@@ -2,8 +2,6 @@ # see Documentation/kbuild/kconfig-language.txt. # -mainmenu "Linux/PowerPC Kernel Configuration" - config MMU bool default y
arch/s390/Kconfig +0 -2
@@ -47,8 +47,6 @@ config NO_IOMEM config NO_DMA def_bool y -mainmenu "Linux Kernel Configuration" - config S390 def_bool y
arch/sh/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see Documentation/kbuild/kconfig-language.txt. # -mainmenu "Linux/SuperH Kernel Configuration" - config SUPERH bool default y
arch/sh64/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see Documentation/kbuild/config-language.txt. # -mainmenu "Linux/SH64 Kernel Configuration" - config SUPERH bool default y
arch/sparc/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see Documentation/kbuild/kconfig-language.txt. # -mainmenu "Linux/SPARC Kernel Configuration" - config MMU bool default y
arch/sparc64/Kconfig +0 -2
@@ -3,8 +3,6 @@ # see the Configure script. # -mainmenu "Linux/UltraSPARC Kernel Configuration" - config SPARC bool default y
arch/um/Kconfig +0 -2
@@ -19,8 +19,6 @@ config MMU config NO_IOMEM def_bool y -mainmenu "Linux/Usermode Kernel Configuration" - config ISA bool
arch/v850/Kconfig +0 -2
@@ -5,8 +5,6 @@ # ############################################################################# -mainmenu "uClinux/v850 (w/o MMU) Kernel Configuration" - config MMU bool default n
arch/x86_64/Kconfig +0 -2
@@ -7,8 +7,6 @@ # ISA drivers you need yourself. # -mainmenu "Linux Kernel Configuration" - config X86_64 bool default y
arch/xtensa/Kconfig +0 -2
@@ -1,8 +1,6 @@ # For a description of the syntax of this configuration file, # see Documentation/kbuild/config-language.txt. -mainmenu "Linux/Xtensa Kernel Configuration" - config FRAME_POINTER bool default n
Hi,
Quoted 10 lines · Sam Ravnborg
I did a quick hack so kconfig could scan all
Kconfigfiles in the kernel tree.
By scanning allKconfigfiles we gain the following:-> kconfig can report when a depends on refer to an undefined symbol -> kconfig can report when a select refer to an undefined symbol
Later we can push a lot of common stuff to the top-level
Kconfigfile. And that may in the end result in a better structure overall forKconfigfiles.
Well, some of that stuff should already happen earlier (and included from the arch Kconfig files), but that doesn't work for everything. I don't think that simply allowing to parse a file multiple times is the right answer, as it duplicates a lot of data. A simple example would be help texts, right now they are per symbol, but they should really be per menu, so archs can provide different help texts for something. "source" should become a bit more intelligent and parse a file only once and link the data into the menu structure.
Quoted 4 lines
All the "choice values currently only support a single prompt" are caused by using the same config symbol in a choice list for several architectures. That will be the biggest challenge to fix before we can introduce this patch. Maybe we can extend kconfig to accept it???
Define "accept".
The basic rule for choice values must not be violated - none of them may depend on another value in the same group. The dependency tree allows for no loops, these choice groups allow for the only exception, but it has to stay within that group.
One option I'm thinking about is to extend that group by naming the choice option, so kconfig knows they are related. This won't work for everything, so quite some renaming may be needed.
bye, Roman
Quoted 29 lines · On Mon, 21 May 2007 03:43:45 +0200 (CEST) Roman Zippel wrote:
Hi,
Quoted 10 lines · Sam Ravnborg
I did a quick hack so kconfig could scan all
Kconfigfiles in the kernel tree.
By scanning allKconfigfiles we gain the following:-> kconfig can report when a depends on refer to an undefined symbol -> kconfig can report when a select refer to an undefined symbol
Later we can push a lot of common stuff to the top-level
Kconfigfile. And that may in the end result in a better structure overall forKconfigfiles.Well, some of that stuff should already happen earlier (and included from the arch
Kconfigfiles), but that doesn't work for everything. I don't think that simply allowing to parse a file multiple times is the right answer, as it duplicates a lot of data. A simple example would be help texts, right now they are per symbol, but they should really be per menu, so archs can provide different help texts for something. "source" should become a bit more intelligent and parse a file only once and link the data into the menu structure.Quoted 4 lines
All the "choice values currently only support a single prompt" are caused by using the same config symbol in a choice list for several architectures. That will be the biggest challenge to fix before we can introduce this patch. Maybe we can extend kconfig to accept it???
Quoted 8 lines
Define "accept".
The basic rule for choice values must not be violated - none of them may depend on another value in the same group. The dependency tree allows for no loops, these choice groups allow for the only exception, but it has to stay within that group.
One option I'm thinking about is to extend that group by naming the choice option, so kconfig knows they are related. This won't work for everything, so quite some renaming may be needed.
how about something that I mentioned a few days ago (in another mail thread):
Make this work: (-ENOPATCH)
if S390
include "some s390-specific Kconfig file"
endif
and if ARCH!=S390, don't read that file.
Actually it should be any kconfig-language statements inside the if-block /methinks.
I understand that *conf treats all kconfig symbols as variable, but ARCH=blah isn't really variable after it has been set.
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Quoted 11 lines · Roman Zippel
Hi,
Quoted 7 lines · Sam Ravnborg
I did a quick hack so kconfig could scan all
Kconfigfiles in the kernel tree.
By scanning allKconfigfiles we gain the following:-> kconfig can report when a depends on refer to an undefined symbol -> kconfig can report when a select refer to an undefined symbol
Quoted 6 lines
Quoted 3 lines
Later we can push a lot of common stuff to the top-level
Kconfigfile. And that may in the end result in a better structure overall forKconfigfiles.Well, some of that stuff should already happen earlier (and included from the arch
Kconfigfiles), but that doesn't work for everything.
Agreed - but it seems that cleaning up Kconfig files are not sexy enough.
Quoted 6 lines
I don't think that simply allowing to parse a file multiple times is the right answer, as it duplicates a lot of data. A simple example would be help texts, right now they are per symbol, but they should really be per menu, so archs can provide different help texts for something. "source" should become a bit more intelligent and parse a file only once and link the data into the menu structure.
My quick hack was to parse the files only once which is obviously wrong.
I do not get the part about help text pr. menu??
I was more considering that we could share as much as possible between two symbols that are identical except for their dependencies.
Quoted 5 lines
Quoted 4 lines
All the "choice values currently only support a single prompt" are caused by using the same config symbol in a choice list for several architectures. That will be the biggest challenge to fix before we can introduce this patch. Maybe we can extend kconfig to accept it???
Quoted 8 lines
Define "accept".
The basic rule for choice values must not be violated - none of them may depend on another value in the same group. The dependency tree allows for no loops, these choice groups allow for the only exception, but it has to stay within that group.
One option I'm thinking about is to extend that group by naming the choice option, so kconfig knows they are related. This won't work for everything, so quite some renaming may be needed.
I do not follow you completely here.
Anyway - the main purpose was to say that there are other ways to deal with select than just ignoring an otherwise good warning.
Sam
Quoted 4 lines
A simple example would be
help texts, right now they are per symbol, but they should really be per menu, so archs can provide different help texts for something.
This one turned out easy.
I assume what you had in mind was something like the attached.
With this the help entry present is no loger tha last one seen but the one belonging to the menu (the symbol used within that menu).
So if I have:
menu "My first menu"
config FOO
bool "Foobar"
help
First menu help
endmenu
menu "My second menu"
config FOO
bool "barfoo"
help
Second menu help
endmenu
Then the help text will be the expected one in the two menus.
gconf + qconf will be fixed later if you are OK with this one. This is IMO a general improvement and should be finished and applied.
Sam
scripts/kconfig/conf.c +11 -11
@@ -187,9 +187,9 @@ int conf_string(struct menu *menu)/* print help */ if (line[1 ] =='\n' ) { help = nohelp_text; -if (menu->sym->help) - help = menu->sym->help; -printf ("\n%s\n" , menu->sym->help); +if (menu->help) + help = menu->help; +printf ("\n%s\n" , menu->help); def =NULL ;break ; }
@@ -233,7 +233,7 @@ static int conf_sym(struct menu *menu)printf ("/m" );if (oldval != yes &&sym_tristate_within_range (sym, yes))printf ("/y" ); -if (sym->help) +if (menu->help)printf ("/?" );printf ("] " );conf_askvalue (sym,sym_get_string_value (sym));
@@ -270,8 +270,8 @@ static int conf_sym(struct menu *menu)return 0 ; help: help = nohelp_text; -if (sym->help) - help = sym->help; +if (menu->help) + help = menu->help;printf ("\n%s\n" , help); } }
@@ -342,7 +342,7 @@ static int conf_choice(struct menu *menu) goto conf_childs; }printf ("[1-%d" , cnt); -if (sym->help) +if (menu->help)printf ("?" );printf ("]: " );switch (input_mode) {
@@ -359,8 +359,8 @@ static int conf_choice(struct menu *menu)fgets (line,128 , stdin);strip (line);if (line[0 ] =='?' ) { -printf ("\n%s\n" , menu->sym->help ? - menu->sym->help : nohelp_text); +printf ("\n%s\n" , menu->help ? + menu->help : nohelp_text);continue ; }if (!line[0 ])
@@ -391,8 +391,8 @@ static int conf_choice(struct menu *menu)if (!child)continue ;if (line[strlen (line) -1 ] =='?' ) { -printf ("\n%s\n" , child->sym->help ? - child->sym->help : nohelp_text); +printf ("\n%s\n" , child->help ? + child->help : nohelp_text);continue ; }sym_set_choice_value (sym, child->sym);
scripts/kconfig/expr.h +2 -2
@@ -71,7 +71,7 @@ enum {struct symbol {struct symbol *next;char *name; -char *help; +//char *help; enum symbol_type type;struct symbol_value curr;struct symbol_value def[4 ];
@@ -139,7 +139,7 @@ struct menu {struct property *prompt;struct expr *dep;unsigned int flags; -//char *help; +char *help;struct file *file;int lineno;void *data;
scripts/kconfig/kxgettext.c +2 -2
@@ -170,8 +170,8 @@ void menu_build_message_list(struct menu *menu) menu->file ==NULL ?"Root Menu" : menu->file->name, menu->lineno); -if (menu->sym !=NULL && menu->sym->help !=NULL ) -message__add (menu->sym->help, menu->sym->name, +if (menu->sym !=NULL && menu->help !=NULL ) +message__add (menu->help, menu->sym->name, menu->file ==NULL ?"Root Menu" : menu->file->name, menu->lineno);
scripts/kconfig/mconf.c +2 -2
@@ -718,11 +718,11 @@ static void show_help(struct menu *menu)struct gstr help =str_new ();struct symbol *sym = menu->sym; -if (sym->help) +if (menu->help) {if (sym->name) {str_printf (&help,"CONFIG_%s:\n\n" , sym->name); -str_append (&help,_ (sym->help)); +str_append (&help,_ (menu->help));str_append (&help,"\n" ); } }else {
scripts/kconfig/zconf.tab.c_shipped +6 -6
@@ -1722,7 +1722,7 @@ yyreduce: case 83: { - current_entry->sym->help = (yyvsp[0].string); + current_entry->help = (yyvsp[0].string); ;} break;
@@ -2280,11 +2280,11 @@ void print_symbol(FILE *out, struct menu *menu) break; } } - if (sym->help) { - int len = strlen(sym->help); - while (sym->help[--len] == '\n') - sym->help[len] = 0; - fprintf(out, " help\n%s\n", sym->help); + if (menu->help) { + int len = strlen(menu->help); + while (menu->help[--len] == '\n') + menu->help[len] = 0; + fprintf(out, " help\n%s\n", menu->help); } fputc('\n', out); }
scripts/kconfig/zconf.y +6 -6
@@ -402,7 +402,7 @@ help_start: T_HELP T_EOL help: help_start T_HELPTEXT { - current_entry->sym->help = $2; + current_entry->help = $2; }; /* depends option */
@@ -649,11 +649,11 @@ void print_symbol(FILE *out, struct menu *menu) break; } } - if (sym->help) { - int len = strlen(sym->help); - while (sym->help[--len] == '\n') - sym->help[len] = 0; - fprintf(out, " help\n%s\n", sym->help); + if (menu->help) { + int len = strlen(menu->help); + while (menu->help[--len] == '\n') + menu->help[len] = 0; + fprintf(out, " help\n%s\n", menu->help); } fputc('\n', out); }
Hi,
Quoted 6 lines · Sam Ravnborg
Quoted 3 lines
A simple example would be
help texts, right now they are per symbol, but they should really be per menu, so archs can provide different help texts for something.This one turned out easy.
I assume what you had in mind was something like the attached.
Yes, but if we change it, we should also add wrapper functions like menu_get_help()/menu_has_help() (where menu_get_help() could also return some generated text).
bye, Roman