04 Nov, 2018

1 commit

  • [ Upstream commit 56869d45e364244a721de34ce9c5dc9ed022779e ]

    The rule of mainmenu_stmt does not have debug print of zconf_lineno(),
    but if it had, it would print a wrong line number for the same reason
    as commit b2d00d7c61c8 ("kconfig: fix line numbers for if-entries in
    menu tree").

    The mainmenu_stmt does not need to eat following empty lines because
    they are reduced to common_stmt.

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Sasha Levin

    Masahiro Yamada
     

24 Aug, 2018

1 commit

  • [ Upstream commit b2d00d7c61c84edd150310af3f556f8a3c6e2e67 ]

    The line numers for if-entries in the menu tree are off by one or more
    lines which is confusing when debugging for correctness of unrelated changes.

    According to the git log, commit a02f0570ae201c49 (kconfig: improve
    error handling in the parser) was the last one that changed that part
    of the parser and replaced

    "if_entry: T_IF expr T_EOL"
    by
    "if_entry: T_IF expr nl"

    but the commit message does not state why this has been done.

    When reverting that part of the commit, only the line numers are
    corrected (checked with cdebug = DEBUG_PARSE in zconf.y), otherwise
    the menu tree remains unchanged (checked with zconfdump() enabled in
    conf.c).

    An example for the corrected line numbers:

    drivers/soc/Kconfig:15:source drivers/soc/tegra/Kconfig
    drivers/soc/tegra/Kconfig:4:if
    drivers/soc/tegra/Kconfig:6:if

    changes to:

    drivers/soc/Kconfig:15:source drivers/soc/tegra/Kconfig
    drivers/soc/tegra/Kconfig:1:if
    drivers/soc/tegra/Kconfig:4:if

    Signed-off-by: Dirk Gouders
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dirk Gouders
     

26 Apr, 2018

1 commit

  • [ Upstream commit 0724a7c32a54e3e50d28e19e30c59014f61d4e2c ]

    If a 'mainmenu' entry appeared in the Kconfig files, two things would
    leak:

    - The 'struct property' allocated for the default "Linux Kernel
    Configuration" prompt.

    - The string for the T_WORD/T_WORD_QUOTE prompt after the
    T_MAINMENU token, allocated on the heap in zconf.l.

    To fix it, introduce a new 'no_mainmenu_stmt' nonterminal that matches
    if there's no 'mainmenu' and adds the default prompt. That means the
    prompt only gets allocated once regardless of whether there's a
    'mainmenu' statement or not, and managing it becomes simple.

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

    LEAK SUMMARY:
    definitely lost: 344,568 bytes in 14,352 blocks
    ...

    Summary after the fix:

    LEAK SUMMARY:
    definitely lost: 344,440 bytes in 14,350 blocks
    ...

    Signed-off-by: Ulf Magnusson
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Ulf Magnusson
     

20 Aug, 2017

1 commit

  • It turns out that gperf-3.1 changed types in the generated code in ways
    that aren't even trivially detectable without having to generate a test-file.

    It's just not worth using tools and libraries from clowns that don't
    understand or care about compatibility. So get rid of gperf.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

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
     

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
     

10 Jun, 2014

1 commit


05 Sep, 2013

1 commit

  • Currently, the 'MODULES' symbol is hard-coded to be the default symbol
    that enables/disables tristates, if no other symbol was declared with
    'option modules'.

    While this used to be needed for the Linux kernel, we now have an
    explicit 'option modules' attached to the 'MODULES' symbol (since
    cset 11097a036), so we no longer need to special-case it in the
    kconfig code.

    Furthermore, kconfig is extensively used out of the Linux kernel, and
    other projects may have another meaning for a symbol named 'MODULES'.

    This patch changes the way we enable/disable tristates: if a symbol was
    found with 'option modules' attached to it, then that symbol controls
    enabling tristates. Otherwise, tristates are disabled, even if a symbol
    named 'MODULES' exists.

    Signed-off-by: "Yann E. MORIN"
    Cc: Sam Ravnborg
    Signed-off-by: Michal Marek

    Yann E. MORIN
     

30 Jul, 2011

1 commit

  • * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: (25 commits)
    kconfig: Introduce IS_ENABLED(), IS_BUILTIN() and IS_MODULE()
    xconfig: Abort close if configuration cannot be saved
    kconfig: fix missing "0x" prefix from S_HEX symbol in autoconf.h
    kconfig/nconf: remove useless conditionnal
    kconfig/nconf: prevent segfault on empty menu
    kconfig/nconf: use the generic menu_get_ext_help()
    nconfig: Avoid Wunused-but-set warning
    kconfig/conf: mark xfgets() private
    kconfig: remove pending prototypes for kconfig_load()
    kconfig/conf: add command line options' description
    kconfig/conf: reduce the scope of `defconfig_file'
    kconfig: use calloc() for expr allocation
    kconfig: introduce specialized printer
    kconfig: do not overwrite symbol direct dependency in assignment
    kconfig/gconf: silent missing prototype warnings
    kconfig/gconf: kill deadcode
    kconfig: nuke LKC_DIRECT_LINK cruft
    kconfig: nuke reference to SWIG
    kconfig: add missing inclusion
    kconfig: add missing inclusion
    ...

    Fix up conflicts in scripts/kconfig/Makefile

    Linus Torvalds
     

10 Jun, 2011

3 commits


07 Jun, 2011

1 commit


22 Nov, 2010

1 commit


20 Sep, 2010

2 commits


14 Apr, 2010

1 commit

  • zconfdump(), which is used for debugging, can't recognize P_SELECT,
    P_RANGE and P_MENU (if associated with a symbol, aka "menuconfig"),
    and output something like this:

    config X86
    boolean
    default y
    unknown prop 6!
    unknown prop 6!
    unknown prop 6!
    ...

    Signed-off-by: Li Zefan
    Signed-off-by: Michal Marek

    Li Zefan
     

02 Feb, 2010

2 commits

  • While looking for something else I noticed that the symbol
    hash function used by kconfig is quite poor. It doesn't
    use any of the standard hash techniques but simply
    adds up the string and then uses power of two masking,
    which is both known to perform poorly.

    The current x86 kconfig has over 7000 symbols.

    When I instrumented it showed that the minimum hash chain
    length was 16 and a significant number of them was over
    30.

    It didn't help that the hash table size was only 256 buckets.

    This patch increases the hash table size to a larger prime
    and switches to a FNV32 hash. I played around with a couple of hash
    functions, but that one seemed to perform best with reasonable
    hash table sizes.

    Increasing the hash table size even further didn't
    seem like a good idea, because there are a couple of global
    walks which walk the complete hash table.

    I also moved the unnamed bucket to 0. It's still the longest
    of all the buckets (44 entries), but hopefully it's not
    often hit except for the global walk which doesn't care.

    The result is a much nicer distribution:
    (first column bucket length, second number of buckets with that length)

    1: 3505
    2: 1236
    3: 294
    4: 52
    5: 3
    47: 1
    Signed-off-by: Michal Marek

    Andi Kleen
     
  • This patch was inspired by the kernel projects page, where an ncurses
    replacement for menuconfig was mentioned (by Sam Ravnborg).

    Building on menuconfig, this patch implements a more modern look
    interface using ncurses and ncurses' satellite libraries (menu, panel,
    form). The implementation does not depend on lxdialog, which is
    currently distributed with the kernel.

    Signed-off-by: Nir Tzachar
    Signed-off-by: Michal Marek

    nir.tzachar@gmail.com
     

16 Nov, 2009

1 commit


16 Oct, 2009

1 commit

  • zconf.y includes zconf.hash.c from the initial code section.
    zconf.hash.c references the token constants from zconf.y. However,
    current bison defines the token constants after the initial code
    section, making zconf.hash.c fail to compile. Move the include of
    zconf.hash.c later in zconf.y, so bison puts it after the token
    constants.

    Signed-off-by: Josh Triplett

    Josh Triplett
     

29 Apr, 2008

1 commit

  • As choice dependency are now fully checked, it's quite easy to add support
    for named choices. This lifts the restriction that a choice value can only
    appear once, although it still has to be within the same group,
    but multiple choices can be joined by giving them a name.
    While at it I cleaned up a little the choice type logic to simplify it a
    bit.

    Signed-off-by: Roman Zippel
    Signed-off-by: Sam Ravnborg

    Roman Zippel
     

13 Oct, 2007

1 commit

  • Remove the following redundant and never or rarely used kconfig syntax:

    - "def_boolean" (same as "def_bool")
    - "requires" (same as "depends on")
    - "depends" (same as "depends on")

    This patch contains the code changes and Kconfig updates.
    The shipped files are in next patch to let actual codechange stand out.

    Signed-off-by: Adrian Bunk
    Cc: "Randy.Dunlap"
    Cc: Bryan Wu
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Dmitry Torokhov
    Cc: "John W. Linville"
    Cc: Roman Zippel
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Sam Ravnborg

    Adrian Bunk
     

26 Jul, 2007

1 commit

  • Roman Zippel wrote:
    > 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 patch does this and at the same time introduce a few API
    funtions used to access the help text.

    The relevant api functions are introduced in the various frontends.

    Signed-off-by: Sam Ravnborg
    Cc: Roman Zippel

    Sam Ravnborg
     

06 May, 2007

1 commit

  • Sample:
    config FOO
    bool "This is foo"
    depends on BAR

    config BAR
    bool "This is bar"
    depends on FOO

    This will result in following error message:
    error: found recursive dependency: FOO -> BAR -> FOO

    And will then exit with exit code equal 1 so make will stop.
    Inspired by patch from: Adrian Bunk

    Signed-off-by: Sam Ravnborg
    Cc: Adrian Bunk
    Cc: Roman Zippel

    Sam Ravnborg
     

14 Dec, 2006

1 commit

  • Those two functions are
    void sym_set_change_count(int count)
    and
    void sym_add_change_count(int count)

    All write accesses to sym_change_count are replaced by calls to above
    functions.

    Variable and changer-functions are moved to confdata.c. IMO thats ok, as
    sym_change_count is an attribute of the .config's change state.

    Signed-off-by: Karsten Wiese
    Cc: Sam Ravnborg
    Cc: Roman Zippel
    Acked-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Karsten Wiese
     

09 Jun, 2006

2 commits

  • This makes it possible to change two options which were hardcoded sofar.
    1. Any symbol can now take the role of CONFIG_MODULES
    2. The more useful option is to change the list of default file names,
    which kconfig uses to load the base configuration if .config isn't
    available.

    Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Sam Ravnborg

    Roman Zippel
     
  • This adds the general framework to the parser to define options for config
    symbols with a syntax like:

    config FOO
    option bar[="arg"]

    Signed-off-by: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Sam Ravnborg

    Roman Zippel
     

09 Nov, 2005

4 commits

  • Add a few error tokens to the parser to catch common errors and print more
    descriptive error messages.

    Signed-off-by: Roman Zippel
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • This simplifies the parser a bit by merging the various symbol types into a
    single token and adds the type to the keyword hash.

    Signed-off-by: Roman Zippel
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • Use gperf to generate a hash for the kconfig keywords. This greatly reduces
    the size of the generated scanner and makes it easier to extend kconfig.

    Signed-off-by: Roman Zippel
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roman Zippel
     
  • When doing its recursive dependency check, scripts/kconfig/conf uses the flag
    SYMBOL_CHECK_DONE to avoid rechecking a symbol it has already checked.
    However, that flag is only set at the top level, so if a symbol is first
    encountered as a dependency of another symbol it will be rechecked every time
    it is encountered until it's encountered at the top level.

    This patch adjusts the flag setting so that each symbol will only be checked
    once, regardless of whether it is first encountered at the top level, or while
    recursing down from another symbol. On complex configurations, this vastly
    speeds up scripts/kconfig/conf. The config in the powerpc merge tree is
    particularly bad: this patch reduces the time for 'scripts/kconfig/conf -o
    arch/powerpc/Kconfig' by a factor of 40 on a G5. That's even including the
    time to print the config, so the speedup in the actual checking is more likely
    2 or 3 orders of magnitude.

    Signed-off-by: David Gibson
    Signed-off-by: Roman Zippel
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Gibson
     

29 Jul, 2005

1 commit

  • Replace all menu_add_prop mimicking menu_add_prompt with the latter func. I've
    had to add a return value to menu_add_prompt for one usage.

    I've rebuilt scripts/kconfig/zconf.tab.c_shipped by hand to reflect changes
    in the source (I've not the same Bison version so regenerating it wouldn't
    have been not a good idea), and compared it with what Roman itself did some
    time ago, and it's the same.

    So I guess this can be finally merged.

    Signed-off-by: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Sam Ravnborg

    blaisorblade@yahoo.it
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds