14 Aug, 2020

1 commit


12 May, 2020

1 commit


13 Mar, 2020

2 commits

  • The 'imply' statement may create unmet direct dependency when the
    implied symbol depends on m.

    [Test Code]

    config FOO
    tristate "foo"
    imply BAZ

    config BAZ
    tristate "baz"
    depends on BAR

    config BAR
    def_tristate m

    config MODULES
    def_bool y
    option modules

    If you set FOO=y, BAZ is also promoted to y, which results in the
    following .config file:

    CONFIG_FOO=y
    CONFIG_BAZ=y
    CONFIG_BAR=m
    CONFIG_MODULES=y

    This does not meet the dependency 'BAZ depends on BAR'.

    Unlike 'select', what is worse, Kconfig never shows the
    'WARNING: unmet direct dependencies detected for ...' for this case.

    Because 'imply' is considered to be weaker than 'depends on', Kconfig
    should take the direct dependency into account.

    For clarification, describe this case in kconfig-language.rst too.

    Signed-off-by: Masahiro Yamada
    Acked-by: Nicolas Pitre
    Tested-by: Geert Uytterhoeven

    Masahiro Yamada
     
  • The 'imply' keyword restricts a symbol to y or n, excluding m
    when it is implied by y. This is the original behavior since
    commit 237e3ad0f195 ("Kconfig: Introduce the "imply" keyword").

    However, the author of this feature, Nicolas Pitre, stated that
    the 'imply' keyword should not impose any restrictions.
    (https://lkml.org/lkml/2020/2/19/714)

    I agree, and want to get rid of this tricky behavior.

    Suggested-by: Nicolas Pitre
    Signed-off-by: Masahiro Yamada
    Acked-by: Nicolas Pitre

    Masahiro Yamada
     

07 Jan, 2020

2 commits


13 Jul, 2019

1 commit

  • Pull Kconfig updates from Masahiro Yamada:

    - always require argument for --defconfig and remove the hard-coded
    arch/$(ARCH)/defconfig path

    - make arch/$(SRCARCH)/configs/defconfig the new default of defconfig

    - some code cleanups

    * tag 'kconfig-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    kconfig: remove meaningless if-conditional in conf_read()
    kconfig: Fix spelling of sym_is_changable
    unicore32: rename unicore32_defconfig to defconfig
    kconfig: make arch/*/configs/defconfig the default of KBUILD_DEFCONFIG
    kconfig: add static qualifier to expand_string()
    kconfig: require the argument of --defconfig
    kconfig: remove always false ifeq ($(KBUILD_DEFCONFIG,) conditional

    Linus Torvalds
     

06 Jul, 2019

1 commit


15 Jun, 2019

1 commit

  • The kbuild documentation clearly shows that the documents
    there are written at different times: some use markdown,
    some use their own peculiar logic to split sections.

    Convert everything to ReST without affecting too much
    the author's style and avoiding adding uneeded markups.

    The conversion is actually:
    - add blank lines and identation in order to identify paragraphs;
    - fix tables markups;
    - add some lists markups;
    - mark literal blocks;
    - adjust title markups.

    At its new index.rst, let's add a :orphan: while this is not linked to
    the main index.rst file, in order to avoid build warnings.

    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

28 Dec, 2018

2 commits

  • I want to compile each C file independently instead of including all
    of them from zconf.y.

    Split out confdata.c, expr.c, symbol.c, and preprocess.c .
    These are low-hanging fruits.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • All files in lxdialog/ are licensed under GPL-2.0+, and the rest are
    under GPL-2.0. I added GPL-2.0 tags to test scripts in tests/.

    Documentation/process/license-rules.rst does not suggest anything
    about the flex/bison files. Because flex does not accept the C++
    comment style at the very top of a file, I used the C style for
    zconf.l, and so for zconf.y for consistency.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

08 Dec, 2018

1 commit

  • The S_OTHER type could be set only when conf_read_simple() is reading
    include/config/auto.conf file.

    For example, CONFIG_FOO=y exists in include/config/auto.conf but it is
    missing from the currently parsed Kconfig files, sym_lookup() allocates
    a new symbol, and sets its type to S_OTHER.

    Strangely, it will be set to S_STRING by conf_set_sym_val() a few lines
    below while it is obviously bool or tristate type. On the other hand,
    when CONFIG_BAR="bar" is being dropped from include/config/auto.conf,
    its type remains S_OTHER. Because for_all_symbols() omits S_OTHER
    symbols, conf_touch_deps() misses to touch include/config/bar.h

    This behavior has been a pretty mystery for me, and digging the git
    histroy did not help. At least, touching depfiles is broken for string
    type symbols.

    I removed S_OTHER entirely, and reimplemented it more simply.

    If CONFIG_FOO was visible in the previous syncconfig, but is missing
    now, what we want to do is quite simple; just call conf_touch_dep()
    to touch include/config/foo.h instead of allocating a new symbol data.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

22 Aug, 2018

3 commits

  • This commit improves the messages of the recursive dependency.
    Currently, sym->dir_dep.expr is not checked. Hence, any dependency
    in property visibility is regarded as the dependency of the symbol.

    [Test Code 1]

    config A
    bool "a"
    depends on B

    config B
    bool "b"
    depends on A

    [Test Code 2]

    config A
    bool "a" if B

    config B
    bool "b"
    depends on A

    For both cases above, the same message is displayed:

    symbol B depends on A
    symbol A depends on B

    This commit changes the message for the latter, like this:

    symbol B depends on A
    symbol A prompt is visible depending on B

    Also, 'select' and 'imply' are distinguished.

    Signed-off-by: Masahiro Yamada
    Tested-by: Dirk Gouders

    Masahiro Yamada
     
  • Currently, Kconfig does not complain about the recursive dependency
    where 'imply' keywords are involved.

    [Test Code]

    config A
    bool "a"

    config B
    bool "b"
    imply A
    depends on A

    In the code above, Kconfig cannot calculate the symbol values correctly
    due to the circular dependency. For example, allyesconfig followed by
    syncconfig results in an odd behavior because CONFIG_B becomes visible
    in syncconfig.

    $ make allyesconfig
    scripts/kconfig/conf --allyesconfig Kconfig
    #
    # configuration written to .config
    #
    $ cat .config
    #
    # Automatically generated file; DO NOT EDIT.
    # Main menu
    #
    CONFIG_A=y
    $ make syncconfig
    scripts/kconfig/conf --syncconfig Kconfig
    *
    * Restart config...
    *
    *
    * Main menu
    *
    a (A) [Y/n/?] y
    b (B) [N/y/?] (NEW)

    To detect this correctly, sym_check_expr_deps() should recurse to
    not only sym->rev_dep.expr but also sym->implied.expr .

    At this moment, sym_check_print_recursive() cannot distinguish
    'select' and 'imply' since it does not know the precise context
    where the recursive dependency has been hit. This will be solved
    by the next commit.

    In fact, even the document and the unit-test are confused. Using
    'imply' does not solve recursive dependency since 'imply' addresses
    the unmet direct dependency, which 'select' could cause.

    Signed-off-by: Masahiro Yamada
    Tested-by: Dirk Gouders

    Masahiro Yamada
     
  • Originally, recursive dependency was a fatal error for Kconfig
    because Kconfig cannot compute symbol values in such a situation.

    Commit d595cea62403 ("kconfig: print more info when we see a recursive
    dependency") changed it to a warning, which I guess was not intentional.

    Get it back to an error again.

    Also, rename the unit test directory "warn_recursive_dep" to
    "err_recursive_dep" so that it matches to the behavior.

    Signed-off-by: Masahiro Yamada
    Tested-by: Dirk Gouders

    Masahiro Yamada
     

14 Aug, 2018

2 commits


18 Jul, 2018

1 commit

  • Over time, the use of the flag SYMBOL_AUTO changed from initially
    marking three automatically generated symbols ARCH, KERNELRELEASE and
    UNAME_RELEASE to today's effect of protecting symbols from being
    written out.

    Currently, only symbols of type CHOICE and those with option
    defconf_list set have that flag set.

    Reflect that change in semantics in the flag's name.

    Signed-off-by: Dirk Gouders
    Signed-off-by: Masahiro Yamada

    Dirk Gouders
     

29 May, 2018

2 commits

  • There is no more caller of sym_expand_string_value().

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Kees Cook

    Masahiro Yamada
     
  • To get access to environment variables, Kconfig needs to define a
    symbol using "option env=" syntax. It is tedious to add a symbol entry
    for each environment variable given that we need to define much more
    such as 'CC', 'AS', 'srctree' etc. to evaluate the compiler capability
    in Kconfig.

    Adding '$' for symbol references is grammatically inconsistent.
    Looking at the code, the symbols prefixed with 'S' are expanded by:
    - conf_expand_value()
    This is used to expand 'arch/$ARCH/defconfig' and 'defconfig_list'
    - sym_expand_string_value()
    This is used to expand strings in 'source' and 'mainmenu'

    All of them are fixed values independent of user configuration. So,
    they can be changed into the direct expansion instead of symbols.

    This change makes the code much cleaner. The bounce symbols 'SRCARCH',
    'ARCH', 'SUBARCH', 'KERNELVERSION' are gone.

    sym_init() hard-coding 'UNAME_RELEASE' is also gone. 'UNAME_RELEASE'
    should be replaced with an environment variable.

    ARCH_DEFCONFIG is a normal symbol, so it should be simply referenced
    without '$' prefix.

    The new syntax is addicted by Make. The variable reference needs
    parentheses, like $(FOO), but you can omit them for single-letter
    variables, like $F. Yet, in Makefiles, people tend to use the
    parenthetical form for consistency / clarification.

    At this moment, only the environment variable is supported, but I will
    extend the concept of 'variable' later on.

    The variables are expanded in the lexer so we can simplify the token
    handling on the parser side.

    For example, the following code works.

    [Example code]

    config MY_TOOLCHAIN_LIST
    string
    default "My tools: CC=$(CC), AS=$(AS), CPP=$(CPP)"

    [Result]

    $ make -s alldefconfig && tail -n 1 .config
    CONFIG_MY_TOOLCHAIN_LIST="My tools: CC=gcc, AS=as, CPP=gcc -E"

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Kees Cook

    Masahiro Yamada
     

26 Mar, 2018

3 commits

  • Currently, the unmet dependency warnings end up with endlessly long
    expressions, most of which are false positives.

    Here is test code to demonstrate how it currently works.

    [Test Case]

    config DEP1
    def_bool y

    config DEP2
    bool "DEP2"

    config A
    bool "A"
    select E

    config B
    bool "B"
    depends on DEP2
    select E

    config C
    bool "C"
    depends on DEP1 && DEP2
    select E

    config D
    def_bool n
    select E

    config E
    bool
    depends on DEP1 && DEP2

    [Result]

    $ make config
    scripts/kconfig/conf --oldaskconfig Kconfig
    *
    * Linux Kernel Configuration
    *
    DEP2 (DEP2) [N/y/?] (NEW) n
    A (A) [N/y/?] (NEW) y
    warning: (A && B && D) selects E which has unmet direct
    dependencies (DEP1 && DEP2)

    Here, I see some points to be improved.

    First, '(A || B || D)' would make more sense than '(A && B && D)'.
    I am not sure if this is intentional, but expr_simplify_unmet_dep()
    turns OR expressions into AND, like follows:

    case E_OR:
    return expr_alloc_and(

    Second, we see false positives. 'A' is a real unmet dependency.
    'B' is false positive because 'DEP1' is fixed to 'y', and 'B' depends
    on 'DEP2'. 'C' was correctly dropped by expr_simplify_unmet_dep().
    'D' is also false positive because it has no chance to be enabled.
    Current expr_simplify_unmet_dep() cannot avoid those false positives.

    After all, I decided to use the same helpers as used for printing
    reverse dependencies in the help.

    With this commit, unreadable warnings (most of the reported symbols are
    false positives) in the real world:

    $ make ARCH=score allyesconfig
    scripts/kconfig/conf --allyesconfig Kconfig
    warning: (HWSPINLOCK_QCOM && AHCI_MTK && STMMAC_PLATFORM &&
    DWMAC_IPQ806X && DWMAC_LPC18XX && DWMAC_OXNAS && DWMAC_ROCKCHIP &&
    DWMAC_SOCFPGA && DWMAC_STI && TI_CPSW && PINCTRL_GEMINI &&
    PINCTRL_OXNAS && PINCTRL_ROCKCHIP && PINCTRL_DOVE &&
    PINCTRL_ARMADA_37XX && PINCTRL_STM32 && S3C2410_WATCHDOG &&
    VIDEO_OMAP3 && VIDEO_S5P_FIMC && USB_XHCI_MTK && RTC_DRV_AT91SAM9 &&
    LPC18XX_DMAMUX && VIDEO_OMAP4 && COMMON_CLK_GEMINI &&
    COMMON_CLK_ASPEED && COMMON_CLK_NXP && COMMON_CLK_OXNAS &&
    COMMON_CLK_BOSTON && QCOM_ADSP_PIL && QCOM_Q6V5_PIL && QCOM_GSBI &&
    ATMEL_EBI && ST_IRQCHIP && RESET_IMX7 && PHY_HI6220_USB &&
    PHY_RALINK_USB && PHY_ROCKCHIP_PCIE && PHY_DA8XX_USB) selects
    MFD_SYSCON which has unmet direct dependencies (HAS_IOMEM)
    warning: (PINCTRL_AT91 && PINCTRL_AT91PIO4 && PINCTRL_OXNAS &&
    PINCTRL_PISTACHIO && PINCTRL_PIC32 && PINCTRL_MESON &&
    PINCTRL_NOMADIK && PINCTRL_MTK && PINCTRL_MT7622 && GPIO_TB10X)
    selects OF_GPIO which has unmet direct dependencies (GPIOLIB && OF &&
    HAS_IOMEM)
    warning: (FAULT_INJECTION_STACKTRACE_FILTER && LATENCYTOP && LOCKDEP)
    selects FRAME_POINTER which has unmet direct dependencies
    (DEBUG_KERNEL && (CRIS || M68K || FRV || UML || SUPERH || BLACKFIN ||
    MN10300 || METAG) || ARCH_WANT_FRAME_POINTERS)

    will be turned into:

    $ make ARCH=score allyesconfig
    scripts/kconfig/conf --allyesconfig Kconfig

    WARNING: unmet direct dependencies detected for MFD_SYSCON
    Depends on [n]: HAS_IOMEM [=n]
    Selected by [y]:
    - PINCTRL_STM32 [=y] && PINCTRL [=y] && (ARCH_STM32 ||
    COMPILE_TEST [=y]) && OF [=y]
    - RTC_DRV_AT91SAM9 [=y] && RTC_CLASS [=y] && (ARCH_AT91 ||
    COMPILE_TEST [=y])
    - RESET_IMX7 [=y] && RESET_CONTROLLER [=y]
    - PHY_HI6220_USB [=y] && (ARCH_HISI && ARM64 ||
    COMPILE_TEST [=y])
    - PHY_RALINK_USB [=y] && (RALINK || COMPILE_TEST [=y])
    - PHY_ROCKCHIP_PCIE [=y] && (ARCH_ROCKCHIP && OF [=y] ||
    COMPILE_TEST [=y])

    WARNING: unmet direct dependencies detected for OF_GPIO
    Depends on [n]: GPIOLIB [=y] && OF [=y] && HAS_IOMEM [=n]
    Selected by [y]:
    - PINCTRL_MTK [=y] && PINCTRL [=y] && (ARCH_MEDIATEK ||
    COMPILE_TEST [=y]) && OF [=y]
    - PINCTRL_MT7622 [=y] && PINCTRL [=y] && (ARCH_MEDIATEK ||
    COMPILE_TEST [=y]) && OF [=y] && (ARM64 || COMPILE_TEST [=y])

    WARNING: unmet direct dependencies detected for FRAME_POINTER
    Depends on [n]: DEBUG_KERNEL [=y] && (CRIS || M68K || FRV || UML ||
    SUPERH || BLACKFIN || MN10300 || METAG) || ARCH_WANT_FRAME_POINTERS [=n]
    Selected by [y]:
    - LATENCYTOP [=y] && DEBUG_KERNEL [=y] && STACKTRACE_SUPPORT [=y] &&
    PROC_FS [=y] && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND &&
    !ARC && !X86

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Petr Vorel

    Masahiro Yamada
     
  • Commit 246cf9c26bf1 ("kbuild: Warn on selecting symbols with unmet
    direct dependencies") forcibly promoted ->dir_dep.tri to yes from mod.
    So, the unmet direct dependencies of tristate symbols are not reported.

    [Test Case]

    config MODULES
    def_bool y
    option modules

    config A
    def_bool y
    select B

    config B
    tristate "B"
    depends on m

    This causes unmet dependency because 'B' is forced 'y' ignoring
    'depends on m'. This should be warned.

    On the other hand, the following case ('B' is bool) should not be
    warned, so 'depends on m' for bool symbols should be naturally treated
    as 'depends on y'.

    [Test Case2 (not unmet dependency)]

    config MODULES
    def_bool y
    option modules

    config A
    def_bool y
    select B

    config B
    bool "B"
    depends on m

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • === Background ===

    - Visible n-valued bool/tristate symbols generate a
    '# CONFIG_FOO is not set' line in the .config file. The idea is to
    remember the user selection without having to set a Makefile
    variable. Having n correspond to the variable being undefined in the
    Makefiles makes for easy CONFIG_* tests.

    - Invisible n-valued bool/tristate symbols normally do not generate a
    '# CONFIG_FOO is not set' line, because user values from .config
    files have no effect on invisible symbols anyway.

    Currently, there is one exception to this rule: Any bool/tristate symbol
    that gets the value n through a 'default' property generates a
    '# CONFIG_FOO is not set' line, even if the symbol is invisible.

    Note that this only applies to explicitly given defaults, and not when
    the symbol implicitly defaults to n (like bool/tristate symbols without
    'default' properties do).

    This is inconsistent, and seems redundant:

    - As mentioned, the '# CONFIG_FOO is not set' won't affect the symbol
    once the .config is read back in.

    - Even if the symbol is invisible at first but becomes visible later,
    there shouldn't be any harm in recalculating the default value
    rather than viewing the '# CONFIG_FOO is not set' as a previous
    user value of n.

    === Changes ===

    Change sym_calc_value() to only set SYMBOL_WRITE (write to .config) for
    non-n-valued 'default' properties.

    Note that SYMBOL_WRITE is always set for visible symbols regardless of whether
    they have 'default' properties or not, so this change only affects invisible
    symbols.

    This reduces the size of the x86 .config on my system by about 1% (due
    to removed '# CONFIG_FOO is not set' entries).

    One side effect of (and the main motivation for) this change is making
    the following two definitions behave exactly the same:

    config FOO
    bool

    config FOO
    bool
    default n

    With this change, neither of these will generate a
    '# CONFIG_FOO is not set' line (assuming FOO isn't selected/implied).
    That might make it clearer to people that a bare 'default n' is
    redundant.

    This change only affects generated .config files and not autoconf.h:
    autoconf.h only includes #defines for non-n bool/tristate symbols.

    === Testing ===

    The following testing was done with the x86 Kconfigs:

    - .config files generated before and after the change were compared to
    verify that the only difference is some '# CONFIG_FOO is not set'
    entries disappearing. A couple of these were inspected manually, and
    most turned out to be from redundant 'default n/def_bool n'
    properties.

    - The generated include/generated/autoconf.h was compared before and
    after the change and verified to be identical.

    - As a sanity check, the same modification was done to Kconfiglib.
    The Kconfiglib test suite was then run to check for any mismatches
    against the output of the C implementation.

    Signed-off-by: Ulf Magnusson
    Signed-off-by: Masahiro Yamada

    Ulf Magnusson
     

01 Mar, 2018

1 commit


10 Feb, 2018

2 commits


09 Feb, 2018

2 commits

  • These messages should be directed to stderr.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Ulf Magnusson

    Masahiro Yamada
     
  • "# CONFIG_... is not set" for choice values are wrongly written into
    the .config file if they are once visible, then become invisible later.

    Test case
    ---------

    ---------------------------(Kconfig)----------------------------
    config A
    bool "A"

    choice
    prompt "Choice ?"
    depends on A

    config CHOICE_B
    bool "Choice B"

    config CHOICE_C
    bool "Choice C"

    endchoice
    ----------------------------------------------------------------

    ---------------------------(.config)----------------------------
    CONFIG_A=y
    ----------------------------------------------------------------

    With the Kconfig and .config above,

    $ make config
    scripts/kconfig/conf --oldaskconfig Kconfig
    *
    * Linux Kernel Configuration
    *
    A (A) [Y/n] n
    #
    # configuration written to .config
    #
    $ cat .config
    #
    # Automatically generated file; DO NOT EDIT.
    # Linux Kernel Configuration
    #
    # CONFIG_A is not set
    # CONFIG_CHOICE_B is not set
    # CONFIG_CHOICE_C is not set

    Here,

    # CONFIG_CHOICE_B is not set
    # CONFIG_CHOICE_C is not set

    should not be written into the .config file because their dependency
    "depends on A" is unmet.

    Currently, there is no code that clears SYMBOL_WRITE of choice values.

    Clear SYMBOL_WRITE for all symbols in sym_calc_value(), then set it
    again after calculating visibility. To simplify the logic, set the
    flag if they have non-n visibility, regardless of types, and regardless
    of whether they are choice values or not.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Ulf Magnusson

    Masahiro Yamada
     

21 Jan, 2018

1 commit


11 Jan, 2018

1 commit

  • The 'source_stmt' nonterminal takes a 'prompt', which consists of either
    a T_WORD or a T_WORD_QUOTE, both of which are always allocated on the
    heap in zconf.l and need to have their associated strings freed. Free
    them.

    The existing code already makes sure to always copy the string, but add
    a warning to sym_expand_string_value() to make it clear that the string
    must be copied, just in case.

    Summary from Valgrind on 'menuconfig' (ARCH=x86) before the fix:

    LEAK SUMMARY:
    definitely lost: 387,504 bytes in 15,545 blocks
    ...

    Summary after the fix:

    LEAK SUMMARY:
    definitely lost: 344,616 bytes in 14,355 blocks
    ...

    Signed-off-by: Ulf Magnusson
    Signed-off-by: Masahiro Yamada

    Ulf Magnusson
     

16 Dec, 2017

1 commit

  • Commit 1c199f2878f6 ("kbuild: document recursive dependency limitation
    / resolution") probably intended to show a hint along with "recursive
    dependency detected!" error, but it missed to add {...} guard, and the
    hint is displayed in every loop of the dep_stack traverse, annoyingly.

    This error was detected by GCC's -Wmisleading-indentation when switching
    to build-time generation of lexer/parser.

    scripts/kconfig/symbol.c: In function ‘sym_check_print_recursive’:
    scripts/kconfig/symbol.c:1150:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
    if (stack->sym == last_sym)
    ^~
    scripts/kconfig/symbol.c:1153:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
    fprintf(stderr, "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n");
    ^~~~~~~

    I could simply add {...} to surround the three fprintf(), but I rather
    chose to move the hint after the loop to make the whole message readable.

    Fixes: 1c199f2878f6 ("kbuild: document recursive dependency limitation / resolution"
    Signed-off-by: Masahiro Yamada
    Acked-by: Luis R. Rodriguez

    Masahiro Yamada
     

23 Nov, 2017

1 commit


16 Nov, 2016

1 commit

  • The "imply" keyword is a weak version of "select" where the target
    config symbol can still be turned off, avoiding those pitfalls that come
    with the "select" keyword.

    This is useful e.g. with multiple drivers that want to indicate their
    ability to hook into a secondary subsystem while allowing the user to
    configure that subsystem out without also having to unset these drivers.

    Currently, the same effect can almost be achieved with:

    config DRIVER_A
    tristate

    config DRIVER_B
    tristate

    config DRIVER_C
    tristate

    config DRIVER_D
    tristate

    [...]

    config SUBSYSTEM_X
    tristate
    default DRIVER_A || DRIVER_B || DRIVER_C || DRIVER_D || [...]

    This is unwieldy to maintain especially with a large number of drivers.
    Furthermore, there is no easy way to restrict the choice for SUBSYSTEM_X
    to y or n, excluding m, when some drivers are built-in. The "select"
    keyword allows for excluding m, but it excludes n as well. Hence
    this "imply" keyword. The above becomes:

    config DRIVER_A
    tristate
    imply SUBSYSTEM_X

    config DRIVER_B
    tristate
    imply SUBSYSTEM_X

    [...]

    config SUBSYSTEM_X
    tristate

    This is much cleaner, and way more flexible than "select". SUBSYSTEM_X
    can still be configured out, and it can be set as a module when none of
    the drivers are configured in or all of them are modular.

    Signed-off-by: Nicolas Pitre
    Acked-by: Richard Cochran
    Acked-by: Thomas Gleixner
    Acked-by: John Stultz
    Reviewed-by: Josh Triplett
    Cc: Paul Bolle
    Cc: linux-kbuild@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Cc: Michal Marek
    Cc: Edward Cree
    Link: http://lkml.kernel.org/r/1478841010-28605-2-git-send-email-nicolas.pitre@linaro.org
    Signed-off-by: Thomas Gleixner

    Nicolas Pitre
     

11 May, 2016

1 commit

  • If choices consist of choice_values of type tristate that depend on
    symbols set to 'm', those choice_values are not set to 'n' if the
    choice is changed from 'm' to 'y' (in which case only one active
    choice_value is allowed). Those values are also written to the config
    file causing modules to be built when they should not.

    The following config can be used to reproduce and examine the problem;
    with the frontend of your choice set "Choice 0" and "Choice 1" to 'm',
    then set "Tristate Choice" to 'y' and save the configuration:

    config modules
    boolean modules
    default y
    option modules

    config dependency
    tristate "Dependency"
    default m

    choice
    prompt "Tristate Choice"
    default choice0

    config choice0
    tristate "Choice 0"

    config choice1
    tristate "Choice 1"
    depends on dependency

    endchoice

    This patch sets tristate choice_values' visibility that depend on
    symbols set to 'm' to 'n' if the corresponding choice is set to 'y'.

    This makes them disappear from the choice list and will also cause the
    choice_values' value set to 'n' in sym_calc_value() and as a result
    they are written as "not set" to the resulting .config file.

    Reported-by: Sebastian Andrzej Siewior
    Signed-off-by: Dirk Gouders
    Tested-by: Sebastian Andrzej Siewior
    Tested-by: Roger Quadros
    Signed-off-by: Michal Marek

    Dirk Gouders
     

08 Oct, 2015

1 commit

  • Recursive dependency issues with kconfig are unavoidable due to
    some limitations with kconfig, since these issues are recurring
    provide a hint to the user how they can resolve these dependency
    issues and also document why such limitation exists.

    While at it also document a bit of future prospects of ways to
    enhance Kconfig, including providing formal semantics and evaluation
    of use of a SAT solver. If you're interested in this work or prospects
    of it check out the kconfig-sat project wiki [0] and mailing list [1].

    [0] http://kernelnewbies.org/KernelProjects/kconfig-sat
    [1] https://groups.google.com/d/forum/kconfig-sat

    Cc: Geert Uytterhoeven
    Cc: James Bottomley
    Cc: Josh Triplett
    Cc: Paul Bolle
    Cc: Herbert Xu
    Cc: Takashi Iwai
    Cc: "Yann E. MORIN"
    Cc: Jonathan Corbet
    Cc: Mate Soos
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Michal Marek

    Luis R. Rodriguez
     

19 Aug, 2015

1 commit


15 Jun, 2015

1 commit

  • Over the years I found it desirable to be able to use all sorts of
    relations, not just (in)equality. And apparently I'm not the only one,
    as there's at least one example in the tree where the programmer
    assumed this would work (see DEBUG_UART_8250_WORD in
    arch/arm/Kconfig.debug). Another possible use would e.g. be to fold the
    two SMP/NR_CPUS prompts into one: SMP could be promptless, simply
    depending on NR_CPUS > 1.

    A (desirable) side effect of this change - resulting from numeric
    values now necessarily being compared as numbers rather than as
    strings - is that comparing hex values now works as expected: Other
    than int ones (which aren't allowed to have leading zeroes), zeroes
    following the 0x prefix made them compare unequal even if their values
    were equal.

    Signed-off-by: Jan Beulich
    Signed-off-by: Michal Marek

    Jan Beulich
     

25 Feb, 2015

1 commit


09 Oct, 2013

1 commit

  • This fixes lots of typos in comments and strings.

    It also updates the documentation strings in mconf to reflect the changes in
    the user interface from the two commits

    6364fd0cb1e4c7f72b974613e0cf5744ae4d2cb2
    menuconfig: Add Save/Load buttons
    1bdbac478a858d2aa73a6784c7c2e09de0f6d06b
    menuconfig: Get rid of the top-level entries for "Load an Alternate/Save an Alternate"

    And it updates the layout of the example search result, i. e. moves down the
    "Defined at" and "Depends on" lines and adds a symbol state ([=n]) to the
    symbol in the "Selected by" line.

    Furthermore, the help texts now should fit in 80 columns again when viewed
    in mconf.

    Signed-off-by: Martin Walch
    Reviewed-by: Jean Delvare
    Reviewed-by: Wang YanQing
    Signed-off-by: "Yann E. MORIN"

    Martin Walch
     

16 Aug, 2013

1 commit

  • Instead of using "long" for kconfig "hex" and "range" values, which may
    change in size depending on the host architecture, use "long long". This
    will allow values greater than INT_MAX on 32-bit hosts when cross
    compiling.

    Signed-off-by: Kees Cook
    Acked-by: Geert Uytterhoeven
    Tested-by: "Yann E. MORIN"
    Signed-off-by: "Yann E. MORIN"

    Kees Cook