All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4
@ 2018-05-12 17:13 Eugeniu Rosca
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 2/6] board: eets: pdu001: Fix wrong default value in Kconfig Eugeniu Rosca
                   ` (6 more replies)
  0 siblings, 7 replies; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-12 17:13 UTC (permalink / raw)
  To: u-boot

Align Kconfig to Linux 4.17-rc4 with minimal impact on non-kconfig files.

Previous Kconfig sync was done by commit bf7ab1e70fd762 ("kconfig:
re-sync with Linux 4.10") and it achieved almost perfect alignment with
a few (intended) exceptions, caused by below U-boot commits:

[A] v2015.04 5f9eb2207500 ("kbuild: remove scripts/multiconfig.sh")
[B] v2015.07 20c20826efab ("Kconfig: Enable usage of escape char '\' in string values")
[C] v2016.01 da58dec86616 ("Various Makefiles: Add SPDX-License-Identifier tags")
[D] v2016.03 5b8031ccb4ed ("Add more SPDX-License-Identifier tags")
[E] v2016.03 192bc6948b02 ("Fix GCC format-security errors and convert sprintfs.")

Here is the list of Kconfig commits which followed the v4.10 alignment:

[F] v2018.01 0931ed3c0d0f ("kconfig/symbol.c: use correct pointer type argument for sizeof")
[G] v2018.03 1414e09b4f25 ("kconfig: revert change that was not needed for -Wformat-security")
[H] v2018.05 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style")

Commit [F] was subsequently applied to Linux kernel as commit [I]
with the same patch id, so it won't contribute to further misalignment.

[I] v4.15-rc1 88127dae6ed9 ("kconfig/symbol.c: use correct pointer type argument for sizeof")

Commit [G] is a Kconfig-specific revert of commit [E].
Commit [H] relocated and reformatted the license doing no functional change.

In summary, the only functional change that makes U-boot Kconfig
diverge from Linux Kconfig is commit [B]. After a brief analysis,
the purpose of [B] seems to be placing "\n" literals in string symbols
like CONFIG_AUTOBOOT_PROMPT="autoboot in %d seconds\n" in order to pass
them directly to printf and expect correct output at runtime. Currently,
Linux doesn't seem to have this requirement, so for the moment [B] looks
like a U-boot specific feature/fix. From point of view of further Kconfig
alignment and backporting efforts, it is highly desired that commits
like [B] are propagated to Linux and any Kconfig fixes/features are
contributed to Linux kernel first. This specific Kconfig re-sync just
keeps [B] in place.

Contrary to 4.10 Kconfig re-sync (which achieves zero non-kconfig
changes), 4.17-rc4 re-sync does some amount of updates in Kbuild
(striving to keep them at minimum), due to a number of reasons:
* Kbuild is affected by the removal of Kconfig "*shipped" files and now
  requires flex and bison pre-installed on the host.
* PYTHON{2,3} variables are defined in top-level Makefile as
  prerequisite for running the newly developed Kconfig unit tests.
* silentoldconfig becomes an "internal implementation detail" deprecated
  for external use, being renamed to syncconfig.

The exact non-kconfig files touched by this commit are:

$ git show --format="" --stat -- ':!scripts/kconfig'
 .gitignore             |  2 ++
 Makefile               |  9 +++++++--
 scripts/Makefile.build | 11 +++++++++++
 scripts/Makefile.lib   | 41 ++++++++++++-----------------------------

The imported Linux commits touching the above files are:

c054be10ffdbd5   ("remove gperf left-overs from build system")
73a4f6dbe70a1b   ("kbuild: add LEX and YACC variables")
033dba2ec06c47   ("kbuild: prepare to remove C files pre-generated by flex and bison")
eea199b445f64c   ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
e71de5ee08dcb0   ("kbuild: remove remaining use of undefined YACC_PREFIX")
d59fbbd09d5d6b   ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
911a91c39cabcb H ("kconfig: rename silentoldconfig to syncconfig")
59889300274569   (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
9a8dfb394c0467   ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
833e622459432e H ("genksyms: generate lexer and parser during build instead of shipping")
b23d1a241f4eb4 H ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
e9781b52d4e0e3 H ("kbuild: add PYTHON2 and PYTHON3 variables")

The commits marked with 'H' are assessed as "hard" (build will fail)
prerequisites and the rest of them are assessed as "soft" prerequisites
for the re-sync. In spite of relatively high number of non-H commits,
they belong to this Kconfig update topic-wise and decrease the number of
cherry pick conflicts for many commits in this series. Additional effort
can be put in eliminating the soft prerequisites, if really needed.

The commits which contributed to this Kconfig re-sync are listed below.
Whenever a conflict resolution has been performed (mostly by hand, but
sometimes automatically by git), it is revealed by the '!' sign in the
second column, which means a patch id mismatch between Linux and U-boot
commits:

9be3213b14d44f   ("gconfig: remove misleading parentheses around a condition")
ff85a1a80e0034   ("kconfig: Check for libncurses before menuconfig")
ad8181060788c8   ("kconfig: fix sparse warnings in nconfig")
cb77f0d623ff33 ! ("scripts: Switch to more portable Perl shebang")
bb3290d91695bb ! ("Remove gperf usage from toolchain")
c054be10ffdbd5   ("remove gperf left-overs from build system")
b24413180f5600 ! ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license")
9059a3493efea6 ! ("kconfig: fix relational operators for bool and tristate symbols")
2c37e08464a850   ("kconfig: Warn if choice default is not in choice")
33ca1a24866373   ("kconfig: Document the 'menu' struct")
52aede4ba5efd1   ("kconfig: Document the 'symbol' struct")
c873443430ebd1   ("kconfig: Sync zconf.y with zconf.tab.c_shipped")
9a826842ff2fbd   ("kconfig: Rename menu_check_dep() to rewrite_m()")
fa8cedaef814ce   ("kconfig: Clarify expression rewriting")
f77850d3fe0c96   ("kconfig: Clean up modules handling and fix crash")
e3b03bf29d6b99   ("kconfig: display recursive dependency resolution hint just once")
73a4f6dbe70a1b ! ("kbuild: add LEX and YACC variables")
033dba2ec06c47 ! ("kbuild: prepare to remove C files pre-generated by flex and bison")
29c833061c1d8c   ("kconfig: generate lexer and parser during build instead of shipping")
26e47a3c11a25c   ("kconfig: Don't leak symbol names during parsing")
24161a6711c945   ("kconfig: Don't leak 'source' filenames during parsing")
bc28fe1d5ede88   ("kconfig: Don't leak 'option' arguments during parsing")
0724a7c32a54e3   ("kconfig: Don't leak main menus during parsing")
ae7440ef0c8013   ("kconfig: Fix automatic menu creation mem leak")
5b1374b3b3c2fc   ("kconfig: Fix expr_free() E_NOT leak")
7cf33f88e29410   ("kconfig: Fix choice symbol expression leak")
05cccce580456d   ("kconfig: Document automatic submenu creation code")
0735f7e5def2ab   ("kconfig: Document important expression functions")
df60f4b92d3d0b   ("kconfig: Remove menu_end_entry()")
b92d804a51796b   ("kconfig: drop 'boolean' keyword")
6479f327dea60d   ("kconfig: Warn if there is more than one help text")
52e58a3caeba5d   ("kconfig: make input_mode static")
5a3dc717b3c785   ("kconfig: make xfgets() really static")
84dd95d4f87a0d   ("kconfig: make conf_unsaved a local variable of conf_read()")
765f4cdef6f80d   ("kconfig: use default 'yy' prefix for lexer and parser")
eea199b445f64c   ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
e71de5ee08dcb0   ("kbuild: remove remaining use of undefined YACC_PREFIX")
d59fbbd09d5d6b ! ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
3e41ba05b6d60c   ("kconfig: Document SYMBOL_OPTIONAL logic")
d3465af60f4471   ("kconfig: Clarify choice dependency propagation")
9d1a9e8bc18bea   ("kconfig: Document 'if' flattening logic")
b53688014e3325   ("kconfig: Clarify menu and 'if' dependency propagation")
d0fd0428ecf04b   ("kconfig: fix make xconfig when gettext is missing")
312ee68752faaa   ("kconfig: announce removal of oldnoconfig if used")
1ccb27143360bd   ("kconfig: make "Selected by:" and "Implied by:" readable")
cedd55d49dee94 ! ("kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help")
1b9eda2e4892cb   ("kconfig: Warn if help text is blank")
cb67ab2cd2b8ab   ("kconfig: do not write choice values when their dependency becomes n")
4f208f392103e8   ("kconfig: show '?' prompt even if no help text is available")
cd58a91def2acc   ("kconfig: remove 'config*' pattern from .gitignnore")
d2a04648a5dbc3   ("kconfig: remove check_stdin()")
f3ff6fb5db68bc   ("kconfig: echo stdin to stdout if either is redirected")
9e3e10c725360b   ("kconfig: send error messages to stderr")
d717f24d8c6808   ("kconfig: add xrealloc() helper")
523ca58b7db2e3   ("kconfig: remove const qualifier from sym_expand_string_value()")
cd81fc82b93fa4   ("kconfig: add xstrdup() helper")
f4bc1eefc1608e   ("kconfig: set SYMBOL_AUTO to the symbol marked with defconfig_list")
bf0bbdcf100322   ("kconfig: Don't leak choice names during parsing")
1a90ce36c6eff6   ("kconfig: Update ncurses package names for menuconfig")
5ae6fcc4bb82bd   ("kconfig: fix line number in recursive inclusion error message")
07a422bb213adb ! ("kbuild: restore autoksyms.h touch to the top Makefile")
9a47ceec543bfb   ("kconfig: clean-up reverse dependency help implementation")
d9119b5925a03b   ("kconfig: Print reverse dependencies in groups")
f467c5640c29ad   ("kconfig: only write '# CONFIG_FOO is not set' for visible symbols")
59a80b5e892dde   ("kconfig: do not call check_conf() for olddefconfig")
4bb3a5b085cd6f   ("kconfig: remove unneeded input_mode test in conf()")
99f0b6578bab44   ("kconfig: remove redundant input_mode test for check_conf() loop")
2aad9b89621386   ("kconfig: hide irrelevant sub-menus for oldconfig")
81d2bc2273052e   ("kconfig: invoke oldconfig instead of silentoldconfig from local*config")
911a91c39cabcb ! ("kconfig: rename silentoldconfig to syncconfig")
2a61625835c7c8 ! ("kconfig: remove redundant streamline_config.pl prerequisite")
022a4bf6b59dfd   ("kconfig: tests: add framework for Kconfig unit testing")
1903c511905984   ("kconfig: tests: add basic choice tests")
49ac3c0c3aa3b7   ("kconfig: tests: test automatic submenu creation")
b76960c0f6b25d   ("kconfig: tests: test if new symbols in choice are asked")
930c429a656fdb   ("kconfig: tests: check unneeded "is not set" with unmet dependency")
ee236610653ede   ("kconfig: tests: check visibility of tristate choice values in y choice")
beaaddb625400e   ("kconfig: tests: test defconfig when two choices interact")
3e4888c2e3d77d   ("kconfig: tests: test randconfig for choice in choice")
29c434f367ea7b   ("kconfig: tests: test if recursive dependencies are detected")
e2c75e7667c737   ("kconfig: tests: test if recursive inclusion is detected")
f622f827958162   ("kconfig: warn unmet direct dependency of tristate symbols selected by y")
f8f69dc0b4e070   ("kconfig: make unmet dependency warnings readable")
26561514cc9def   ("kconfig: do not include both curses.h and ncurses.h for nconfig")
32a94b8b0c3e5a   ("kconfig: remove duplicated file name and lineno of recursive inclusion")
379a8eb8eb1a55   ("kconfig: detect recursive inclusion earlier")
18492685e479fd   ("kconfig: use yylineno option instead of manual lineno increments")
59889300274569 ! (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
9a8dfb394c0467 ! ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
833e622459432e ! ("genksyms: generate lexer and parser during build instead of shipping")
b23d1a241f4eb4 ! ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
17baab68d337a0   ("kconfig: extend output of 'listnewconfig'")
e9781b52d4e0e3 ! ("kbuild: add PYTHON2 and PYTHON3 variables")

The current Kconfig update generates below build-time warnings:
  YACC    scripts/dtc/dtc-parser.tab.h
scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
  YACC    scripts/dtc/dtc-parser.tab.c
scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]

This seems to happen because the Kbuild updates apparently didn't make
room for both "*shipped"-based builds and flex/bison-based builds. A
similar problem has been reported for genksyms parser in v4.17-rc1
commit 833e622459432e ("genksyms: generate lexer and parser during build
instead of shipping"). I have figured out empirically that the warnings
are healed after updating the in-tree U-boot DTC to upstream v1.4.6-9,
same as done by Linux v4.17-rc1 commit 9130ba88464032 ("scripts/dtc:
Update to upstream version v1.4.6-9-gaadd0b65c987"). Whether fixing the
DTC-related yacc warnings should be done together with the Kconfig
re-sync, I would like to hear from community.

My testing was limited to:
- make defconfig all
- make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- r8a7795_ulcb_defconfig all
- comparing .config before and after the re-sync
- running the newly imported Kconfig unit tests as seen below:

$ make testconfig

============================= test session starts =============================
scripts/kconfig/tests/auto_submenu/__init__.py::test PASSED             [  7%]
scripts/kconfig/tests/choice/__init__.py::test_oldask0 PASSED           [ 14%]
scripts/kconfig/tests/choice/__init__.py::test_oldask1 PASSED           [ 21%]
scripts/kconfig/tests/choice/__init__.py::test_allyes PASSED            [ 28%]
scripts/kconfig/tests/choice/__init__.py::test_allmod PASSED            [ 35%]
scripts/kconfig/tests/choice/__init__.py::test_allno PASSED             [ 42%]
scripts/kconfig/tests/choice/__init__.py::test_alldef PASSED            [ 50%]
scripts/kconfig/tests/choice_value_with_m_dep/__init__.py::test PASSED  [ 57%]
scripts/kconfig/tests/err_recursive_inc/__init__.py::test PASSED        [ 64%]
scripts/kconfig/tests/inter_choice/__init__.py::test PASSED             [ 71%]
scripts/kconfig/tests/new_choice_with_dep/__init__.py::test PASSED      [ 78%]
scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py::test PASSED    [ 85%]
scripts/kconfig/tests/rand_nested_choice/__init__.py::test PASSED       [ 92%]
scripts/kconfig/tests/warn_recursive_dep/__init__.py::test PASSED       [100%]
========================== 14 passed in 0.34 seconds ==========================

Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
---

v1->v2:
* Re-picked v4.16-rc1 commit cedd55d49dee ("kconfig: Remove
  silentoldconfig from help and docs; fix kconfig/conf's help") with
  correct conflict resolution in scripts/kconfig/Makefile.
* Added: Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com

 .gitignore                                    |    2 +
 Makefile                                      |    9 +-
 scripts/Makefile.build                        |   11 +
 scripts/Makefile.lib                          |   41 +-
 scripts/kconfig/.gitignore                    |    5 -
 scripts/kconfig/Makefile                      |   51 +-
 scripts/kconfig/check.sh                      |    1 +
 scripts/kconfig/conf.c                        |  110 +-
 scripts/kconfig/confdata.c                    |   10 +-
 scripts/kconfig/expr.c                        |  193 +-
 scripts/kconfig/expr.h                        |   93 +-
 scripts/kconfig/gconf.c                       |    2 +-
 scripts/kconfig/kconf_id.c                    |   53 +
 scripts/kconfig/kxgettext.c                   |    2 +-
 scripts/kconfig/list.h                        |    1 +
 scripts/kconfig/lkc.h                         |    6 +-
 scripts/kconfig/lkc_proto.h                   |    3 +-
 scripts/kconfig/lxdialog/check-lxdialog.sh    |    4 +-
 scripts/kconfig/mconf.c                       |    2 +-
 scripts/kconfig/menu.c                        |  195 +-
 scripts/kconfig/nconf.c                       |   12 +-
 scripts/kconfig/nconf.gui.c                   |    7 +-
 scripts/kconfig/nconf.h                       |    4 +-
 scripts/kconfig/streamline_config.pl          |    3 +-
 scripts/kconfig/symbol.c                      |   80 +-
 scripts/kconfig/tests/auto_submenu/Kconfig    |   50 +
 .../kconfig/tests/auto_submenu/__init__.py    |   12 +
 .../tests/auto_submenu/expected_stdout        |   10 +
 scripts/kconfig/tests/choice/Kconfig          |   54 +
 scripts/kconfig/tests/choice/__init__.py      |   40 +
 .../tests/choice/alldef_expected_config       |    5 +
 .../tests/choice/allmod_expected_config       |    9 +
 .../tests/choice/allno_expected_config        |    5 +
 .../tests/choice/allyes_expected_config       |    9 +
 .../tests/choice/oldask0_expected_stdout      |   10 +
 scripts/kconfig/tests/choice/oldask1_config   |    2 +
 .../tests/choice/oldask1_expected_stdout      |   15 +
 .../tests/choice_value_with_m_dep/Kconfig     |   19 +
 .../tests/choice_value_with_m_dep/__init__.py |   15 +
 .../tests/choice_value_with_m_dep/config      |    2 +
 .../choice_value_with_m_dep/expected_config   |    3 +
 .../choice_value_with_m_dep/expected_stdout   |    4 +
 scripts/kconfig/tests/conftest.py             |  291 ++
 .../kconfig/tests/err_recursive_inc/Kconfig   |    1 +
 .../tests/err_recursive_inc/Kconfig.inc1      |    4 +
 .../tests/err_recursive_inc/Kconfig.inc2      |    3 +
 .../tests/err_recursive_inc/Kconfig.inc3      |    1 +
 .../tests/err_recursive_inc/__init__.py       |   10 +
 .../tests/err_recursive_inc/expected_stderr   |    6 +
 scripts/kconfig/tests/inter_choice/Kconfig    |   23 +
 .../kconfig/tests/inter_choice/__init__.py    |   14 +
 scripts/kconfig/tests/inter_choice/defconfig  |    1 +
 .../tests/inter_choice/expected_config        |    4 +
 .../kconfig/tests/new_choice_with_dep/Kconfig |   37 +
 .../tests/new_choice_with_dep/__init__.py     |   14 +
 .../kconfig/tests/new_choice_with_dep/config  |    3 +
 .../tests/new_choice_with_dep/expected_stdout |   10 +
 .../tests/no_write_if_dep_unmet/Kconfig       |   14 +
 .../tests/no_write_if_dep_unmet/__init__.py   |   19 +
 .../tests/no_write_if_dep_unmet/config        |    1 +
 .../no_write_if_dep_unmet/expected_config     |    5 +
 scripts/kconfig/tests/pytest.ini              |    7 +
 .../kconfig/tests/rand_nested_choice/Kconfig  |   33 +
 .../tests/rand_nested_choice/__init__.py      |   16 +
 .../tests/rand_nested_choice/expected_stdout0 |    2 +
 .../tests/rand_nested_choice/expected_stdout1 |    4 +
 .../tests/rand_nested_choice/expected_stdout2 |    5 +
 .../kconfig/tests/warn_recursive_dep/Kconfig  |   62 +
 .../tests/warn_recursive_dep/__init__.py      |    9 +
 .../tests/warn_recursive_dep/expected_stderr  |   30 +
 scripts/kconfig/util.c                        |   26 +-
 scripts/kconfig/zconf.gperf                   |   50 -
 scripts/kconfig/zconf.hash.c_shipped          |  297 --
 scripts/kconfig/zconf.l                       |   78 +-
 scripts/kconfig/zconf.lex.c_shipped           | 2473 -----------------
 scripts/kconfig/zconf.tab.c_shipped           | 2471 ----------------
 scripts/kconfig/zconf.y                       |  126 +-
 77 files changed, 1693 insertions(+), 5621 deletions(-)
 create mode 100644 scripts/kconfig/kconf_id.c
 create mode 100644 scripts/kconfig/tests/auto_submenu/Kconfig
 create mode 100644 scripts/kconfig/tests/auto_submenu/__init__.py
 create mode 100644 scripts/kconfig/tests/auto_submenu/expected_stdout
 create mode 100644 scripts/kconfig/tests/choice/Kconfig
 create mode 100644 scripts/kconfig/tests/choice/__init__.py
 create mode 100644 scripts/kconfig/tests/choice/alldef_expected_config
 create mode 100644 scripts/kconfig/tests/choice/allmod_expected_config
 create mode 100644 scripts/kconfig/tests/choice/allno_expected_config
 create mode 100644 scripts/kconfig/tests/choice/allyes_expected_config
 create mode 100644 scripts/kconfig/tests/choice/oldask0_expected_stdout
 create mode 100644 scripts/kconfig/tests/choice/oldask1_config
 create mode 100644 scripts/kconfig/tests/choice/oldask1_expected_stdout
 create mode 100644 scripts/kconfig/tests/choice_value_with_m_dep/Kconfig
 create mode 100644 scripts/kconfig/tests/choice_value_with_m_dep/__init__.py
 create mode 100644 scripts/kconfig/tests/choice_value_with_m_dep/config
 create mode 100644 scripts/kconfig/tests/choice_value_with_m_dep/expected_config
 create mode 100644 scripts/kconfig/tests/choice_value_with_m_dep/expected_stdout
 create mode 100644 scripts/kconfig/tests/conftest.py
 create mode 100644 scripts/kconfig/tests/err_recursive_inc/Kconfig
 create mode 100644 scripts/kconfig/tests/err_recursive_inc/Kconfig.inc1
 create mode 100644 scripts/kconfig/tests/err_recursive_inc/Kconfig.inc2
 create mode 100644 scripts/kconfig/tests/err_recursive_inc/Kconfig.inc3
 create mode 100644 scripts/kconfig/tests/err_recursive_inc/__init__.py
 create mode 100644 scripts/kconfig/tests/err_recursive_inc/expected_stderr
 create mode 100644 scripts/kconfig/tests/inter_choice/Kconfig
 create mode 100644 scripts/kconfig/tests/inter_choice/__init__.py
 create mode 100644 scripts/kconfig/tests/inter_choice/defconfig
 create mode 100644 scripts/kconfig/tests/inter_choice/expected_config
 create mode 100644 scripts/kconfig/tests/new_choice_with_dep/Kconfig
 create mode 100644 scripts/kconfig/tests/new_choice_with_dep/__init__.py
 create mode 100644 scripts/kconfig/tests/new_choice_with_dep/config
 create mode 100644 scripts/kconfig/tests/new_choice_with_dep/expected_stdout
 create mode 100644 scripts/kconfig/tests/no_write_if_dep_unmet/Kconfig
 create mode 100644 scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py
 create mode 100644 scripts/kconfig/tests/no_write_if_dep_unmet/config
 create mode 100644 scripts/kconfig/tests/no_write_if_dep_unmet/expected_config
 create mode 100644 scripts/kconfig/tests/pytest.ini
 create mode 100644 scripts/kconfig/tests/rand_nested_choice/Kconfig
 create mode 100644 scripts/kconfig/tests/rand_nested_choice/__init__.py
 create mode 100644 scripts/kconfig/tests/rand_nested_choice/expected_stdout0
 create mode 100644 scripts/kconfig/tests/rand_nested_choice/expected_stdout1
 create mode 100644 scripts/kconfig/tests/rand_nested_choice/expected_stdout2
 create mode 100644 scripts/kconfig/tests/warn_recursive_dep/Kconfig
 create mode 100644 scripts/kconfig/tests/warn_recursive_dep/__init__.py
 create mode 100644 scripts/kconfig/tests/warn_recursive_dep/expected_stderr
 delete mode 100644 scripts/kconfig/zconf.gperf
 delete mode 100644 scripts/kconfig/zconf.hash.c_shipped
 delete mode 100644 scripts/kconfig/zconf.lex.c_shipped
 delete mode 100644 scripts/kconfig/zconf.tab.c_shipped

diff --git a/.gitignore b/.gitignore
index f1b801579ce7..860b17931794 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@
 *.su
 *.mod.c
 *.i
+*.lex.c
 *.lst
 *.order
 *.elf
@@ -20,6 +21,7 @@
 *.bin
 *.patch
 *.cfgtmp
+*.tab.[ch]
 
 # host programs on Cygwin
 *.exe
diff --git a/Makefile b/Makefile
index f31ee60e4cca..349c99fe8ceb 100644
--- a/Makefile
+++ b/Makefile
@@ -344,9 +344,13 @@ LDR		= $(CROSS_COMPILE)ldr
 STRIP		= $(CROSS_COMPILE)strip
 OBJCOPY		= $(CROSS_COMPILE)objcopy
 OBJDUMP		= $(CROSS_COMPILE)objdump
+LEX		= flex
+YACC		= bison
 AWK		= awk
 PERL		= perl
 PYTHON		?= python
+PYTHON2		= python2
+PYTHON3		= python3
 DTC		?= $(objtree)/scripts/dtc/dtc
 CHECK		= sparse
 
@@ -369,7 +373,7 @@ export VERSION PATCHLEVEL SUBLEVEL UBOOTRELEASE UBOOTVERSION
 export ARCH CPU BOARD VENDOR SOC CPUDIR BOARDDIR
 export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
 export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
-export MAKE AWK PERL PYTHON
+export MAKE LEX YACC AWK PERL PYTHON PYTHON2 PYTHON3
 export HOSTCXX HOSTCXXFLAGS CHECK CHECKFLAGS DTC DTC_FLAGS
 
 export KBUILD_CPPFLAGS NOSTDINC_FLAGS UBOOTINCLUDE OBJCOPYFLAGS LDFLAGS
@@ -505,7 +509,7 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
 # if auto.conf.cmd is missing then we are probably in a cleaned tree so
 # we execute the config step to be sure to catch updated Kconfig files
 include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
-	$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
+	$(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
 	@# If the following part fails, include/config/auto.conf should be
 	@# deleted so "make silentoldconfig" will be re-run on the next build.
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.autoconf || \
@@ -1608,6 +1612,7 @@ clean: $(clean-dirs)
 		\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
 		-o -name '*.ko.*' -o -name '*.su' -o -name '*.cfgtmp' \
 		-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
+		-o -name '*.lex.c' -o -name '*.tab.[ch]' \
 		-o -name '*.symtypes' -o -name 'modules.order' \
 		-o -name modules.builtin -o -name '.tmp_*.o.*' \
 		-o -name 'dsdt.aml' -o -name 'dsdt.asl.tmp' -o -name 'dsdt.c' \
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 4a6ed345928e..482ed0c8d804 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -415,6 +415,17 @@ $(call multi_depend, $(multi-used-m), .o, -objs -y)
 targets += $(multi-used-y) $(multi-used-m)
 
 
+# Add intermediate targets:
+# When building objects with specific suffix patterns, add intermediate
+# targets that the final targets are derived from.
+intermediate_targets = $(foreach sfx, $(2), \
+				$(patsubst %$(strip $(1)),%$(sfx), \
+					$(filter %$(strip $(1)), $(targets))))
+# %.lex.o <- %.lex.c <- %.l
+# %.tab.o <- %.tab.[ch] <- %.y
+targets += $(call intermediate_targets, .lex.o, .lex.c) \
+	   $(call intermediate_targets, .tab.o, .tab.c .tab.h)
+
 # Descending
 # ---------------------------------------------------------------------------
 
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index f9809ce7cef5..ef7604c46381 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -209,47 +209,30 @@ $(foreach m, $(notdir $1), \
 	$(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s)))))))
 endef
 
-ifdef REGENERATE_PARSERS
-
-# GPERF
-# ---------------------------------------------------------------------------
-quiet_cmd_gperf = GPERF $@
-      cmd_gperf = gperf -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $<
-
-.PRECIOUS: $(src)/%.hash.c_shipped
-$(src)/%.hash.c_shipped: $(src)/%.gperf
-	$(call cmd,gperf)
-
 # LEX
 # ---------------------------------------------------------------------------
-LEX_PREFIX = $(if $(LEX_PREFIX_${baseprereq}),$(LEX_PREFIX_${baseprereq}),yy)
-
 quiet_cmd_flex = LEX     $@
-      cmd_flex = flex -o$@ -L -P $(LEX_PREFIX) $<
+      cmd_flex = $(LEX) -o$@ -L $<
 
-.PRECIOUS: $(src)/%.lex.c_shipped
-$(src)/%.lex.c_shipped: $(src)/%.l
-	$(call cmd,flex)
+.PRECIOUS: $(obj)/%.lex.c
+$(obj)/%.lex.c: $(src)/%.l FORCE
+	$(call if_changed,flex)
 
 # YACC
 # ---------------------------------------------------------------------------
-YACC_PREFIX = $(if $(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy)
-
 quiet_cmd_bison = YACC    $@
-      cmd_bison = bison -o$@ -t -l -p $(YACC_PREFIX) $<
+      cmd_bison = $(YACC) -o$@ -t -l $<
 
-.PRECIOUS: $(src)/%.tab.c_shipped
-$(src)/%.tab.c_shipped: $(src)/%.y
-	$(call cmd,bison)
+.PRECIOUS: $(obj)/%.tab.c
+$(obj)/%.tab.c: $(src)/%.y FORCE
+	$(call if_changed,bison)
 
 quiet_cmd_bison_h = YACC    $@
-      cmd_bison_h = bison -o/dev/null --defines=$@ -t -l -p $(YACC_PREFIX) $<
+      cmd_bison_h = $(YACC) -o/dev/null --defines=$@ -t -l $<
 
-.PRECIOUS: $(src)/%.tab.h_shipped
-$(src)/%.tab.h_shipped: $(src)/%.y
-	$(call cmd,bison_h)
-
-endif
+.PRECIOUS: $(obj)/%.tab.h
+$(obj)/%.tab.h: $(src)/%.y FORCE
+	$(call if_changed,bison_h)
 
 # Shipped files
 # ===========================================================================
diff --git a/scripts/kconfig/.gitignore b/scripts/kconfig/.gitignore
index be603c4fef62..2da579edcbaf 100644
--- a/scripts/kconfig/.gitignore
+++ b/scripts/kconfig/.gitignore
@@ -1,11 +1,6 @@
 #
 # Generated files
 #
-config*
-*.lex.c
-*.tab.c
-*.tab.h
-zconf.hash.c
 *.moc
 gconf.glade.h
 *.pot
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 2542b38af36f..8b7b34975802 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -3,7 +3,7 @@
 # Kernel configuration targets
 # These targets are used from top-level makefile
 
-PHONY += xconfig gconfig menuconfig config silentoldconfig update-po-config \
+PHONY += xconfig gconfig menuconfig config syncconfig update-po-config \
 	localmodconfig localyesconfig
 
 # Added for U-Boot
@@ -40,24 +40,24 @@ config: $(obj)/conf
 nconfig: $(obj)/nconf
 	$< $(silent) $(Kconfig)
 
-silentoldconfig: $(obj)/conf
+# This has become an internal implementation detail and is now deprecated
+# for external use.
+syncconfig: $(obj)/conf
 	$(Q)mkdir -p include/config include/generated
-	$(Q)test -e include/generated/autoksyms.h || \
-	    touch   include/generated/autoksyms.h
 	$< $(silent) --$@ $(Kconfig)
 
-localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
+localyesconfig localmodconfig: $(obj)/conf
 	$(Q)mkdir -p include/config include/generated
-	$(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config
+	$(Q)perl $(srctree)/$(src)/streamline_config.pl --$@ $(srctree) $(Kconfig) > .tmp.config
 	$(Q)if [ -f .config ]; then 					\
 			cmp -s .tmp.config .config ||			\
 			(mv -f .config .config.old.1;			\
 			 mv -f .tmp.config .config;			\
-			 $(obj)/conf $(silent) --silentoldconfig $(Kconfig); \
+			 $< $(silent) --oldconfig $(Kconfig);		\
 			 mv -f .config.old.1 .config.old)		\
 	else								\
 			mv -f .tmp.config .config;			\
-			$(obj)/conf $(silent) --silentoldconfig $(Kconfig); \
+			$< $(silent) --oldconfig $(Kconfig);		\
 	fi
 	$(Q)rm -f .tmp.config
 
@@ -92,12 +92,21 @@ PHONY += $(simple-targets)
 $(simple-targets): $(obj)/conf
 	$< $(silent) --$@ $(Kconfig)
 
-PHONY += oldnoconfig savedefconfig defconfig
+PHONY += oldnoconfig silentoldconfig savedefconfig defconfig
 
 # oldnoconfig is an alias of olddefconfig, because people already are dependent
 # on its behavior (sets new symbols to their default value but not 'n') with the
 # counter-intuitive name.
 oldnoconfig: olddefconfig
+	@echo "  WARNING: \"oldnoconfig\" target will be removed after Linux 4.19"
+	@echo "            Please use \"olddefconfig\" instead, which is an alias."
+
+# We do not expect manual invokcation of "silentoldcofig" (or "syncconfig").
+silentoldconfig: syncconfig
+	@echo "  WARNING: \"silentoldconfig\" has been renamed to \"syncconfig\""
+	@echo "            and is now an internal implementation detail."
+	@echo "            What you want is probably \"oldconfig\"."
+	@echo "            \"silentoldconfig\" will be removed after Linux 4.19"
 
 savedefconfig: $(obj)/conf
 	$< $(silent) --$@=defconfig $(Kconfig)
@@ -141,6 +150,14 @@ PHONY += tinyconfig
 tinyconfig:
 	$(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config
 
+# CHECK: -o cache_dir=<path> working?
+PHONY += testconfig
+testconfig: $(obj)/conf
+	$(PYTHON3) -B -m pytest $(srctree)/$(src)/tests \
+	-o cache_dir=$(abspath $(obj)/tests/.cache) \
+	$(if $(findstring 1,$(KBUILD_VERBOSE)),--capture=no)
+clean-dirs += tests/.cache
+
 # Help text used by make help
 help:
 	@echo  '  config	  - Update current config utilising a line-oriented program'
@@ -152,7 +169,6 @@ help:
 	@echo  '  oldconfig	  - Update current config utilising a provided .config as base'
 	@echo  '  localmodconfig  - Update current config disabling modules not loaded'
 	@echo  '  localyesconfig  - Update current config converting local mods to core'
-	@echo  '  silentoldconfig - Same as oldconfig, but quietly, additionally update deps'
 	@echo  '  defconfig	  - New config with default from ARCH supplied defconfig'
 	@echo  '  savedefconfig   - Save current config as ./defconfig (minimal config)'
 	@echo  '  allnoconfig	  - New config where all options are answered with no'
@@ -161,8 +177,8 @@ help:
 	@echo  '  alldefconfig    - New config with all symbols set to default'
 	@echo  '  randconfig	  - New config with random answer to all options'
 	@echo  '  listnewconfig   - List new options'
-	@echo  '  olddefconfig	  - Same as silentoldconfig but sets new symbols to their'
-	@echo  '                    default value'
+	@echo  '  olddefconfig	  - Same as oldconfig but sets new symbols to their'
+	@echo  '                    default value without prompting'
 #	@echo  '  kvmconfig	  - Enable additional options for kvm guest kernel support'
 #	@echo  '  xenconfig       - Enable additional options for xen dom0 and guest kernel support'
 #	@echo  '  tinyconfig	  - Configure the tiniest possible kernel'
@@ -201,13 +217,14 @@ gconf-objs	:= gconf.o zconf.tab.o
 
 hostprogs-y := conf nconf mconf kxgettext qconf gconf
 
+targets		+= zconf.lex.c
 clean-files	:= qconf.moc .tmp_qtcheck .tmp_gtkcheck
-clean-files	+= zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h
+clean-files	+= gconf.glade.h
 clean-files     += config.pot linux.pot
 
 # Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
 PHONY += $(obj)/dochecklxdialog
-$(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog
+$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/dochecklxdialog
 $(obj)/dochecklxdialog:
 	$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf)
 
@@ -215,14 +232,12 @@ always := dochecklxdialog
 
 # Add environment specific flags
 HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))
+HOST_EXTRACXXFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCXX) $(HOSTCXXFLAGS))
 
 # generated files seem to need this to find local include files
 HOSTCFLAGS_zconf.lex.o	:= -I$(src)
 HOSTCFLAGS_zconf.tab.o	:= -I$(src)
 
-LEX_PREFIX_zconf	:= zconf
-YACC_PREFIX_zconf	:= zconf
-
 HOSTLOADLIBES_qconf	= $(KC_QT_LIBS)
 HOSTCXXFLAGS_qconf.o	= $(KC_QT_CFLAGS)
 
@@ -291,7 +306,7 @@ $(obj)/.tmp_gtkcheck:
 	fi
 endif
 
-$(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c
+$(obj)/zconf.tab.o: $(obj)/zconf.lex.c
 
 $(obj)/qconf.o: $(obj)/qconf.moc
 
diff --git a/scripts/kconfig/check.sh b/scripts/kconfig/check.sh
index 55b79ba1ba2a..97f0fee7d173 100755
--- a/scripts/kconfig/check.sh
+++ b/scripts/kconfig/check.sh
@@ -1,4 +1,5 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
 # Needed for systems without gettext
 $* -x c -o /dev/null - > /dev/null 2>&1 << EOF
 #include <libintl.h>
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 866369f10ff8..283eeedaa4fa 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -20,11 +20,10 @@
 
 static void conf(struct menu *menu);
 static void check_conf(struct menu *menu);
-static void xfgets(char *str, int size, FILE *in);
 
 enum input_mode {
 	oldaskconfig,
-	silentoldconfig,
+	syncconfig,
 	oldconfig,
 	allnoconfig,
 	allyesconfig,
@@ -35,11 +34,11 @@ enum input_mode {
 	savedefconfig,
 	listnewconfig,
 	olddefconfig,
-} input_mode = oldaskconfig;
+};
+static enum input_mode input_mode = oldaskconfig;
 
 static int indent = 1;
 static int tty_stdio;
-static int valid_stdin = 1;
 static int sync_kconfig;
 static int conf_cnt;
 static char line[PATH_MAX];
@@ -72,14 +71,14 @@ static void strip(char *str)
 		*p-- = 0;
 }
 
-static void check_stdin(void)
+/* Helper function to facilitate fgets() by Jean Sacren. */
+static void xfgets(char *str, int size, FILE *in)
 {
-	if (!valid_stdin) {
-		printf(_("aborted!\n\n"));
-		printf(_("Console input/output is redirected. "));
-		printf(_("Run 'make oldconfig' to update configuration.\n\n"));
-		exit(1);
-	}
+	if (!fgets(str, size, in))
+		fprintf(stderr, "\nError in reading or end of file.\n");
+
+	if (!tty_stdio)
+		printf("%s", str);
 }
 
 static int conf_askvalue(struct symbol *sym, const char *def)
@@ -101,18 +100,15 @@ static int conf_askvalue(struct symbol *sym, const char *def)
 
 	switch (input_mode) {
 	case oldconfig:
-	case silentoldconfig:
+	case syncconfig:
 		if (sym_has_value(sym)) {
 			printf("%s\n", def);
 			return 0;
 		}
-		check_stdin();
 		/* fall through */
 	case oldaskconfig:
 		fflush(stdout);
 		xfgets(line, sizeof(line), stdin);
-		if (!tty_stdio)
-			printf("\n");
 		return 1;
 	default:
 		break;
@@ -192,9 +188,7 @@ static int conf_sym(struct menu *menu)
 			printf("/m");
 		if (oldval != yes && sym_tristate_within_range(sym, yes))
 			printf("/y");
-		if (menu_has_help(menu))
-			printf("/?");
-		printf("] ");
+		printf("/?] ");
 		if (!conf_askvalue(sym, sym_get_string_value(sym)))
 			return 0;
 		strip(line);
@@ -296,19 +290,15 @@ static int conf_choice(struct menu *menu)
 			printf("[1]: 1\n");
 			goto conf_childs;
 		}
-		printf("[1-%d", cnt);
-		if (menu_has_help(menu))
-			printf("?");
-		printf("]: ");
+		printf("[1-%d?]: ", cnt);
 		switch (input_mode) {
 		case oldconfig:
-		case silentoldconfig:
+		case syncconfig:
 			if (!is_new) {
 				cnt = def;
 				printf("%d\n", cnt);
 				break;
 			}
-			check_stdin();
 			/* fall through */
 		case oldaskconfig:
 			fflush(stdout);
@@ -368,10 +358,11 @@ static void conf(struct menu *menu)
 
 		switch (prop->type) {
 		case P_MENU:
-			if ((input_mode == silentoldconfig ||
-			     input_mode == listnewconfig ||
-			     input_mode == olddefconfig) &&
-			    rootEntry != menu) {
+			/*
+			 * Except in oldaskconfig mode, we show only menus that
+			 * contain new symbols.
+			 */
+			if (input_mode != oldaskconfig && rootEntry != menu) {
 				check_conf(menu);
 				return;
 			}
@@ -431,10 +422,20 @@ static void check_conf(struct menu *menu)
 		if (sym_is_changable(sym) ||
 		    (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
 			if (input_mode == listnewconfig) {
-				if (sym->name && !sym_is_choice_value(sym)) {
-					printf("%s%s\n", CONFIG_, sym->name);
+				if (sym->name) {
+					const char *str;
+
+					if (sym->type == S_STRING) {
+						str = sym_get_string_value(sym);
+						str = sym_escape_string_value(str);
+						printf("%s%s=%s\n", CONFIG_, sym->name, str);
+						free((void *)str);
+					} else {
+						str = sym_get_string_value(sym);
+						printf("%s%s=%s\n", CONFIG_, sym->name, str);
+					}
 				}
-			} else if (input_mode != olddefconfig) {
+			} else {
 				if (!conf_cnt++)
 					printf(_("*\n* Restart config...\n*\n"));
 				rootEntry = menu_get_parent_menu(menu);
@@ -450,7 +451,7 @@ static void check_conf(struct menu *menu)
 static struct option long_opts[] = {
 	{"oldaskconfig",    no_argument,       NULL, oldaskconfig},
 	{"oldconfig",       no_argument,       NULL, oldconfig},
-	{"silentoldconfig", no_argument,       NULL, silentoldconfig},
+	{"syncconfig",      no_argument,       NULL, syncconfig},
 	{"defconfig",       optional_argument, NULL, defconfig},
 	{"savedefconfig",   required_argument, NULL, savedefconfig},
 	{"allnoconfig",     no_argument,       NULL, allnoconfig},
@@ -477,8 +478,9 @@ static void conf_usage(const char *progname)
 	printf("  --listnewconfig         List new options\n");
 	printf("  --oldaskconfig          Start a new configuration using a line-oriented program\n");
 	printf("  --oldconfig             Update a configuration using a provided .config as base\n");
-	printf("  --silentoldconfig       Same as oldconfig, but quietly, additionally update deps\n");
-	printf("  --olddefconfig          Same as silentoldconfig but sets new symbols to their default value\n");
+	printf("  --syncconfig            Similar to oldconfig but generates configuration in\n"
+	       "                          include/{generated/,config/}\n");
+	printf("  --olddefconfig          Same as oldconfig but sets new symbols to their default value\n");
 	printf("  --oldnoconfig           An alias of olddefconfig\n");
 	printf("  --defconfig <file>      New config with default defined in <file>\n");
 	printf("  --savedefconfig <file>  Save the minimal current configuration to <file>\n");
@@ -500,7 +502,7 @@ int main(int ac, char **av)
 	bindtextdomain(PACKAGE, LOCALEDIR);
 	textdomain(PACKAGE);
 
-	tty_stdio = isatty(0) && isatty(1) && isatty(2);
+	tty_stdio = isatty(0) && isatty(1);
 
 	while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) {
 		if (opt == 's') {
@@ -509,7 +511,7 @@ int main(int ac, char **av)
 		}
 		input_mode = (enum input_mode)opt;
 		switch (opt) {
-		case silentoldconfig:
+		case syncconfig:
 			sync_kconfig = 1;
 			break;
 		case defconfig:
@@ -557,7 +559,7 @@ int main(int ac, char **av)
 		}
 	}
 	if (ac == optind) {
-		printf(_("%s: Kconfig file missing\n"), av[0]);
+		fprintf(stderr, _("%s: Kconfig file missing\n"), av[0]);
 		conf_usage(progname);
 		exit(1);
 	}
@@ -582,14 +584,16 @@ int main(int ac, char **av)
 		if (!defconfig_file)
 			defconfig_file = conf_get_default_confname();
 		if (conf_read(defconfig_file)) {
-			printf(_("***\n"
-				"*** Can't find default configuration \"%s\"!\n"
-				"***\n"), defconfig_file);
+			fprintf(stderr,
+				_("***\n"
+				  "*** Can't find default configuration \"%s\"!\n"
+				  "***\n"),
+				defconfig_file);
 			exit(1);
 		}
 		break;
 	case savedefconfig:
-	case silentoldconfig:
+	case syncconfig:
 	case oldaskconfig:
 	case oldconfig:
 	case listnewconfig:
@@ -642,7 +646,6 @@ int main(int ac, char **av)
 				return 1;
 			}
 		}
-		valid_stdin = tty_stdio;
 	}
 
 	switch (input_mode) {
@@ -670,24 +673,24 @@ int main(int ac, char **av)
 	case oldaskconfig:
 		rootEntry = &rootmenu;
 		conf(&rootmenu);
-		input_mode = silentoldconfig;
+		input_mode = oldconfig;
 		/* fall through */
 	case oldconfig:
 	case listnewconfig:
-	case olddefconfig:
-	case silentoldconfig:
+	case syncconfig:
 		/* Update until a loop caused no more changes */
 		do {
 			conf_cnt = 0;
 			check_conf(&rootmenu);
-		} while (conf_cnt &&
-			 (input_mode != listnewconfig &&
-			  input_mode != olddefconfig));
+		} while (conf_cnt);
+		break;
+	case olddefconfig:
+	default:
 		break;
 	}
 
 	if (sync_kconfig) {
-		/* silentoldconfig is used during the build so we shall update autoconf.
+		/* syncconfig is used during the build so we shall update autoconf.
 		 * All other commands are only used to generate a config.
 		 */
 		if (conf_get_changed() && conf_write(NULL)) {
@@ -712,12 +715,3 @@ int main(int ac, char **av)
 	}
 	return 0;
 }
-
-/*
- * Helper function to facilitate fgets() by Jean Sacren.
- */
-void xfgets(char *str, int size, FILE *in)
-{
-	if (fgets(str, size, in) == NULL)
-		fprintf(stderr, "\nError in reading or end of file.\n");
-}
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 745cb93050ef..e4cbb87d760b 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -28,7 +28,7 @@ static void conf_message(const char *fmt, ...)
 	__attribute__ ((format (printf, 1, 2)));
 
 static const char *conf_filename;
-static int conf_lineno, conf_warnings, conf_unsaved;
+static int conf_lineno, conf_warnings;
 
 const char conf_defname[] = "arch/$ARCH/defconfig";
 
@@ -174,7 +174,7 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
 	case S_HEX:
 	done:
 		if (sym_string_valid(sym, p)) {
-			sym->def[def].val = strdup(p);
+			sym->def[def].val = xstrdup(p);
 			sym->flags |= def_flags;
 		} else {
 			if (def != S_DEF_AUTO)
@@ -197,7 +197,7 @@ static int add_byte(int c, char **lineptr, size_t slen, size_t *n)
 	if (new_size > *n) {
 		new_size += LINE_GROWTH - 1;
 		new_size *= 2;
-		nline = realloc(*lineptr, new_size);
+		nline = xrealloc(*lineptr, new_size);
 		if (!nline)
 			return -1;
 
@@ -286,7 +286,6 @@ load:
 	conf_filename = name;
 	conf_lineno = 0;
 	conf_warnings = 0;
-	conf_unsaved = 0;
 
 	def_flags = SYMBOL_DEF << def;
 	for_all_symbols(i, sym) {
@@ -405,6 +404,7 @@ setsym:
 int conf_read(const char *name)
 {
 	struct symbol *sym;
+	int conf_unsaved = 0;
 	int i;
 
 	sym_set_change_count(0);
@@ -1121,7 +1121,7 @@ void set_all_choice_values(struct symbol *csym)
 bool conf_set_all_new_symbols(enum conf_def_mode mode)
 {
 	struct symbol *sym, *csym;
-	int i, cnt, pby, pty, ptm;	/* pby: probability of boolean  = y
+	int i, cnt, pby, pty, ptm;	/* pby: probability of bool     = y
 					 * pty: probability of tristate = y
 					 * ptm: probability of tristate = m
 					 */
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index cbf4996dd9c1..e1a39e90841d 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -94,7 +94,7 @@ struct expr *expr_copy(const struct expr *org)
 		e->right.expr = expr_copy(org->right.expr);
 		break;
 	default:
-		printf("can't copy type %d\n", e->type);
+		fprintf(stderr, "can't copy type %d\n", e->type);
 		free(e);
 		e = NULL;
 		break;
@@ -113,7 +113,7 @@ void expr_free(struct expr *e)
 		break;
 	case E_NOT:
 		expr_free(e->left.expr);
-		return;
+		break;
 	case E_EQUAL:
 	case E_GEQ:
 	case E_GTH:
@@ -127,7 +127,7 @@ void expr_free(struct expr *e)
 		expr_free(e->right.expr);
 		break;
 	default:
-		printf("how to free type %d?\n", e->type);
+		fprintf(stderr, "how to free type %d?\n", e->type);
 		break;
 	}
 	free(e);
@@ -138,8 +138,18 @@ static int trans_count;
 #define e1 (*ep1)
 #define e2 (*ep2)
 
+/*
+ * expr_eliminate_eq() helper.
+ *
+ * Walks the two expression trees given in 'ep1' and 'ep2'. Any node that does
+ * not have type 'type' (E_OR/E_AND) is considered a leaf, and is compared
+ * against all other leaves. Two equal leaves are both replaced with either 'y'
+ * or 'n' as appropriate for 'type', to be eliminated later.
+ */
 static void __expr_eliminate_eq(enum expr_type type, struct expr **ep1, struct expr **ep2)
 {
+	/* Recurse down to leaves */
+
 	if (e1->type == type) {
 		__expr_eliminate_eq(type, &e1->left.expr, &e2);
 		__expr_eliminate_eq(type, &e1->right.expr, &e2);
@@ -150,12 +160,18 @@ static void __expr_eliminate_eq(enum expr_type type, struct expr **ep1, struct e
 		__expr_eliminate_eq(type, &e1, &e2->right.expr);
 		return;
 	}
+
+	/* e1 and e2 are leaves. Compare them. */
+
 	if (e1->type == E_SYMBOL && e2->type == E_SYMBOL &&
 	    e1->left.sym == e2->left.sym &&
 	    (e1->left.sym == &symbol_yes || e1->left.sym == &symbol_no))
 		return;
 	if (!expr_eq(e1, e2))
 		return;
+
+	/* e1 and e2 are equal leaves. Prepare them for elimination. */
+
 	trans_count++;
 	expr_free(e1); expr_free(e2);
 	switch (type) {
@@ -172,6 +188,35 @@ static void __expr_eliminate_eq(enum expr_type type, struct expr **ep1, struct e
 	}
 }
 
+/*
+ * Rewrites the expressions 'ep1' and 'ep2' to remove operands common to both.
+ * Example reductions:
+ *
+ *	ep1: A && B           ->  ep1: y
+ *	ep2: A && B && C      ->  ep2: C
+ *
+ *	ep1: A || B           ->  ep1: n
+ *	ep2: A || B || C      ->  ep2: C
+ *
+ *	ep1: A && (B && FOO)  ->  ep1: FOO
+ *	ep2: (BAR && B) && A  ->  ep2: BAR
+ *
+ *	ep1: A && (B || C)    ->  ep1: y
+ *	ep2: (C || B) && A    ->  ep2: y
+ *
+ * Comparisons are done between all operands at the same "level" of && or ||.
+ * For example, in the expression 'e1 && (e2 || e3) && (e4 || e5)', the
+ * following operands will be compared:
+ *
+ *	- 'e1', 'e2 || e3', and 'e4 || e5', against each other
+ *	- e2 against e3
+ *	- e4 against e5
+ *
+ * Parentheses are irrelevant within a single level. 'e1 && (e2 && e3)' and
+ * '(e1 && e2) && e3' are both a single level.
+ *
+ * See __expr_eliminate_eq() as well.
+ */
 void expr_eliminate_eq(struct expr **ep1, struct expr **ep2)
 {
 	if (!e1 || !e2)
@@ -197,6 +242,12 @@ void expr_eliminate_eq(struct expr **ep1, struct expr **ep2)
 #undef e1
 #undef e2
 
+/*
+ * Returns true if 'e1' and 'e2' are equal, after minor simplification. Two
+ * &&/|| expressions are considered equal if every operand in one expression
+ * equals some operand in the other (operands do not need to appear in the same
+ * order), recursively.
+ */
 static int expr_eq(struct expr *e1, struct expr *e2)
 {
 	int res, old_count;
@@ -243,6 +294,17 @@ static int expr_eq(struct expr *e1, struct expr *e2)
 	return 0;
 }
 
+/*
+ * Recursively performs the following simplifications in-place (as well as the
+ * corresponding simplifications with swapped operands):
+ *
+ *	expr && n  ->  n
+ *	expr && y  ->  expr
+ *	expr || n  ->  expr
+ *	expr || y  ->  y
+ *
+ * Returns the optimized expression.
+ */
 static struct expr *expr_eliminate_yn(struct expr *e)
 {
 	struct expr *tmp;
@@ -516,12 +578,21 @@ static struct expr *expr_join_and(struct expr *e1, struct expr *e2)
 	return NULL;
 }
 
+/*
+ * expr_eliminate_dups() helper.
+ *
+ * Walks the two expression trees given in 'ep1' and 'ep2'. Any node that does
+ * not have type 'type' (E_OR/E_AND) is considered a leaf, and is compared
+ * against all other leaves to look for simplifications.
+ */
 static void expr_eliminate_dups1(enum expr_type type, struct expr **ep1, struct expr **ep2)
 {
 #define e1 (*ep1)
 #define e2 (*ep2)
 	struct expr *tmp;
 
+	/* Recurse down to leaves */
+
 	if (e1->type == type) {
 		expr_eliminate_dups1(type, &e1->left.expr, &e2);
 		expr_eliminate_dups1(type, &e1->right.expr, &e2);
@@ -532,6 +603,9 @@ static void expr_eliminate_dups1(enum expr_type type, struct expr **ep1, struct
 		expr_eliminate_dups1(type, &e1, &e2->right.expr);
 		return;
 	}
+
+	/* e1 and e2 are leaves. Compare and process them. */
+
 	if (e1 == e2)
 		return;
 
@@ -568,6 +642,17 @@ static void expr_eliminate_dups1(enum expr_type type, struct expr **ep1, struct
 #undef e2
 }
 
+/*
+ * Rewrites 'e' in-place to remove ("join") duplicate and other redundant
+ * operands.
+ *
+ * Example simplifications:
+ *
+ *	A || B || A    ->  A || B
+ *	A && B && A=y  ->  A=y && B
+ *
+ * Returns the deduplicated expression.
+ */
 struct expr *expr_eliminate_dups(struct expr *e)
 {
 	int oldcount;
@@ -584,6 +669,7 @@ struct expr *expr_eliminate_dups(struct expr *e)
 			;
 		}
 		if (!trans_count)
+			/* No simplifications done in this pass. We're done */
 			break;
 		e = expr_eliminate_yn(e);
 	}
@@ -591,6 +677,12 @@ struct expr *expr_eliminate_dups(struct expr *e)
 	return e;
 }
 
+/*
+ * Performs various simplifications involving logical operators and
+ * comparisons.
+ *
+ * Allocates and returns a new expression.
+ */
 struct expr *expr_transform(struct expr *e)
 {
 	struct expr *tmp;
@@ -805,6 +897,20 @@ bool expr_depends_symbol(struct expr *dep, struct symbol *sym)
  	return false;
 }
 
+/*
+ * Inserts explicit comparisons of type 'type' to symbol 'sym' into the
+ * expression 'e'.
+ *
+ * Examples transformations for type == E_UNEQUAL, sym == &symbol_no:
+ *
+ *	A              ->  A!=n
+ *	!A             ->  A=n
+ *	A && B         ->  !(A=n || B=n)
+ *	A || B         ->  !(A=n && B=n)
+ *	A && (B || C)  ->  !(A=n || (B=n && C=n))
+ *
+ * Allocates and returns a new expression.
+ */
 struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym)
 {
 	struct expr *e1, *e2;
@@ -893,7 +999,10 @@ static enum string_value_kind expr_parse_string(const char *str,
 	switch (type) {
 	case S_BOOLEAN:
 	case S_TRISTATE:
-		return k_string;
+		val->s = !strcmp(str, "n") ? 0 :
+			 !strcmp(str, "m") ? 1 :
+			 !strcmp(str, "y") ? 2 : -1;
+		return k_signed;
 	case S_INT:
 		val->s = strtoll(str, &tail, 10);
 		kind = k_signed;
@@ -1028,49 +1137,9 @@ static int expr_compare_type(enum expr_type t1, enum expr_type t2)
 	return 0;
 }
 
-static inline struct expr *
-expr_get_leftmost_symbol(const struct expr *e)
-{
-
-	if (e == NULL)
-		return NULL;
-
-	while (e->type != E_SYMBOL)
-		e = e->left.expr;
-
-	return expr_copy(e);
-}
-
-/*
- * Given expression `e1' and `e2', returns the leaf of the longest
- * sub-expression of `e1' not containing 'e2.
- */
-struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2)
-{
-	struct expr *ret;
-
-	switch (e1->type) {
-	case E_OR:
-		return expr_alloc_and(
-		    expr_simplify_unmet_dep(e1->left.expr, e2),
-		    expr_simplify_unmet_dep(e1->right.expr, e2));
-	case E_AND: {
-		struct expr *e;
-		e = expr_alloc_and(expr_copy(e1), expr_copy(e2));
-		e = expr_eliminate_dups(e);
-		ret = (!expr_eq(e, e1)) ? e1 : NULL;
-		expr_free(e);
-		break;
-		}
-	default:
-		ret = e1;
-		break;
-	}
-
-	return expr_get_leftmost_symbol(ret);
-}
-
-void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken)
+void expr_print(struct expr *e,
+		void (*fn)(void *, struct symbol *, const char *),
+		void *data, int prevtoken)
 {
 	if (!e) {
 		fn(data, NULL, "y");
@@ -1204,3 +1273,33 @@ void expr_gstr_print(struct expr *e, struct gstr *gs)
 {
 	expr_print(e, expr_print_gstr_helper, gs, E_NONE);
 }
+
+/*
+ * Transform the top level "||" tokens into newlines and prepend each
+ * line with a minus. This makes expressions much easier to read.
+ * Suitable for reverse dependency expressions.
+ */
+static void expr_print_revdep(struct expr *e,
+			      void (*fn)(void *, struct symbol *, const char *),
+			      void *data, tristate pr_type, const char **title)
+{
+	if (e->type == E_OR) {
+		expr_print_revdep(e->left.expr, fn, data, pr_type, title);
+		expr_print_revdep(e->right.expr, fn, data, pr_type, title);
+	} else if (expr_calc_value(e) == pr_type) {
+		if (*title) {
+			fn(data, NULL, *title);
+			*title = NULL;
+		}
+
+		fn(data, NULL, "  - ");
+		expr_print(e, fn, data, E_NONE);
+		fn(data, NULL, "\n");
+	}
+}
+
+void expr_gstr_print_revdep(struct expr *e, struct gstr *gs,
+			    tristate pr_type, const char *title)
+{
+	expr_print_revdep(e, expr_print_gstr_helper, gs, pr_type, &title);
+}
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index a73f762c48d6..94a383b21df6 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -74,17 +74,60 @@ enum {
 	S_DEF_COUNT
 };
 
+/*
+ * Represents a configuration symbol.
+ *
+ * Choices are represented as a special kind of symbol and have the
+ * SYMBOL_CHOICE bit set in 'flags'.
+ */
 struct symbol {
+	/* The next symbol in the same bucket in the symbol hash table */
 	struct symbol *next;
+
+	/* The name of the symbol, e.g. "FOO" for 'config FOO' */
 	char *name;
+
+	/* S_BOOLEAN, S_TRISTATE, ... */
 	enum symbol_type type;
+
+	/*
+	 * The calculated value of the symbol. The SYMBOL_VALID bit is set in
+	 * 'flags' when this is up to date. Note that this value might differ
+	 * from the user value set in e.g. a .config file, due to visibility.
+	 */
 	struct symbol_value curr;
+
+	/*
+	 * Values for the symbol provided from outside. def[S_DEF_USER] holds
+	 * the .config value.
+	 */
 	struct symbol_value def[S_DEF_COUNT];
+
+	/*
+	 * An upper bound on the tristate value the user can set for the symbol
+	 * if it is a boolean or tristate. Calculated from prompt dependencies,
+	 * which also inherit dependencies from enclosing menus, choices, and
+	 * ifs. If 'n', the user value will be ignored.
+	 *
+	 * Symbols lacking prompts always have visibility 'n'.
+	 */
 	tristate visible;
+
+	/* SYMBOL_* flags */
 	int flags;
+
+	/* List of properties. See prop_type. */
 	struct property *prop;
+
+	/* Dependencies from enclosing menus, choices, and ifs */
 	struct expr_value dir_dep;
+
+	/* Reverse dependencies through being selected by other symbols */
 	struct expr_value rev_dep;
+
+	/*
+	 * "Weak" reverse dependencies through being implied by other symbols
+	 */
 	struct expr_value implied;
 };
 
@@ -133,7 +176,7 @@ enum prop_type {
 	P_UNKNOWN,
 	P_PROMPT,   /* prompt "foo prompt" or "BAZ Value" */
 	P_COMMENT,  /* text associated with a comment */
-	P_MENU,     /* prompt associated with a menuconfig option */
+	P_MENU,     /* prompt associated with a menu or menuconfig symbol */
 	P_DEFAULT,  /* default y */
 	P_CHOICE,   /* choice value */
 	P_SELECT,   /* select BAR */
@@ -166,22 +209,67 @@ struct property {
 	for (st = sym->prop; st; st = st->next) \
 		if (st->text)
 
+/*
+ * Represents a node in the menu tree, as seen in e.g. menuconfig (though used
+ * for all front ends). Each symbol, menu, etc. defined in the Kconfig files
+ * gets a node. A symbol defined in multiple locations gets one node at each
+ * location.
+ */
 struct menu {
+	/* The next menu node at the same level */
 	struct menu *next;
+
+	/* The parent menu node, corresponding to e.g. a menu or choice */
 	struct menu *parent;
+
+	/* The first child menu node, for e.g. menus and choices */
 	struct menu *list;
+
+	/*
+	 * The symbol associated with the menu node. Choices are implemented as
+	 * a special kind of symbol. NULL for menus, comments, and ifs.
+	 */
 	struct symbol *sym;
+
+	/*
+	 * The prompt associated with the node. This holds the prompt for a
+	 * symbol as well as the text for a menu or comment, along with the
+	 * type (P_PROMPT, P_MENU, etc.)
+	 */
 	struct property *prompt;
+
+	/*
+	 * 'visible if' dependencies. If more than one is given, they will be
+	 * ANDed together.
+	 */
 	struct expr *visibility;
+
+	/*
+	 * Ordinary dependencies from e.g. 'depends on' and 'if', ANDed
+	 * together
+	 */
 	struct expr *dep;
+
+	/* MENU_* flags */
 	unsigned int flags;
+
+	/* Any help text associated with the node */
 	char *help;
+
+	/* The location where the menu node appears in the Kconfig files */
 	struct file *file;
 	int lineno;
+
+	/* For use by front ends that need to store auxiliary data */
 	void *data;
 };
 
+/*
+ * Set on a menu node when the corresponding symbol changes state in some way.
+ * Can be checked by front ends.
+ */
 #define MENU_CHANGED		0x0001
+
 #define MENU_ROOT		0x0002
 
 struct jump_key {
@@ -217,11 +305,12 @@ struct expr *expr_transform(struct expr *e);
 int expr_contains_symbol(struct expr *dep, struct symbol *sym);
 bool expr_depends_symbol(struct expr *dep, struct symbol *sym);
 struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym);
-struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2);
 
 void expr_fprint(struct expr *e, FILE *out);
 struct gstr; /* forward */
 void expr_gstr_print(struct expr *e, struct gstr *gs);
+void expr_gstr_print_revdep(struct expr *e, struct gstr *gs,
+			    tristate pr_type, const char *title);
 
 static inline int expr_is_yes(struct expr *e)
 {
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 26d208b435a0..cfddddb9c9d7 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -914,7 +914,7 @@ on_treeview2_button_press_event(GtkWidget * widget,
 			current = menu;
 			display_tree_part();
 			gtk_widget_set_sensitive(back_btn, TRUE);
-		} else if ((col == COL_OPTION)) {
+		} else if (col == COL_OPTION) {
 			toggle_sym_value(menu);
 			gtk_tree_view_expand_row(view, path, TRUE);
 		}
diff --git a/scripts/kconfig/kconf_id.c b/scripts/kconfig/kconf_id.c
new file mode 100644
index 000000000000..3ea9c5f9f730
--- /dev/null
+++ b/scripts/kconfig/kconf_id.c
@@ -0,0 +1,53 @@
+
+static struct kconf_id kconf_id_array[] = {
+	{ "mainmenu",		T_MAINMENU,		TF_COMMAND },
+	{ "menu",		T_MENU,			TF_COMMAND },
+	{ "endmenu",		T_ENDMENU,		TF_COMMAND },
+	{ "source",		T_SOURCE,		TF_COMMAND },
+	{ "choice",		T_CHOICE,		TF_COMMAND },
+	{ "endchoice",		T_ENDCHOICE,		TF_COMMAND },
+	{ "comment",		T_COMMENT,		TF_COMMAND },
+	{ "config",		T_CONFIG,		TF_COMMAND },
+	{ "menuconfig",		T_MENUCONFIG,		TF_COMMAND },
+	{ "help",		T_HELP,			TF_COMMAND },
+	{ "---help---",		T_HELP,			TF_COMMAND },
+	{ "if",			T_IF,			TF_COMMAND|TF_PARAM },
+	{ "endif",		T_ENDIF,		TF_COMMAND },
+	{ "depends",		T_DEPENDS,		TF_COMMAND },
+	{ "optional",		T_OPTIONAL,		TF_COMMAND },
+	{ "default",		T_DEFAULT,		TF_COMMAND, S_UNKNOWN },
+	{ "prompt",		T_PROMPT,		TF_COMMAND },
+	{ "tristate",		T_TYPE,			TF_COMMAND, S_TRISTATE },
+	{ "def_tristate",	T_DEFAULT,		TF_COMMAND, S_TRISTATE },
+	{ "bool",		T_TYPE,			TF_COMMAND, S_BOOLEAN },
+	{ "def_bool",		T_DEFAULT,		TF_COMMAND, S_BOOLEAN },
+	{ "int",		T_TYPE,			TF_COMMAND, S_INT },
+	{ "hex",		T_TYPE,			TF_COMMAND, S_HEX },
+	{ "string",		T_TYPE,			TF_COMMAND, S_STRING },
+	{ "select",		T_SELECT,		TF_COMMAND },
+	{ "imply",		T_IMPLY,		TF_COMMAND },
+	{ "range",		T_RANGE,		TF_COMMAND },
+	{ "visible",		T_VISIBLE,		TF_COMMAND },
+	{ "option",		T_OPTION,		TF_COMMAND },
+	{ "on",			T_ON,			TF_PARAM },
+	{ "modules",		T_OPT_MODULES,		TF_OPTION },
+	{ "defconfig_list",	T_OPT_DEFCONFIG_LIST,	TF_OPTION },
+	{ "env",		T_OPT_ENV,		TF_OPTION },
+	{ "allnoconfig_y",	T_OPT_ALLNOCONFIG_Y,	TF_OPTION },
+};
+
+#define KCONF_ID_ARRAY_SIZE (sizeof(kconf_id_array)/sizeof(struct kconf_id))
+
+static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len)
+{
+	int i;
+
+	for (i = 0; i < KCONF_ID_ARRAY_SIZE; i++) {
+		struct kconf_id *id = kconf_id_array+i;
+		int l = strlen(id->name);
+
+		if (len == l && !memcmp(str, id->name, len))
+			return id;
+	}
+	return NULL;
+}
diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c
index 2858738b22d5..240880a89111 100644
--- a/scripts/kconfig/kxgettext.c
+++ b/scripts/kconfig/kxgettext.c
@@ -101,7 +101,7 @@ static struct message *message__new(const char *msg, char *option,
 	if (self->files == NULL)
 		goto out_fail;
 
-	self->msg = strdup(msg);
+	self->msg = xstrdup(msg);
 	if (self->msg == NULL)
 		goto out_fail_msg;
 
diff --git a/scripts/kconfig/list.h b/scripts/kconfig/list.h
index 2cf23f002d3f..45cb237ab7ef 100644
--- a/scripts/kconfig/list.h
+++ b/scripts/kconfig/list.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 #ifndef LIST_H
 #define LIST_H
 
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index 91ca126ea080..f4394af6e4b8 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -62,12 +62,13 @@ enum conf_def_mode {
 #define T_OPT_ALLNOCONFIG_Y	4
 
 struct kconf_id {
-	int name;
+	const char *name;
 	int token;
 	unsigned int flags;
 	enum symbol_type stype;
 };
 
+extern int yylineno;
 void zconfdump(FILE *out);
 void zconf_starthelp(void);
 FILE *zconf_fopen(const char *name);
@@ -100,7 +101,6 @@ void menu_warn(struct menu *menu, const char *fmt, ...);
 struct menu *menu_add_menu(void);
 void menu_end_menu(void);
 void menu_add_entry(struct symbol *sym);
-void menu_end_entry(void);
 void menu_add_dep(struct expr *dep);
 void menu_add_visibility(struct expr *dep);
 struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
@@ -115,6 +115,8 @@ struct file *file_lookup(const char *name);
 int file_write_dep(const char *name);
 void *xmalloc(size_t size);
 void *xcalloc(size_t nmemb, size_t size);
+void *xrealloc(void *p, size_t size);
+char *xstrdup(const char *s);
 
 struct gstr {
 	size_t len;
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h
index d5398718ec2a..9dc8abfb1dc3 100644
--- a/scripts/kconfig/lkc_proto.h
+++ b/scripts/kconfig/lkc_proto.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 #include <stdarg.h>
 
 /* confdata.c */
@@ -30,7 +31,7 @@ extern struct symbol * symbol_hash[SYMBOL_HASHSIZE];
 
 struct symbol * sym_lookup(const char *name, int flags);
 struct symbol * sym_find(const char *name);
-const char * sym_expand_string_value(const char *in);
+char *sym_expand_string_value(const char *in);
 const char * sym_escape_string_value(const char *in);
 struct symbol ** sym_re_search(const char *pattern);
 const char * sym_type_name(enum symbol_type type);
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 5075ebf2d3b9..6c0bcd9c472d 100755
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -1,4 +1,5 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
 # Check ncurses compatibility
 
 # What library to link
@@ -54,7 +55,8 @@ EOF
 	    echo " *** required header files."                            1>&2
 	    echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2
 	    echo " *** "                                                  1>&2
-	    echo " *** Install ncurses (ncurses-devel) and try again."    1>&2
+	    echo " *** Install ncurses (ncurses-devel or libncurses-dev " 1>&2
+	    echo " *** depending on your distribution) and try again."    1>&2
 	    echo " *** "                                                  1>&2
 	    exit 1
 	fi
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 315ce2c7cb9d..c829be8bb19f 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -246,7 +246,7 @@ search_help[] = N_(
 	"  Selected by: BAR [=n]\n"
 	"-----------------------------------------------------------------\n"
 	"o The line 'Type:' shows the type of the configuration option for\n"
-	"  this symbol (boolean, tristate, string, ...)\n"
+	"  this symbol (bool, tristate, string, ...)\n"
 	"o The line 'Prompt:' shows the text used in the menu structure for\n"
 	"  this symbol\n"
 	"o The 'Defined at' line tells at what file / line number the symbol\n"
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index e9357931b47d..5c5c1374b151 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -62,13 +62,8 @@ void menu_add_entry(struct symbol *sym)
 		menu_add_symbol(P_SYMBOL, sym, NULL);
 }
 
-void menu_end_entry(void)
-{
-}
-
 struct menu *menu_add_menu(void)
 {
-	menu_end_entry();
 	last_entry_ptr = &current_entry->list;
 	return current_menu = current_entry;
 }
@@ -79,19 +74,23 @@ void menu_end_menu(void)
 	current_menu = current_menu->parent;
 }
 
-static struct expr *menu_check_dep(struct expr *e)
+/*
+ * Rewrites 'm' to 'm' && MODULES, so that it evaluates to 'n' when running
+ * without modules
+ */
+static struct expr *rewrite_m(struct expr *e)
 {
 	if (!e)
 		return e;
 
 	switch (e->type) {
 	case E_NOT:
-		e->left.expr = menu_check_dep(e->left.expr);
+		e->left.expr = rewrite_m(e->left.expr);
 		break;
 	case E_OR:
 	case E_AND:
-		e->left.expr = menu_check_dep(e->left.expr);
-		e->right.expr = menu_check_dep(e->right.expr);
+		e->left.expr = rewrite_m(e->left.expr);
+		e->right.expr = rewrite_m(e->right.expr);
 		break;
 	case E_SYMBOL:
 		/* change 'm' into 'm' && MODULES */
@@ -106,7 +105,7 @@ static struct expr *menu_check_dep(struct expr *e)
 
 void menu_add_dep(struct expr *dep)
 {
-	current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep));
+	current_entry->dep = expr_alloc_and(current_entry->dep, dep);
 }
 
 void menu_set_type(int type)
@@ -131,7 +130,7 @@ static struct property *menu_add_prop(enum prop_type type, char *prompt, struct
 
 	prop->menu = current_entry;
 	prop->expr = expr;
-	prop->visible.expr = menu_check_dep(dep);
+	prop->visible.expr = dep;
 
 	if (prompt) {
 		if (isspace(*prompt)) {
@@ -213,6 +212,7 @@ void menu_add_option(int token, char *arg)
 			sym_defconfig_list = current_entry->sym;
 		else if (sym_defconfig_list != current_entry->sym)
 			zconf_error("trying to redefine defconfig symbol");
+		sym_defconfig_list->flags |= SYMBOL_AUTO;
 		break;
 	case T_OPT_ENV:
 		prop_add_env(arg);
@@ -252,6 +252,16 @@ static void sym_check_prop(struct symbol *sym)
 					    "'%s': number is invalid",
 					    sym->name);
 			}
+			if (sym_is_choice(sym)) {
+				struct property *choice_prop =
+					sym_get_choice_prop(sym2);
+
+				if (!choice_prop ||
+				    prop_get_symbol(choice_prop) != sym)
+					prop_warn(prop,
+						  "choice default symbol '%s' is not contained in the choice",
+						  sym2->name);
+			}
 			break;
 		case P_SELECT:
 		case P_IMPLY:
@@ -260,13 +270,13 @@ static void sym_check_prop(struct symbol *sym)
 			if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE)
 				prop_warn(prop,
 				    "config symbol '%s' uses %s, but is "
-				    "not boolean or tristate", sym->name, use);
+				    "not bool or tristate", sym->name, use);
 			else if (sym2->type != S_UNKNOWN &&
 				 sym2->type != S_BOOLEAN &&
 				 sym2->type != S_TRISTATE)
 				prop_warn(prop,
 				    "'%s' has wrong type. '%s' only "
-				    "accept arguments of boolean and "
+				    "accept arguments of bool and "
 				    "tristate type", sym2->name, use);
 			break;
 		case P_RANGE:
@@ -292,6 +302,11 @@ void menu_finalize(struct menu *parent)
 
 	sym = parent->sym;
 	if (parent->list) {
+		/*
+		 * This menu node has children. We (recursively) process them
+		 * and propagate parent dependencies before moving on.
+		 */
+
 		if (sym && sym_is_choice(sym)) {
 			if (sym->type == S_UNKNOWN) {
 				/* find the first choice value to find out choice type */
@@ -309,30 +324,83 @@ void menu_finalize(struct menu *parent)
 				if (menu->sym && menu->sym->type == S_UNKNOWN)
 					menu_set_type(sym->type);
 			}
+
+			/*
+			 * Use the choice itself as the parent dependency of
+			 * the contained items. This turns the mode of the
+			 * choice into an upper bound on the visibility of the
+			 * choice value symbols.
+			 */
 			parentdep = expr_alloc_symbol(sym);
 		} else if (parent->prompt)
+			/* Menu node for 'menu' */
 			parentdep = parent->prompt->visible.expr;
 		else
+			/* Menu node for 'if' */
 			parentdep = parent->dep;
 
+		/* For each child menu node... */
 		for (menu = parent->list; menu; menu = menu->next) {
-			basedep = expr_transform(menu->dep);
+			/*
+			 * Propagate parent dependencies to the child menu
+			 * node, also rewriting and simplifying expressions
+			 */
+			basedep = rewrite_m(menu->dep);
+			basedep = expr_transform(basedep);
 			basedep = expr_alloc_and(expr_copy(parentdep), basedep);
 			basedep = expr_eliminate_dups(basedep);
 			menu->dep = basedep;
+
 			if (menu->sym)
+				/*
+				 * Note: For symbols, all prompts are included
+				 * too in the symbol's own property list
+				 */
 				prop = menu->sym->prop;
 			else
+				/*
+				 * For non-symbol menu nodes, we just need to
+				 * handle the prompt
+				 */
 				prop = menu->prompt;
+
+			/* For each property... */
 			for (; prop; prop = prop->next) {
 				if (prop->menu != menu)
+					/*
+					 * Two possibilities:
+					 *
+					 * 1. The property lacks dependencies
+					 *    and so isn't location-specific,
+					 *    e.g. an 'option'
+					 *
+					 * 2. The property belongs to a symbol
+					 *    defined in multiple locations and
+					 *    is from some other location. It
+					 *    will be handled there in that
+					 *    case.
+					 *
+					 * Skip the property.
+					 */
 					continue;
-				dep = expr_transform(prop->visible.expr);
+
+				/*
+				 * Propagate parent dependencies to the
+				 * property's condition, rewriting and
+				 * simplifying expressions at the same time
+				 */
+				dep = rewrite_m(prop->visible.expr);
+				dep = expr_transform(dep);
 				dep = expr_alloc_and(expr_copy(basedep), dep);
 				dep = expr_eliminate_dups(dep);
 				if (menu->sym && menu->sym->type != S_TRISTATE)
 					dep = expr_trans_bool(dep);
 				prop->visible.expr = dep;
+
+				/*
+				 * Handle selects and implies, which modify the
+				 * dependencies of the selected/implied symbol
+				 */
 				if (prop->type == P_SELECT) {
 					struct symbol *es = prop_get_symbol(prop);
 					es->rev_dep.expr = expr_alloc_or(es->rev_dep.expr,
@@ -344,34 +412,81 @@ void menu_finalize(struct menu *parent)
 				}
 			}
 		}
+
+		if (sym && sym_is_choice(sym))
+			expr_free(parentdep);
+
+		/*
+		 * Recursively process children in the same fashion before
+		 * moving on
+		 */
 		for (menu = parent->list; menu; menu = menu->next)
 			menu_finalize(menu);
 	} else if (sym) {
+		/*
+		 * Automatic submenu creation. If sym is a symbol and A, B, C,
+		 * ... are consecutive items (symbols, menus, ifs, etc.) that
+		 * all depend on sym, then the following menu structure is
+		 * created:
+		 *
+		 *	sym
+		 *	 +-A
+		 *	 +-B
+		 *	 +-C
+		 *	 ...
+		 *
+		 * This also works recursively, giving the following structure
+		 * if A is a symbol and B depends on A:
+		 *
+		 *	sym
+		 *	 +-A
+		 *	 | +-B
+		 *	 +-C
+		 *	 ...
+		 */
+
 		basedep = parent->prompt ? parent->prompt->visible.expr : NULL;
 		basedep = expr_trans_compare(basedep, E_UNEQUAL, &symbol_no);
 		basedep = expr_eliminate_dups(expr_transform(basedep));
+
+		/* Examine consecutive elements after sym */
 		last_menu = NULL;
 		for (menu = parent->next; menu; menu = menu->next) {
 			dep = menu->prompt ? menu->prompt->visible.expr : menu->dep;
 			if (!expr_contains_symbol(dep, sym))
+				/* No dependency, quit */
 				break;
 			if (expr_depends_symbol(dep, sym))
+				/* Absolute dependency, put in submenu */
 				goto next;
+
+			/*
+			 * Also consider it a dependency on sym if our
+			 * dependencies contain sym and are a "superset" of
+			 * sym's dependencies, e.g. '(sym || Q) && R' when sym
+			 * depends on R.
+			 *
+			 * Note that 'R' might be from an enclosing menu or if,
+			 * making this a more common case than it might seem.
+			 */
 			dep = expr_trans_compare(dep, E_UNEQUAL, &symbol_no);
 			dep = expr_eliminate_dups(expr_transform(dep));
 			dep2 = expr_copy(basedep);
 			expr_eliminate_eq(&dep, &dep2);
 			expr_free(dep);
 			if (!expr_is_yes(dep2)) {
+				/* Not superset, quit */
 				expr_free(dep2);
 				break;
 			}
+			/* Superset, put in submenu */
 			expr_free(dep2);
 		next:
 			menu_finalize(menu);
 			menu->parent = parent;
 			last_menu = menu;
 		}
+		expr_free(basedep);
 		if (last_menu) {
 			parent->list = parent->next;
 			parent->next = last_menu->next;
@@ -420,6 +535,35 @@ void menu_finalize(struct menu *parent)
 			*ep = expr_alloc_one(E_LIST, NULL);
 			(*ep)->right.sym = menu->sym;
 		}
+
+		/*
+		 * This code serves two purposes:
+		 *
+		 * (1) Flattening 'if' blocks, which do not specify a submenu
+		 *     and only add dependencies.
+		 *
+		 *     (Automatic submenu creation might still create a submenu
+		 *     from an 'if' before this code runs.)
+		 *
+		 * (2) "Undoing" any automatic submenus created earlier below
+		 *     promptless symbols.
+		 *
+		 * Before:
+		 *
+		 *	A
+		 *	if ... (or promptless symbol)
+		 *	 +-B
+		 *	 +-C
+		 *	D
+		 *
+		 * After:
+		 *
+		 *	A
+		 *	if ... (or promptless symbol)
+		 *	B
+		 *	C
+		 *	D
+		 */
 		if (menu->list && (!menu->prompt || !menu->prompt->text)) {
 			for (last_menu = menu->list; ; last_menu = last_menu->next) {
 				last_menu->parent = parent;
@@ -444,6 +588,15 @@ void menu_finalize(struct menu *parent)
 		sym->flags |= SYMBOL_WARNED;
 	}
 
+	/*
+	 * For non-optional choices, add a reverse dependency (corresponding to
+	 * a select) of '<visibility> && m'. This prevents the user from
+	 * setting the choice mode to 'n' when the choice is visible.
+	 *
+	 * This would also work for non-choice symbols, but only non-optional
+	 * choices clear SYMBOL_OPTIONAL as of writing. Choices are implemented
+	 * as a type of symbol.
+	 */
 	if (sym && !sym_is_optional(sym) && parent->prompt) {
 		sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr,
 				expr_alloc_and(parent->prompt->visible.expr,
@@ -675,16 +828,16 @@ static void get_symbol_str(struct gstr *r, struct symbol *sym,
 
 	get_symbol_props_str(r, sym, P_SELECT, _("  Selects: "));
 	if (sym->rev_dep.expr) {
-		str_append(r, _("  Selected by: "));
-		expr_gstr_print(sym->rev_dep.expr, r);
-		str_append(r, "\n");
+		expr_gstr_print_revdep(sym->rev_dep.expr, r, yes, "  Selected by [y]:\n");
+		expr_gstr_print_revdep(sym->rev_dep.expr, r, mod, "  Selected by [m]:\n");
+		expr_gstr_print_revdep(sym->rev_dep.expr, r, no, "  Selected by [n]:\n");
 	}
 
 	get_symbol_props_str(r, sym, P_IMPLY, _("  Implies: "));
 	if (sym->implied.expr) {
-		str_append(r, _("  Implied by: "));
-		expr_gstr_print(sym->implied.expr, r);
-		str_append(r, "\n");
+		expr_gstr_print_revdep(sym->implied.expr, r, yes, "  Implied by [y]:\n");
+		expr_gstr_print_revdep(sym->implied.expr, r, mod, "  Implied by [m]:\n");
+		expr_gstr_print_revdep(sym->implied.expr, r, no, "  Implied by [n]:\n");
 	}
 
 	str_append(r, "\n\n");
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
index a9bc5334a478..003114779815 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -271,7 +271,7 @@ static struct mitem k_menu_items[MAX_MENU_ITEMS];
 static int items_num;
 static int global_exit;
 /* the currently selected button */
-const char *current_instructions = menu_instructions;
+static const char *current_instructions = menu_instructions;
 
 static char *dialog_input_result;
 static int dialog_input_result_len;
@@ -305,7 +305,7 @@ struct function_keys {
 };
 
 static const int function_keys_num = 9;
-struct function_keys function_keys[] = {
+static struct function_keys function_keys[] = {
 	{
 		.key_str = "F1",
 		.func = "Help",
@@ -508,7 +508,7 @@ static int get_mext_match(const char *match_str, match_f flag)
 	index = (index + items_num) % items_num;
 	while (true) {
 		char *str = k_menu_items[index].str;
-		if (strcasestr(str, match_str) != 0)
+		if (strcasestr(str, match_str) != NULL)
 			return index;
 		if (flag == FIND_NEXT_MATCH_UP ||
 		    flag == MATCH_TINKER_PATTERN_UP)
@@ -1067,7 +1067,7 @@ static int do_match(int key, struct match_state *state, int *ans)
 
 static void conf(struct menu *menu)
 {
-	struct menu *submenu = 0;
+	struct menu *submenu = NULL;
 	const char *prompt = menu_get_prompt(menu);
 	struct symbol *sym;
 	int res;
@@ -1234,7 +1234,7 @@ static void show_help(struct menu *menu)
 static void conf_choice(struct menu *menu)
 {
 	const char *prompt = _(menu_get_prompt(menu));
-	struct menu *child = 0;
+	struct menu *child = NULL;
 	struct symbol *active;
 	int selected_index = 0;
 	int last_top_row = 0;
@@ -1456,7 +1456,7 @@ static void conf_save(void)
 	}
 }
 
-void setup_windows(void)
+static void setup_windows(void)
 {
 	int lines, columns;
 
diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c
index 4b2f44c20caf..88874acfda36 100644
--- a/scripts/kconfig/nconf.gui.c
+++ b/scripts/kconfig/nconf.gui.c
@@ -6,6 +6,7 @@
  *
  */
 #include "nconf.h"
+#include "lkc.h"
 
 /* a list of all the different widgets we use */
 attributes_t attributes[ATTR_MAX+1] = {0};
@@ -129,7 +130,7 @@ static void no_colors_theme(void)
 	mkattrn(FUNCTION_TEXT, A_REVERSE);
 }
 
-void set_colors()
+void set_colors(void)
 {
 	start_color();
 	use_default_colors();
@@ -192,7 +193,7 @@ const char *get_line(const char *text, int line_no)
 	int lines = 0;
 
 	if (!text)
-		return 0;
+		return NULL;
 
 	for (i = 0; text[i] != '\0' && lines < line_no; i++)
 		if (text[i] == '\n')
@@ -374,7 +375,7 @@ int dialog_inputbox(WINDOW *main_window,
 
 	if (strlen(init)+1 > *result_len) {
 		*result_len = strlen(init)+1;
-		*resultp = result = realloc(result, *result_len);
+		*resultp = result = xrealloc(result, *result_len);
 	}
 
 	/* find the widest line of msg: */
diff --git a/scripts/kconfig/nconf.h b/scripts/kconfig/nconf.h
index 0d5261705ef5..9f6f21d3b0d4 100644
--- a/scripts/kconfig/nconf.h
+++ b/scripts/kconfig/nconf.h
@@ -15,7 +15,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <locale.h>
-#include <curses.h>
+#include <ncurses.h>
 #include <menu.h>
 #include <panel.h>
 #include <form.h>
@@ -24,8 +24,6 @@
 #include <time.h>
 #include <sys/time.h>
 
-#include "ncurses.h"
-
 #define max(a, b) ({\
 		typeof(a) _a = a;\
 		typeof(b) _b = b;\
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index b8c7b29affc5..a2e83ab17de3 100755
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 #
 # Copyright 2005-2009 - Steven Rostedt
 # Licensed under the terms of the GNU GPL License version 2
@@ -42,6 +42,7 @@
 #    mv config_strip .config
 #    make oldconfig
 #
+use warnings;
 use strict;
 use Getopt::Long;
 
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 3c8bd9bb4267..f0b2e3b3102d 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -77,7 +77,7 @@ const char *sym_type_name(enum symbol_type type)
 {
 	switch (type) {
 	case S_BOOLEAN:
-		return "boolean";
+		return "bool";
 	case S_TRISTATE:
 		return "tristate";
 	case S_INT:
@@ -183,7 +183,7 @@ static void sym_validate_range(struct symbol *sym)
 		sprintf(str, "%lld", val2);
 	else
 		sprintf(str, "0x%llx", val2);
-	sym->curr.val = strdup(str);
+	sym->curr.val = xstrdup(str);
 }
 
 static void sym_set_changed(struct symbol *sym)
@@ -243,7 +243,7 @@ static void sym_calc_visibility(struct symbol *sym)
 	tri = yes;
 	if (sym->dir_dep.expr)
 		tri = expr_calc_value(sym->dir_dep.expr);
-	if (tri == mod)
+	if (tri == mod && sym_get_type(sym) == S_BOOLEAN)
 		tri = yes;
 	if (sym->dir_dep.tri != tri) {
 		sym->dir_dep.tri = tri;
@@ -333,6 +333,27 @@ static struct symbol *sym_calc_choice(struct symbol *sym)
 	return def_sym;
 }
 
+static void sym_warn_unmet_dep(struct symbol *sym)
+{
+	struct gstr gs = str_new();
+
+	str_printf(&gs,
+		   "\nWARNING: unmet direct dependencies detected for %s\n",
+		   sym->name);
+	str_printf(&gs,
+		   "  Depends on [%c]: ",
+		   sym->dir_dep.tri == mod ? 'm' : 'n');
+	expr_gstr_print(sym->dir_dep.expr, &gs);
+	str_printf(&gs, "\n");
+
+	expr_gstr_print_revdep(sym->rev_dep.expr, &gs, yes,
+			       "  Selected by [y]:\n");
+	expr_gstr_print_revdep(sym->rev_dep.expr, &gs, mod,
+			       "  Selected by [m]:\n");
+
+	fputs(str_get(&gs), stderr);
+}
+
 void sym_calc_value(struct symbol *sym)
 {
 	struct symbol_value newval, oldval;
@@ -371,11 +392,13 @@ void sym_calc_value(struct symbol *sym)
 		sym->curr.tri = no;
 		return;
 	}
-	if (!sym_is_choice_value(sym))
-		sym->flags &= ~SYMBOL_WRITE;
+	sym->flags &= ~SYMBOL_WRITE;
 
 	sym_calc_visibility(sym);
 
+	if (sym->visible != no)
+		sym->flags |= SYMBOL_WRITE;
+
 	/* set default if recursively called */
 	sym->curr = newval;
 
@@ -390,7 +413,6 @@ void sym_calc_value(struct symbol *sym)
 				/* if the symbol is visible use the user value
 				 * if available, otherwise try the default value
 				 */
-				sym->flags |= SYMBOL_WRITE;
 				if (sym_has_value(sym)) {
 					newval.tri = EXPR_AND(sym->def[S_DEF_USER].tri,
 							      sym->visible);
@@ -402,9 +424,10 @@ void sym_calc_value(struct symbol *sym)
 			if (!sym_is_choice(sym)) {
 				prop = sym_get_default_prop(sym);
 				if (prop) {
-					sym->flags |= SYMBOL_WRITE;
 					newval.tri = EXPR_AND(expr_calc_value(prop->expr),
 							      prop->visible.tri);
+					if (newval.tri != no)
+						sym->flags |= SYMBOL_WRITE;
 				}
 				if (sym->implied.tri != no) {
 					sym->flags |= SYMBOL_WRITE;
@@ -412,18 +435,8 @@ void sym_calc_value(struct symbol *sym)
 				}
 			}
 		calc_newval:
-			if (sym->dir_dep.tri == no && sym->rev_dep.tri != no) {
-				struct expr *e;
-				e = expr_simplify_unmet_dep(sym->rev_dep.expr,
-				    sym->dir_dep.expr);
-				fprintf(stderr, "warning: (");
-				expr_fprint(e, stderr);
-				fprintf(stderr, ") selects %s which has unmet direct dependencies (",
-					sym->name);
-				expr_fprint(sym->dir_dep.expr, stderr);
-				fprintf(stderr, ")\n");
-				expr_free(e);
-			}
+			if (sym->dir_dep.tri < sym->rev_dep.tri)
+				sym_warn_unmet_dep(sym);
 			newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri);
 		}
 		if (newval.tri == mod &&
@@ -433,12 +446,9 @@ void sym_calc_value(struct symbol *sym)
 	case S_STRING:
 	case S_HEX:
 	case S_INT:
-		if (sym->visible != no) {
-			sym->flags |= SYMBOL_WRITE;
-			if (sym_has_value(sym)) {
-				newval.val = sym->def[S_DEF_USER].val;
-				break;
-			}
+		if (sym->visible != no && sym_has_value(sym)) {
+			newval.val = sym->def[S_DEF_USER].val;
+			break;
 		}
 		prop = sym_get_default_prop(sym);
 		if (prop) {
@@ -851,7 +861,7 @@ struct symbol *sym_lookup(const char *name, int flags)
 				   : !(symbol->flags & (SYMBOL_CONST|SYMBOL_CHOICE))))
 				return symbol;
 		}
-		new_name = strdup(name);
+		new_name = xstrdup(name);
 	} else {
 		new_name = NULL;
 		hash = 0;
@@ -901,12 +911,16 @@ struct symbol *sym_find(const char *name)
  * name to be expanded shall be prefixed by a '$'. Unknown symbol expands to
  * the empty string.
  */
-const char *sym_expand_string_value(const char *in)
+char *sym_expand_string_value(const char *in)
 {
 	const char *src;
 	char *res;
 	size_t reslen;
 
+	/*
+	 * Note: 'in' might come from a token that's about to be
+	 * freed, so make sure to always allocate a new string
+	 */
 	reslen = strlen(in) + 1;
 	res = xmalloc(reslen);
 	res[0] = '\0';
@@ -934,7 +948,7 @@ const char *sym_expand_string_value(const char *in)
 		newlen = strlen(res) + strlen(symval) + strlen(src) + 1;
 		if (newlen > reslen) {
 			reslen = newlen;
-			res = realloc(res, reslen);
+			res = xrealloc(res, reslen);
 		}
 
 		strcat(res, symval);
@@ -1150,8 +1164,7 @@ static void sym_check_print_recursive(struct symbol *last_sym)
 		if (stack->sym == last_sym)
 			fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
 				prop->file->name, prop->lineno);
-			fprintf(stderr, "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n");
-			fprintf(stderr, "subsection \"Kconfig recursive dependency limitations\"\n");
+
 		if (stack->expr) {
 			fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n",
 				prop->file->name, prop->lineno,
@@ -1181,6 +1194,11 @@ static void sym_check_print_recursive(struct symbol *last_sym)
 		}
 	}
 
+	fprintf(stderr,
+		"For a resolution refer to Documentation/kbuild/kconfig-language.txt\n"
+		"subsection \"Kconfig recursive dependency limitations\"\n"
+		"\n");
+
 	if (check_top == &cv_stack)
 		dep_stack_remove();
 }
@@ -1215,7 +1233,7 @@ static struct symbol *sym_check_expr_deps(struct expr *e)
 	default:
 		break;
 	}
-	printf("Oops! How to check %d?\n", e->type);
+	fprintf(stderr, "Oops! How to check %d?\n", e->type);
 	return NULL;
 }
 
diff --git a/scripts/kconfig/tests/auto_submenu/Kconfig b/scripts/kconfig/tests/auto_submenu/Kconfig
new file mode 100644
index 000000000000..c17bf2caa7e6
--- /dev/null
+++ b/scripts/kconfig/tests/auto_submenu/Kconfig
@@ -0,0 +1,50 @@
+config A
+	bool "A"
+	default y
+
+config A0
+	bool "A0"
+	depends on A
+	default y
+	help
+	  This depends on A, so should be a submenu of A.
+
+config A0_0
+	bool "A1_0"
+	depends on A0
+	help
+	  Submenus are created recursively.
+	  This should be a submenu of A0.
+
+config A1
+	bool "A1"
+	depends on A
+	default y
+	help
+	  This should line up with A0.
+
+choice
+	prompt "choice"
+	depends on A1
+	help
+	  Choice should become a submenu as well.
+
+config A1_0
+	bool "A1_0"
+
+config A1_1
+	bool "A1_1"
+
+endchoice
+
+config B
+	bool "B"
+	help
+	  This is independent of A.
+
+config C
+	bool "C"
+	depends on A
+	help
+	  This depends on A, but not a consecutive item, so can/should not
+	  be a submenu.
diff --git a/scripts/kconfig/tests/auto_submenu/__init__.py b/scripts/kconfig/tests/auto_submenu/__init__.py
new file mode 100644
index 000000000000..32e79b85faeb
--- /dev/null
+++ b/scripts/kconfig/tests/auto_submenu/__init__.py
@@ -0,0 +1,12 @@
+"""
+Create submenu for symbols that depend on the preceding one.
+
+If a symbols has dependency on the preceding symbol, the menu entry
+should become the submenu of the preceding one, and displayed with
+deeper indentation.
+"""
+
+
+def test(conf):
+    assert conf.oldaskconfig() == 0
+    assert conf.stdout_contains('expected_stdout')
diff --git a/scripts/kconfig/tests/auto_submenu/expected_stdout b/scripts/kconfig/tests/auto_submenu/expected_stdout
new file mode 100644
index 000000000000..bf5236f39a56
--- /dev/null
+++ b/scripts/kconfig/tests/auto_submenu/expected_stdout
@@ -0,0 +1,10 @@
+A (A) [Y/n/?] (NEW) 
+  A0 (A0) [Y/n/?] (NEW) 
+    A1_0 (A0_0) [N/y/?] (NEW) 
+  A1 (A1) [Y/n/?] (NEW) 
+    choice
+    > 1. A1_0 (A1_0) (NEW)
+      2. A1_1 (A1_1) (NEW)
+    choice[1-2?]: 
+B (B) [N/y/?] (NEW) 
+C (C) [N/y/?] (NEW) 
diff --git a/scripts/kconfig/tests/choice/Kconfig b/scripts/kconfig/tests/choice/Kconfig
new file mode 100644
index 000000000000..cc60e9ce2c03
--- /dev/null
+++ b/scripts/kconfig/tests/choice/Kconfig
@@ -0,0 +1,54 @@
+config MODULES
+	bool "Enable loadable module support"
+	option modules
+	default y
+
+choice
+	prompt "boolean choice"
+	default BOOL_CHOICE1
+
+config BOOL_CHOICE0
+	bool "choice 0"
+
+config BOOL_CHOICE1
+	bool "choice 1"
+
+endchoice
+
+choice
+	prompt "optional boolean choice"
+	optional
+	default OPT_BOOL_CHOICE1
+
+config OPT_BOOL_CHOICE0
+	bool "choice 0"
+
+config OPT_BOOL_CHOICE1
+	bool "choice 1"
+
+endchoice
+
+choice
+	prompt "tristate choice"
+	default TRI_CHOICE1
+
+config TRI_CHOICE0
+	tristate "choice 0"
+
+config TRI_CHOICE1
+	tristate "choice 1"
+
+endchoice
+
+choice
+	prompt "optional tristate choice"
+	optional
+	default OPT_TRI_CHOICE1
+
+config OPT_TRI_CHOICE0
+	tristate "choice 0"
+
+config OPT_TRI_CHOICE1
+	tristate "choice 1"
+
+endchoice
diff --git a/scripts/kconfig/tests/choice/__init__.py b/scripts/kconfig/tests/choice/__init__.py
new file mode 100644
index 000000000000..9edcc5262134
--- /dev/null
+++ b/scripts/kconfig/tests/choice/__init__.py
@@ -0,0 +1,40 @@
+"""
+Basic choice tests.
+
+The handling of 'choice' is a bit complicated part in Kconfig.
+
+The behavior of 'y' choice is intuitive.  If choice values are tristate,
+the choice can be 'm' where each value can be enabled independently.
+Also, if a choice is marked as 'optional', the whole choice can be
+invisible.
+"""
+
+
+def test_oldask0(conf):
+    assert conf.oldaskconfig() == 0
+    assert conf.stdout_contains('oldask0_expected_stdout')
+
+
+def test_oldask1(conf):
+    assert conf.oldaskconfig('oldask1_config') == 0
+    assert conf.stdout_contains('oldask1_expected_stdout')
+
+
+def test_allyes(conf):
+    assert conf.allyesconfig() == 0
+    assert conf.config_contains('allyes_expected_config')
+
+
+def test_allmod(conf):
+    assert conf.allmodconfig() == 0
+    assert conf.config_contains('allmod_expected_config')
+
+
+def test_allno(conf):
+    assert conf.allnoconfig() == 0
+    assert conf.config_contains('allno_expected_config')
+
+
+def test_alldef(conf):
+    assert conf.alldefconfig() == 0
+    assert conf.config_contains('alldef_expected_config')
diff --git a/scripts/kconfig/tests/choice/alldef_expected_config b/scripts/kconfig/tests/choice/alldef_expected_config
new file mode 100644
index 000000000000..7a754bf4be94
--- /dev/null
+++ b/scripts/kconfig/tests/choice/alldef_expected_config
@@ -0,0 +1,5 @@
+CONFIG_MODULES=y
+# CONFIG_BOOL_CHOICE0 is not set
+CONFIG_BOOL_CHOICE1=y
+# CONFIG_TRI_CHOICE0 is not set
+# CONFIG_TRI_CHOICE1 is not set
diff --git a/scripts/kconfig/tests/choice/allmod_expected_config b/scripts/kconfig/tests/choice/allmod_expected_config
new file mode 100644
index 000000000000..f1f5dcdb7923
--- /dev/null
+++ b/scripts/kconfig/tests/choice/allmod_expected_config
@@ -0,0 +1,9 @@
+CONFIG_MODULES=y
+# CONFIG_BOOL_CHOICE0 is not set
+CONFIG_BOOL_CHOICE1=y
+# CONFIG_OPT_BOOL_CHOICE0 is not set
+CONFIG_OPT_BOOL_CHOICE1=y
+CONFIG_TRI_CHOICE0=m
+CONFIG_TRI_CHOICE1=m
+CONFIG_OPT_TRI_CHOICE0=m
+CONFIG_OPT_TRI_CHOICE1=m
diff --git a/scripts/kconfig/tests/choice/allno_expected_config b/scripts/kconfig/tests/choice/allno_expected_config
new file mode 100644
index 000000000000..b88ee7a43136
--- /dev/null
+++ b/scripts/kconfig/tests/choice/allno_expected_config
@@ -0,0 +1,5 @@
+# CONFIG_MODULES is not set
+# CONFIG_BOOL_CHOICE0 is not set
+CONFIG_BOOL_CHOICE1=y
+# CONFIG_TRI_CHOICE0 is not set
+CONFIG_TRI_CHOICE1=y
diff --git a/scripts/kconfig/tests/choice/allyes_expected_config b/scripts/kconfig/tests/choice/allyes_expected_config
new file mode 100644
index 000000000000..e5a062a1157c
--- /dev/null
+++ b/scripts/kconfig/tests/choice/allyes_expected_config
@@ -0,0 +1,9 @@
+CONFIG_MODULES=y
+# CONFIG_BOOL_CHOICE0 is not set
+CONFIG_BOOL_CHOICE1=y
+# CONFIG_OPT_BOOL_CHOICE0 is not set
+CONFIG_OPT_BOOL_CHOICE1=y
+# CONFIG_TRI_CHOICE0 is not set
+CONFIG_TRI_CHOICE1=y
+# CONFIG_OPT_TRI_CHOICE0 is not set
+CONFIG_OPT_TRI_CHOICE1=y
diff --git a/scripts/kconfig/tests/choice/oldask0_expected_stdout b/scripts/kconfig/tests/choice/oldask0_expected_stdout
new file mode 100644
index 000000000000..b251bba9698b
--- /dev/null
+++ b/scripts/kconfig/tests/choice/oldask0_expected_stdout
@@ -0,0 +1,10 @@
+Enable loadable module support (MODULES) [Y/n/?] (NEW) 
+boolean choice
+  1. choice 0 (BOOL_CHOICE0) (NEW)
+> 2. choice 1 (BOOL_CHOICE1) (NEW)
+choice[1-2?]: 
+optional boolean choice [N/y/?] (NEW) 
+tristate choice [M/y/?] (NEW) 
+  choice 0 (TRI_CHOICE0) [N/m/?] (NEW) 
+  choice 1 (TRI_CHOICE1) [N/m/?] (NEW) 
+optional tristate choice [N/m/y/?] (NEW) 
diff --git a/scripts/kconfig/tests/choice/oldask1_config b/scripts/kconfig/tests/choice/oldask1_config
new file mode 100644
index 000000000000..b67bfe3c641f
--- /dev/null
+++ b/scripts/kconfig/tests/choice/oldask1_config
@@ -0,0 +1,2 @@
+# CONFIG_MODULES is not set
+CONFIG_OPT_BOOL_CHOICE0=y
diff --git a/scripts/kconfig/tests/choice/oldask1_expected_stdout b/scripts/kconfig/tests/choice/oldask1_expected_stdout
new file mode 100644
index 000000000000..c2125e9bf96a
--- /dev/null
+++ b/scripts/kconfig/tests/choice/oldask1_expected_stdout
@@ -0,0 +1,15 @@
+Enable loadable module support (MODULES) [N/y/?] 
+boolean choice
+  1. choice 0 (BOOL_CHOICE0) (NEW)
+> 2. choice 1 (BOOL_CHOICE1) (NEW)
+choice[1-2?]: 
+optional boolean choice [Y/n/?] (NEW) 
+optional boolean choice
+> 1. choice 0 (OPT_BOOL_CHOICE0)
+  2. choice 1 (OPT_BOOL_CHOICE1) (NEW)
+choice[1-2?]: 
+tristate choice
+  1. choice 0 (TRI_CHOICE0) (NEW)
+> 2. choice 1 (TRI_CHOICE1) (NEW)
+choice[1-2?]: 
+optional tristate choice [N/y/?] 
diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/Kconfig b/scripts/kconfig/tests/choice_value_with_m_dep/Kconfig
new file mode 100644
index 000000000000..11ac25c26040
--- /dev/null
+++ b/scripts/kconfig/tests/choice_value_with_m_dep/Kconfig
@@ -0,0 +1,19 @@
+config MODULES
+	def_bool y
+	option modules
+
+config DEP
+	tristate
+	default m
+
+choice
+	prompt "Tristate Choice"
+
+config CHOICE0
+	tristate "Choice 0"
+
+config CHOICE1
+	tristate "Choice 1"
+	depends on DEP
+
+endchoice
diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/__init__.py b/scripts/kconfig/tests/choice_value_with_m_dep/__init__.py
new file mode 100644
index 000000000000..f8d728c7b101
--- /dev/null
+++ b/scripts/kconfig/tests/choice_value_with_m_dep/__init__.py
@@ -0,0 +1,15 @@
+"""
+Hide tristate choice values with mod dependency in y choice.
+
+If tristate choice values depend on symbols set to 'm', they should be
+hidden when the choice containing them is changed from 'm' to 'y'
+(i.e. exclusive choice).
+
+Related Linux commit: fa64e5f6a35efd5e77d639125d973077ca506074
+"""
+
+
+def test(conf):
+    assert conf.oldaskconfig('config', 'y') == 0
+    assert conf.config_contains('expected_config')
+    assert conf.stdout_contains('expected_stdout')
diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/config b/scripts/kconfig/tests/choice_value_with_m_dep/config
new file mode 100644
index 000000000000..3a126b7a2546
--- /dev/null
+++ b/scripts/kconfig/tests/choice_value_with_m_dep/config
@@ -0,0 +1,2 @@
+CONFIG_CHOICE0=m
+CONFIG_CHOICE1=m
diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/expected_config b/scripts/kconfig/tests/choice_value_with_m_dep/expected_config
new file mode 100644
index 000000000000..4d07b449540e
--- /dev/null
+++ b/scripts/kconfig/tests/choice_value_with_m_dep/expected_config
@@ -0,0 +1,3 @@
+CONFIG_MODULES=y
+CONFIG_DEP=m
+CONFIG_CHOICE0=y
diff --git a/scripts/kconfig/tests/choice_value_with_m_dep/expected_stdout b/scripts/kconfig/tests/choice_value_with_m_dep/expected_stdout
new file mode 100644
index 000000000000..2b50ab65c86a
--- /dev/null
+++ b/scripts/kconfig/tests/choice_value_with_m_dep/expected_stdout
@@ -0,0 +1,4 @@
+Tristate Choice [M/y/?] y
+Tristate Choice
+> 1. Choice 0 (CHOICE0)
+choice[1]: 1
diff --git a/scripts/kconfig/tests/conftest.py b/scripts/kconfig/tests/conftest.py
new file mode 100644
index 000000000000..0345ef6e3273
--- /dev/null
+++ b/scripts/kconfig/tests/conftest.py
@@ -0,0 +1,291 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Copyright (C) 2018 Masahiro Yamada <yamada.masahiro@socionext.com>
+#
+
+"""
+Kconfig unit testing framework.
+
+This provides fixture functions commonly used from test files.
+"""
+
+import os
+import pytest
+import shutil
+import subprocess
+import tempfile
+
+CONF_PATH = os.path.abspath(os.path.join('scripts', 'kconfig', 'conf'))
+
+
+class Conf:
+    """Kconfig runner and result checker.
+
+    This class provides methods to run text-based interface of Kconfig
+    (scripts/kconfig/conf) and retrieve the resulted configuration,
+    stdout, and stderr.  It also provides methods to compare those
+    results with expectations.
+    """
+
+    def __init__(self, request):
+        """Create a new Conf instance.
+
+        request: object to introspect the requesting test module
+        """
+        # the directory of the test being run
+        self._test_dir = os.path.dirname(str(request.fspath))
+
+    # runners
+    def _run_conf(self, mode, dot_config=None, out_file='.config',
+                  interactive=False, in_keys=None, extra_env={}):
+        """Run text-based Kconfig executable and save the result.
+
+        mode: input mode option (--oldaskconfig, --defconfig=<file> etc.)
+        dot_config: .config file to use for configuration base
+        out_file: file name to contain the output config data
+        interactive: flag to specify the interactive mode
+        in_keys: key inputs for interactive modes
+        extra_env: additional environments
+        returncode: exit status of the Kconfig executable
+        """
+        command = [CONF_PATH, mode, 'Kconfig']
+
+        # Override 'srctree' environment to make the test as the top directory
+        extra_env['srctree'] = self._test_dir
+
+        # Run Kconfig in a temporary directory.
+        # This directory is automatically removed when done.
+        with tempfile.TemporaryDirectory() as temp_dir:
+
+            # if .config is given, copy it to the working directory
+            if dot_config:
+                shutil.copyfile(os.path.join(self._test_dir, dot_config),
+                                os.path.join(temp_dir, '.config'))
+
+            ps = subprocess.Popen(command,
+                                  stdin=subprocess.PIPE,
+                                  stdout=subprocess.PIPE,
+                                  stderr=subprocess.PIPE,
+                                  cwd=temp_dir,
+                                  env=dict(os.environ, **extra_env))
+
+            # If input key sequence is given, feed it to stdin.
+            if in_keys:
+                ps.stdin.write(in_keys.encode('utf-8'))
+
+            while ps.poll() is None:
+                # For interactive modes such as oldaskconfig, oldconfig,
+                # send 'Enter' key until the program finishes.
+                if interactive:
+                    ps.stdin.write(b'\n')
+
+            self.retcode = ps.returncode
+            self.stdout = ps.stdout.read().decode()
+            self.stderr = ps.stderr.read().decode()
+
+            # Retrieve the resulted config data only when .config is supposed
+            # to exist.  If the command fails, the .config does not exist.
+            # 'listnewconfig' does not produce .config in the first place.
+            if self.retcode == 0 and out_file:
+                with open(os.path.join(temp_dir, out_file)) as f:
+                    self.config = f.read()
+            else:
+                self.config = None
+
+        # Logging:
+        # Pytest captures the following information by default.  In failure
+        # of tests, the captured log will be displayed.  This will be useful to
+        # figure out what has happened.
+
+        print("[command]\n{}\n".format(' '.join(command)))
+
+        print("[retcode]\n{}\n".format(self.retcode))
+
+        print("[stdout]")
+        print(self.stdout)
+
+        print("[stderr]")
+        print(self.stderr)
+
+        if self.config is not None:
+            print("[output for '{}']".format(out_file))
+            print(self.config)
+
+        return self.retcode
+
+    def oldaskconfig(self, dot_config=None, in_keys=None):
+        """Run oldaskconfig.
+
+        dot_config: .config file to use for configuration base (optional)
+        in_key: key inputs (optional)
+        returncode: exit status of the Kconfig executable
+        """
+        return self._run_conf('--oldaskconfig', dot_config=dot_config,
+                              interactive=True, in_keys=in_keys)
+
+    def oldconfig(self, dot_config=None, in_keys=None):
+        """Run oldconfig.
+
+        dot_config: .config file to use for configuration base (optional)
+        in_key: key inputs (optional)
+        returncode: exit status of the Kconfig executable
+        """
+        return self._run_conf('--oldconfig', dot_config=dot_config,
+                              interactive=True, in_keys=in_keys)
+
+    def olddefconfig(self, dot_config=None):
+        """Run olddefconfig.
+
+        dot_config: .config file to use for configuration base (optional)
+        returncode: exit status of the Kconfig executable
+        """
+        return self._run_conf('--olddefconfig', dot_config=dot_config)
+
+    def defconfig(self, defconfig):
+        """Run defconfig.
+
+        defconfig: defconfig file for input
+        returncode: exit status of the Kconfig executable
+        """
+        defconfig_path = os.path.join(self._test_dir, defconfig)
+        return self._run_conf('--defconfig={}'.format(defconfig_path))
+
+    def _allconfig(self, mode, all_config):
+        if all_config:
+            all_config_path = os.path.join(self._test_dir, all_config)
+            extra_env = {'KCONFIG_ALLCONFIG': all_config_path}
+        else:
+            extra_env = {}
+
+        return self._run_conf('--{}config'.format(mode), extra_env=extra_env)
+
+    def allyesconfig(self, all_config=None):
+        """Run allyesconfig.
+
+        all_config: fragment config file for KCONFIG_ALLCONFIG (optional)
+        returncode: exit status of the Kconfig executable
+        """
+        return self._allconfig('allyes', all_config)
+
+    def allmodconfig(self, all_config=None):
+        """Run allmodconfig.
+
+        all_config: fragment config file for KCONFIG_ALLCONFIG (optional)
+        returncode: exit status of the Kconfig executable
+        """
+        return self._allconfig('allmod', all_config)
+
+    def allnoconfig(self, all_config=None):
+        """Run allnoconfig.
+
+        all_config: fragment config file for KCONFIG_ALLCONFIG (optional)
+        returncode: exit status of the Kconfig executable
+        """
+        return self._allconfig('allno', all_config)
+
+    def alldefconfig(self, all_config=None):
+        """Run alldefconfig.
+
+        all_config: fragment config file for KCONFIG_ALLCONFIG (optional)
+        returncode: exit status of the Kconfig executable
+        """
+        return self._allconfig('alldef', all_config)
+
+    def randconfig(self, all_config=None):
+        """Run randconfig.
+
+        all_config: fragment config file for KCONFIG_ALLCONFIG (optional)
+        returncode: exit status of the Kconfig executable
+        """
+        return self._allconfig('rand', all_config)
+
+    def savedefconfig(self, dot_config):
+        """Run savedefconfig.
+
+        dot_config: .config file for input
+        returncode: exit status of the Kconfig executable
+        """
+        return self._run_conf('--savedefconfig', out_file='defconfig')
+
+    def listnewconfig(self, dot_config=None):
+        """Run listnewconfig.
+
+        dot_config: .config file to use for configuration base (optional)
+        returncode: exit status of the Kconfig executable
+        """
+        return self._run_conf('--listnewconfig', dot_config=dot_config,
+                              out_file=None)
+
+    # checkers
+    def _read_and_compare(self, compare, expected):
+        """Compare the result with expectation.
+
+        compare: function to compare the result with expectation
+        expected: file that contains the expected data
+        """
+        with open(os.path.join(self._test_dir, expected)) as f:
+            expected_data = f.read()
+        return compare(self, expected_data)
+
+    def _contains(self, attr, expected):
+        return self._read_and_compare(
+                                    lambda s, e: getattr(s, attr).find(e) >= 0,
+                                    expected)
+
+    def _matches(self, attr, expected):
+        return self._read_and_compare(lambda s, e: getattr(s, attr) == e,
+                                      expected)
+
+    def config_contains(self, expected):
+        """Check if resulted configuration contains expected data.
+
+        expected: file that contains the expected data
+        returncode: True if result contains the expected data, False otherwise
+        """
+        return self._contains('config', expected)
+
+    def config_matches(self, expected):
+        """Check if resulted configuration exactly matches expected data.
+
+        expected: file that contains the expected data
+        returncode: True if result matches the expected data, False otherwise
+        """
+        return self._matches('config', expected)
+
+    def stdout_contains(self, expected):
+        """Check if resulted stdout contains expected data.
+
+        expected: file that contains the expected data
+        returncode: True if result contains the expected data, False otherwise
+        """
+        return self._contains('stdout', expected)
+
+    def stdout_matches(self, expected):
+        """Check if resulted stdout exactly matches expected data.
+
+        expected: file that contains the expected data
+        returncode: True if result matches the expected data, False otherwise
+        """
+        return self._matches('stdout', expected)
+
+    def stderr_contains(self, expected):
+        """Check if resulted stderr contains expected data.
+
+        expected: file that contains the expected data
+        returncode: True if result contains the expected data, False otherwise
+        """
+        return self._contains('stderr', expected)
+
+    def stderr_matches(self, expected):
+        """Check if resulted stderr exactly matches expected data.
+
+        expected: file that contains the expected data
+        returncode: True if result matches the expected data, False otherwise
+        """
+        return self._matches('stderr', expected)
+
+
+ at pytest.fixture(scope="module")
+def conf(request):
+    """Create a Conf instance and provide it to test functions."""
+    return Conf(request)
diff --git a/scripts/kconfig/tests/err_recursive_inc/Kconfig b/scripts/kconfig/tests/err_recursive_inc/Kconfig
new file mode 100644
index 000000000000..0e4c8750ab65
--- /dev/null
+++ b/scripts/kconfig/tests/err_recursive_inc/Kconfig
@@ -0,0 +1 @@
+source "Kconfig.inc1"
diff --git a/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc1 b/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc1
new file mode 100644
index 000000000000..00e408d653fc
--- /dev/null
+++ b/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc1
@@ -0,0 +1,4 @@
+
+
+
+source "Kconfig.inc2"
diff --git a/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc2 b/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc2
new file mode 100644
index 000000000000..349ea2db15dc
--- /dev/null
+++ b/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc2
@@ -0,0 +1,3 @@
+
+
+source "Kconfig.inc3"
diff --git a/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc3 b/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc3
new file mode 100644
index 000000000000..0e4c8750ab65
--- /dev/null
+++ b/scripts/kconfig/tests/err_recursive_inc/Kconfig.inc3
@@ -0,0 +1 @@
+source "Kconfig.inc1"
diff --git a/scripts/kconfig/tests/err_recursive_inc/__init__.py b/scripts/kconfig/tests/err_recursive_inc/__init__.py
new file mode 100644
index 000000000000..0e4c839c54aa
--- /dev/null
+++ b/scripts/kconfig/tests/err_recursive_inc/__init__.py
@@ -0,0 +1,10 @@
+"""
+Detect recursive inclusion error.
+
+If recursive inclusion is detected, it should fail with error messages.
+"""
+
+
+def test(conf):
+    assert conf.oldaskconfig() != 0
+    assert conf.stderr_contains('expected_stderr')
diff --git a/scripts/kconfig/tests/err_recursive_inc/expected_stderr b/scripts/kconfig/tests/err_recursive_inc/expected_stderr
new file mode 100644
index 000000000000..6b582eee2176
--- /dev/null
+++ b/scripts/kconfig/tests/err_recursive_inc/expected_stderr
@@ -0,0 +1,6 @@
+Recursive inclusion detected.
+Inclusion path:
+  current file : Kconfig.inc1
+  included from: Kconfig.inc3:1
+  included from: Kconfig.inc2:3
+  included from: Kconfig.inc1:4
diff --git a/scripts/kconfig/tests/inter_choice/Kconfig b/scripts/kconfig/tests/inter_choice/Kconfig
new file mode 100644
index 000000000000..e44449f075df
--- /dev/null
+++ b/scripts/kconfig/tests/inter_choice/Kconfig
@@ -0,0 +1,23 @@
+config MODULES
+	def_bool y
+	option modules
+
+choice
+	prompt "Choice"
+
+config CHOICE_VAL0
+	tristate "Choice 0"
+
+config CHOIVE_VAL1
+	tristate "Choice 1"
+
+endchoice
+
+choice
+	prompt "Another choice"
+	depends on CHOICE_VAL0
+
+config DUMMY
+	bool "dummy"
+
+endchoice
diff --git a/scripts/kconfig/tests/inter_choice/__init__.py b/scripts/kconfig/tests/inter_choice/__init__.py
new file mode 100644
index 000000000000..5c7fc365ed40
--- /dev/null
+++ b/scripts/kconfig/tests/inter_choice/__init__.py
@@ -0,0 +1,14 @@
+"""
+Do not affect user-assigned choice value by another choice.
+
+Handling of state flags for choices is complecated.  In old days,
+the defconfig result of a choice could be affected by another choice
+if those choices interact by 'depends on', 'select', etc.
+
+Related Linux commit: fbe98bb9ed3dae23e320c6b113e35f129538d14a
+"""
+
+
+def test(conf):
+    assert conf.defconfig('defconfig') == 0
+    assert conf.config_contains('expected_config')
diff --git a/scripts/kconfig/tests/inter_choice/defconfig b/scripts/kconfig/tests/inter_choice/defconfig
new file mode 100644
index 000000000000..162c4148e2a5
--- /dev/null
+++ b/scripts/kconfig/tests/inter_choice/defconfig
@@ -0,0 +1 @@
+CONFIG_CHOICE_VAL0=y
diff --git a/scripts/kconfig/tests/inter_choice/expected_config b/scripts/kconfig/tests/inter_choice/expected_config
new file mode 100644
index 000000000000..5dceefb054e3
--- /dev/null
+++ b/scripts/kconfig/tests/inter_choice/expected_config
@@ -0,0 +1,4 @@
+CONFIG_MODULES=y
+CONFIG_CHOICE_VAL0=y
+# CONFIG_CHOIVE_VAL1 is not set
+CONFIG_DUMMY=y
diff --git a/scripts/kconfig/tests/new_choice_with_dep/Kconfig b/scripts/kconfig/tests/new_choice_with_dep/Kconfig
new file mode 100644
index 000000000000..53ef1b86e7bf
--- /dev/null
+++ b/scripts/kconfig/tests/new_choice_with_dep/Kconfig
@@ -0,0 +1,37 @@
+config A
+	bool "A"
+	help
+	  This is a new symbol.
+
+choice
+	prompt "Choice ?"
+	depends on A
+	help
+	  "depends on A" has been newly added.
+
+config CHOICE_B
+	bool "Choice B"
+
+config CHOICE_C
+	bool "Choice C"
+	help
+	  This is a new symbol, so should be asked.
+
+endchoice
+
+choice
+	prompt "Choice2 ?"
+
+config CHOICE_D
+	bool "Choice D"
+
+config CHOICE_E
+	bool "Choice E"
+
+config CHOICE_F
+	bool "Choice F"
+	depends on A
+	help
+	  This is a new symbol, so should be asked.
+
+endchoice
diff --git a/scripts/kconfig/tests/new_choice_with_dep/__init__.py b/scripts/kconfig/tests/new_choice_with_dep/__init__.py
new file mode 100644
index 000000000000..f0e0ead0f32f
--- /dev/null
+++ b/scripts/kconfig/tests/new_choice_with_dep/__init__.py
@@ -0,0 +1,14 @@
+"""
+Ask new choice values when they become visible.
+
+If new choice values are added with new dependency, and they become
+visible during user configuration, oldconfig should recognize them
+as (NEW), and ask the user for choice.
+
+Related Linux commit: 5d09598d488f081e3be23f885ed65cbbe2d073b5
+"""
+
+
+def test(conf):
+    assert conf.oldconfig('config', 'y') == 0
+    assert conf.stdout_contains('expected_stdout')
diff --git a/scripts/kconfig/tests/new_choice_with_dep/config b/scripts/kconfig/tests/new_choice_with_dep/config
new file mode 100644
index 000000000000..47ef95d567fd
--- /dev/null
+++ b/scripts/kconfig/tests/new_choice_with_dep/config
@@ -0,0 +1,3 @@
+CONFIG_CHOICE_B=y
+# CONFIG_CHOICE_D is not set
+CONFIG_CHOICE_E=y
diff --git a/scripts/kconfig/tests/new_choice_with_dep/expected_stdout b/scripts/kconfig/tests/new_choice_with_dep/expected_stdout
new file mode 100644
index 000000000000..74dc0bcb22bc
--- /dev/null
+++ b/scripts/kconfig/tests/new_choice_with_dep/expected_stdout
@@ -0,0 +1,10 @@
+A (A) [N/y/?] (NEW) y
+  Choice ?
+  > 1. Choice B (CHOICE_B)
+    2. Choice C (CHOICE_C) (NEW)
+  choice[1-2?]: 
+Choice2 ?
+  1. Choice D (CHOICE_D)
+> 2. Choice E (CHOICE_E)
+  3. Choice F (CHOICE_F) (NEW)
+choice[1-3?]: 
diff --git a/scripts/kconfig/tests/no_write_if_dep_unmet/Kconfig b/scripts/kconfig/tests/no_write_if_dep_unmet/Kconfig
new file mode 100644
index 000000000000..c00b8fe54f45
--- /dev/null
+++ b/scripts/kconfig/tests/no_write_if_dep_unmet/Kconfig
@@ -0,0 +1,14 @@
+config A
+	bool "A"
+
+choice
+	prompt "Choice ?"
+	depends on A
+
+config CHOICE_B
+	bool "Choice B"
+
+config CHOICE_C
+	bool "Choice C"
+
+endchoice
diff --git a/scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py b/scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py
new file mode 100644
index 000000000000..207261b0fe00
--- /dev/null
+++ b/scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py
@@ -0,0 +1,19 @@
+"""
+Do not write choice values to .config if the dependency is unmet.
+
+"# CONFIG_... is not set" should not be written into the .config file
+for symbols with unmet dependency.
+
+This was not working correctly for choice values because choice needs
+a bit different symbol computation.
+
+This checks that no unneeded "# COFIG_... is not set" is contained in
+the .config file.
+
+Related Linux commit: cb67ab2cd2b8abd9650292c986c79901e3073a59
+"""
+
+
+def test(conf):
+    assert conf.oldaskconfig('config', 'n') == 0
+    assert conf.config_matches('expected_config')
diff --git a/scripts/kconfig/tests/no_write_if_dep_unmet/config b/scripts/kconfig/tests/no_write_if_dep_unmet/config
new file mode 100644
index 000000000000..abd280e2f616
--- /dev/null
+++ b/scripts/kconfig/tests/no_write_if_dep_unmet/config
@@ -0,0 +1 @@
+CONFIG_A=y
diff --git a/scripts/kconfig/tests/no_write_if_dep_unmet/expected_config b/scripts/kconfig/tests/no_write_if_dep_unmet/expected_config
new file mode 100644
index 000000000000..0d15e41da475
--- /dev/null
+++ b/scripts/kconfig/tests/no_write_if_dep_unmet/expected_config
@@ -0,0 +1,5 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux Kernel Configuration
+#
+# CONFIG_A is not set
diff --git a/scripts/kconfig/tests/pytest.ini b/scripts/kconfig/tests/pytest.ini
new file mode 100644
index 000000000000..85d7ce8e448b
--- /dev/null
+++ b/scripts/kconfig/tests/pytest.ini
@@ -0,0 +1,7 @@
+[pytest]
+addopts = --verbose
+
+# Pytest requires that test files have unique names, because pytest imports
+# them as top-level modules.  It is silly to prefix or suffix a test file with
+# the directory name that contains it.  Use __init__.py for all test files.
+python_files = __init__.py
diff --git a/scripts/kconfig/tests/rand_nested_choice/Kconfig b/scripts/kconfig/tests/rand_nested_choice/Kconfig
new file mode 100644
index 000000000000..c591d512929f
--- /dev/null
+++ b/scripts/kconfig/tests/rand_nested_choice/Kconfig
@@ -0,0 +1,33 @@
+choice
+	prompt "choice"
+
+config A
+	bool "A"
+
+config B
+	bool "B"
+
+if B
+choice
+	prompt "sub choice"
+
+config C
+	bool "C"
+
+config D
+	bool "D"
+
+if D
+choice
+	prompt "subsub choice"
+
+config E
+	bool "E"
+
+endchoice
+endif # D
+
+endchoice
+endif # B
+
+endchoice
diff --git a/scripts/kconfig/tests/rand_nested_choice/__init__.py b/scripts/kconfig/tests/rand_nested_choice/__init__.py
new file mode 100644
index 000000000000..e729a4e85218
--- /dev/null
+++ b/scripts/kconfig/tests/rand_nested_choice/__init__.py
@@ -0,0 +1,16 @@
+"""
+Set random values recursively in nested choices.
+
+Kconfig can create a choice-in-choice structure by using 'if' statement.
+randconfig should correctly set random choice values.
+
+Related Linux commit: 3b9a19e08960e5cdad5253998637653e592a3c29
+"""
+
+
+def test(conf):
+    for i in range(20):
+        assert conf.randconfig() == 0
+        assert (conf.config_contains('expected_stdout0') or
+                conf.config_contains('expected_stdout1') or
+                conf.config_contains('expected_stdout2'))
diff --git a/scripts/kconfig/tests/rand_nested_choice/expected_stdout0 b/scripts/kconfig/tests/rand_nested_choice/expected_stdout0
new file mode 100644
index 000000000000..05450f3d4eb5
--- /dev/null
+++ b/scripts/kconfig/tests/rand_nested_choice/expected_stdout0
@@ -0,0 +1,2 @@
+CONFIG_A=y
+# CONFIG_B is not set
diff --git a/scripts/kconfig/tests/rand_nested_choice/expected_stdout1 b/scripts/kconfig/tests/rand_nested_choice/expected_stdout1
new file mode 100644
index 000000000000..37ab29584157
--- /dev/null
+++ b/scripts/kconfig/tests/rand_nested_choice/expected_stdout1
@@ -0,0 +1,4 @@
+# CONFIG_A is not set
+CONFIG_B=y
+CONFIG_C=y
+# CONFIG_D is not set
diff --git a/scripts/kconfig/tests/rand_nested_choice/expected_stdout2 b/scripts/kconfig/tests/rand_nested_choice/expected_stdout2
new file mode 100644
index 000000000000..849ff47e9848
--- /dev/null
+++ b/scripts/kconfig/tests/rand_nested_choice/expected_stdout2
@@ -0,0 +1,5 @@
+# CONFIG_A is not set
+CONFIG_B=y
+# CONFIG_C is not set
+CONFIG_D=y
+CONFIG_E=y
diff --git a/scripts/kconfig/tests/warn_recursive_dep/Kconfig b/scripts/kconfig/tests/warn_recursive_dep/Kconfig
new file mode 100644
index 000000000000..a65bfcb7137e
--- /dev/null
+++ b/scripts/kconfig/tests/warn_recursive_dep/Kconfig
@@ -0,0 +1,62 @@
+# depends on itself
+
+config A
+	bool "A"
+	depends on A
+
+# select itself
+
+config B
+	bool
+	select B
+
+# depends on each other
+
+config C1
+	bool "C1"
+	depends on C2
+
+config C2
+	bool "C2"
+	depends on C1
+
+# depends on and select
+
+config D1
+	bool "D1"
+	depends on D2
+	select D2
+
+config D2
+	bool
+
+# depends on and imply
+# This is not recursive dependency
+
+config E1
+	bool "E1"
+	depends on E2
+	imply E2
+
+config E2
+	bool "E2"
+
+# property
+
+config F1
+	bool "F1"
+	default F2
+
+config F2
+	bool "F2"
+	depends on F1
+
+# menu
+
+menu "menu depending on its content"
+	depends on G
+
+config G
+	bool "G"
+
+endmenu
diff --git a/scripts/kconfig/tests/warn_recursive_dep/__init__.py b/scripts/kconfig/tests/warn_recursive_dep/__init__.py
new file mode 100644
index 000000000000..adb21951ba41
--- /dev/null
+++ b/scripts/kconfig/tests/warn_recursive_dep/__init__.py
@@ -0,0 +1,9 @@
+"""
+Warn recursive inclusion.
+
+Recursive dependency should be warned.
+"""
+
+def test(conf):
+    assert conf.oldaskconfig() == 0
+    assert conf.stderr_contains('expected_stderr')
diff --git a/scripts/kconfig/tests/warn_recursive_dep/expected_stderr b/scripts/kconfig/tests/warn_recursive_dep/expected_stderr
new file mode 100644
index 000000000000..3de807dd9cb2
--- /dev/null
+++ b/scripts/kconfig/tests/warn_recursive_dep/expected_stderr
@@ -0,0 +1,30 @@
+Kconfig:9:error: recursive dependency detected!
+Kconfig:9:	symbol B is selected by B
+For a resolution refer to Documentation/kbuild/kconfig-language.txt
+subsection "Kconfig recursive dependency limitations"
+
+Kconfig:3:error: recursive dependency detected!
+Kconfig:3:	symbol A depends on A
+For a resolution refer to Documentation/kbuild/kconfig-language.txt
+subsection "Kconfig recursive dependency limitations"
+
+Kconfig:15:error: recursive dependency detected!
+Kconfig:15:	symbol C1 depends on C2
+Kconfig:19:	symbol C2 depends on C1
+For a resolution refer to Documentation/kbuild/kconfig-language.txt
+subsection "Kconfig recursive dependency limitations"
+
+Kconfig:30:error: recursive dependency detected!
+Kconfig:30:	symbol D2 is selected by D1
+Kconfig:25:	symbol D1 depends on D2
+For a resolution refer to Documentation/kbuild/kconfig-language.txt
+subsection "Kconfig recursive dependency limitations"
+
+Kconfig:59:error: recursive dependency detected!
+Kconfig:59:	symbol G depends on G
+For a resolution refer to Documentation/kbuild/kconfig-language.txt
+subsection "Kconfig recursive dependency limitations"
+
+Kconfig:50:error: recursive dependency detected!
+Kconfig:50:	symbol F2 depends on F1
+Kconfig:48:	symbol F1 default value contains F2
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index 0e76042473cc..c6f6e21b809f 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -14,11 +14,11 @@
 struct file *file_lookup(const char *name)
 {
 	struct file *file;
-	const char *file_name = sym_expand_string_value(name);
+	char *file_name = sym_expand_string_value(name);
 
 	for (file = file_list; file; file = file->next) {
 		if (!strcmp(name, file->name)) {
-			free((void *)file_name);
+			free(file_name);
 			return file;
 		}
 	}
@@ -104,7 +104,7 @@ void str_append(struct gstr *gs, const char *s)
 	if (s) {
 		l = strlen(gs->s) + strlen(s) + 1;
 		if (l > gs->len) {
-			gs->s   = realloc(gs->s, l);
+			gs->s = xrealloc(gs->s, l);
 			gs->len = l;
 		}
 		strcat(gs->s, s);
@@ -145,3 +145,23 @@ void *xcalloc(size_t nmemb, size_t size)
 	fprintf(stderr, "Out of memory.\n");
 	exit(1);
 }
+
+void *xrealloc(void *p, size_t size)
+{
+	p = realloc(p, size);
+	if (p)
+		return p;
+	fprintf(stderr, "Out of memory.\n");
+	exit(1);
+}
+
+char *xstrdup(const char *s)
+{
+	char *p;
+
+	p = strdup(s);
+	if (p)
+		return p;
+	fprintf(stderr, "Out of memory.\n");
+	exit(1);
+}
diff --git a/scripts/kconfig/zconf.gperf b/scripts/kconfig/zconf.gperf
deleted file mode 100644
index ead02edec936..000000000000
--- a/scripts/kconfig/zconf.gperf
+++ /dev/null
@@ -1,50 +0,0 @@
-%language=ANSI-C
-%define hash-function-name kconf_id_hash
-%define lookup-function-name kconf_id_lookup
-%define string-pool-name kconf_id_strings
-%compare-strncmp
-%enum
-%pic
-%struct-type
-
-struct kconf_id;
-
-static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
-
-%%
-mainmenu,	T_MAINMENU,	TF_COMMAND
-menu,		T_MENU,		TF_COMMAND
-endmenu,	T_ENDMENU,	TF_COMMAND
-source,		T_SOURCE,	TF_COMMAND
-choice,		T_CHOICE,	TF_COMMAND
-endchoice,	T_ENDCHOICE,	TF_COMMAND
-comment,	T_COMMENT,	TF_COMMAND
-config,		T_CONFIG,	TF_COMMAND
-menuconfig,	T_MENUCONFIG,	TF_COMMAND
-help,		T_HELP,		TF_COMMAND
----help---,	T_HELP,		TF_COMMAND
-if,		T_IF,		TF_COMMAND|TF_PARAM
-endif,		T_ENDIF,	TF_COMMAND
-depends,	T_DEPENDS,	TF_COMMAND
-optional,	T_OPTIONAL,	TF_COMMAND
-default,	T_DEFAULT,	TF_COMMAND, S_UNKNOWN
-prompt,		T_PROMPT,	TF_COMMAND
-tristate,	T_TYPE,		TF_COMMAND, S_TRISTATE
-def_tristate,	T_DEFAULT,	TF_COMMAND, S_TRISTATE
-bool,		T_TYPE,		TF_COMMAND, S_BOOLEAN
-boolean,	T_TYPE,		TF_COMMAND, S_BOOLEAN
-def_bool,	T_DEFAULT,	TF_COMMAND, S_BOOLEAN
-int,		T_TYPE,		TF_COMMAND, S_INT
-hex,		T_TYPE,		TF_COMMAND, S_HEX
-string,		T_TYPE,		TF_COMMAND, S_STRING
-select,		T_SELECT,	TF_COMMAND
-imply,		T_IMPLY,	TF_COMMAND
-range,		T_RANGE,	TF_COMMAND
-visible,	T_VISIBLE,	TF_COMMAND
-option,		T_OPTION,	TF_COMMAND
-on,		T_ON,		TF_PARAM
-modules,	T_OPT_MODULES,	TF_OPTION
-defconfig_list,	T_OPT_DEFCONFIG_LIST,TF_OPTION
-env,		T_OPT_ENV,	TF_OPTION
-allnoconfig_y,	T_OPT_ALLNOCONFIG_Y,TF_OPTION
-%%
diff --git a/scripts/kconfig/zconf.hash.c_shipped b/scripts/kconfig/zconf.hash.c_shipped
deleted file mode 100644
index d51b15de074a..000000000000
--- a/scripts/kconfig/zconf.hash.c_shipped
+++ /dev/null
@@ -1,297 +0,0 @@
-/* ANSI-C code produced by gperf version 3.0.4 */
-/* Command-line: gperf -t --output-file scripts/kconfig/zconf.hash.c_shipped -a -C -E -g -k '1,3,$' -p -t scripts/kconfig/zconf.gperf  */
-
-#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
-      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
-      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
-      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
-      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
-      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
-      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
-      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
-      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
-      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
-      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
-      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
-      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
-      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
-      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
-      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
-      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
-      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
-      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
-      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
-      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
-      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
-      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
-/* The character set is not based on ISO-646.  */
-#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
-#endif
-
-#line 10 "scripts/kconfig/zconf.gperf"
-struct kconf_id;
-
-static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
-/* maximum key range = 71, duplicates = 0 */
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static unsigned int
-kconf_id_hash (register const char *str, register unsigned int len)
-{
-  static const unsigned char asso_values[] =
-    {
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73,  0, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 10, 25, 25,
-       0,  0,  0,  5,  0,  0, 73, 73,  5,  0,
-      10,  5, 45, 73, 20, 20,  0, 15, 15, 73,
-      20,  0, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
-      73, 73, 73, 73, 73, 73
-    };
-  register int hval = len;
-
-  switch (hval)
-    {
-      default:
-        hval += asso_values[(unsigned char)str[2]];
-      /*FALLTHROUGH*/
-      case 2:
-      case 1:
-        hval += asso_values[(unsigned char)str[0]];
-        break;
-    }
-  return hval + asso_values[(unsigned char)str[len - 1]];
-}
-
-struct kconf_id_strings_t
-  {
-    char kconf_id_strings_str2[sizeof("if")];
-    char kconf_id_strings_str3[sizeof("int")];
-    char kconf_id_strings_str5[sizeof("endif")];
-    char kconf_id_strings_str7[sizeof("default")];
-    char kconf_id_strings_str8[sizeof("tristate")];
-    char kconf_id_strings_str9[sizeof("endchoice")];
-    char kconf_id_strings_str10[sizeof("---help---")];
-    char kconf_id_strings_str12[sizeof("def_tristate")];
-    char kconf_id_strings_str13[sizeof("def_bool")];
-    char kconf_id_strings_str14[sizeof("defconfig_list")];
-    char kconf_id_strings_str17[sizeof("on")];
-    char kconf_id_strings_str18[sizeof("optional")];
-    char kconf_id_strings_str21[sizeof("option")];
-    char kconf_id_strings_str22[sizeof("endmenu")];
-    char kconf_id_strings_str23[sizeof("mainmenu")];
-    char kconf_id_strings_str25[sizeof("menuconfig")];
-    char kconf_id_strings_str27[sizeof("modules")];
-    char kconf_id_strings_str28[sizeof("allnoconfig_y")];
-    char kconf_id_strings_str29[sizeof("menu")];
-    char kconf_id_strings_str31[sizeof("select")];
-    char kconf_id_strings_str32[sizeof("comment")];
-    char kconf_id_strings_str33[sizeof("env")];
-    char kconf_id_strings_str35[sizeof("range")];
-    char kconf_id_strings_str36[sizeof("choice")];
-    char kconf_id_strings_str39[sizeof("bool")];
-    char kconf_id_strings_str41[sizeof("source")];
-    char kconf_id_strings_str42[sizeof("visible")];
-    char kconf_id_strings_str43[sizeof("hex")];
-    char kconf_id_strings_str46[sizeof("config")];
-    char kconf_id_strings_str47[sizeof("boolean")];
-    char kconf_id_strings_str50[sizeof("imply")];
-    char kconf_id_strings_str51[sizeof("string")];
-    char kconf_id_strings_str54[sizeof("help")];
-    char kconf_id_strings_str56[sizeof("prompt")];
-    char kconf_id_strings_str72[sizeof("depends")];
-  };
-static const struct kconf_id_strings_t kconf_id_strings_contents =
-  {
-    "if",
-    "int",
-    "endif",
-    "default",
-    "tristate",
-    "endchoice",
-    "---help---",
-    "def_tristate",
-    "def_bool",
-    "defconfig_list",
-    "on",
-    "optional",
-    "option",
-    "endmenu",
-    "mainmenu",
-    "menuconfig",
-    "modules",
-    "allnoconfig_y",
-    "menu",
-    "select",
-    "comment",
-    "env",
-    "range",
-    "choice",
-    "bool",
-    "source",
-    "visible",
-    "hex",
-    "config",
-    "boolean",
-    "imply",
-    "string",
-    "help",
-    "prompt",
-    "depends"
-  };
-#define kconf_id_strings ((const char *) &kconf_id_strings_contents)
-#ifdef __GNUC__
-__inline
-#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
-__attribute__ ((__gnu_inline__))
-#endif
-#endif
-const struct kconf_id *
-kconf_id_lookup (register const char *str, register unsigned int len)
-{
-  enum
-    {
-      TOTAL_KEYWORDS = 35,
-      MIN_WORD_LENGTH = 2,
-      MAX_WORD_LENGTH = 14,
-      MIN_HASH_VALUE = 2,
-      MAX_HASH_VALUE = 72
-    };
-
-  static const struct kconf_id wordlist[] =
-    {
-      {-1}, {-1},
-#line 26 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str2,		T_IF,		TF_COMMAND|TF_PARAM},
-#line 37 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str3,		T_TYPE,		TF_COMMAND, S_INT},
-      {-1},
-#line 27 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str5,		T_ENDIF,	TF_COMMAND},
-      {-1},
-#line 30 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str7,	T_DEFAULT,	TF_COMMAND, S_UNKNOWN},
-#line 32 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str8,	T_TYPE,		TF_COMMAND, S_TRISTATE},
-#line 20 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str9,	T_ENDCHOICE,	TF_COMMAND},
-#line 25 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str10,	T_HELP,		TF_COMMAND},
-      {-1},
-#line 33 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12,	T_DEFAULT,	TF_COMMAND, S_TRISTATE},
-#line 36 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13,	T_DEFAULT,	TF_COMMAND, S_BOOLEAN},
-#line 47 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14,	T_OPT_DEFCONFIG_LIST,TF_OPTION},
-      {-1}, {-1},
-#line 45 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17,		T_ON,		TF_PARAM},
-#line 29 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18,	T_OPTIONAL,	TF_COMMAND},
-      {-1}, {-1},
-#line 44 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21,		T_OPTION,	TF_COMMAND},
-#line 17 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22,	T_ENDMENU,	TF_COMMAND},
-#line 15 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23,	T_MAINMENU,	TF_COMMAND},
-      {-1},
-#line 23 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str25,	T_MENUCONFIG,	TF_COMMAND},
-      {-1},
-#line 46 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27,	T_OPT_MODULES,	TF_OPTION},
-#line 49 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28,	T_OPT_ALLNOCONFIG_Y,TF_OPTION},
-#line 16 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29,		T_MENU,		TF_COMMAND},
-      {-1},
-#line 40 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31,		T_SELECT,	TF_COMMAND},
-#line 21 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32,	T_COMMENT,	TF_COMMAND},
-#line 48 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33,		T_OPT_ENV,	TF_OPTION},
-      {-1},
-#line 42 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35,		T_RANGE,	TF_COMMAND},
-#line 19 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36,		T_CHOICE,	TF_COMMAND},
-      {-1}, {-1},
-#line 34 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str39,		T_TYPE,		TF_COMMAND, S_BOOLEAN},
-      {-1},
-#line 18 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41,		T_SOURCE,	TF_COMMAND},
-#line 43 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str42,	T_VISIBLE,	TF_COMMAND},
-#line 38 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str43,		T_TYPE,		TF_COMMAND, S_HEX},
-      {-1}, {-1},
-#line 22 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46,		T_CONFIG,	TF_COMMAND},
-#line 35 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str47,	T_TYPE,		TF_COMMAND, S_BOOLEAN},
-      {-1}, {-1},
-#line 41 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str50,		T_IMPLY,	TF_COMMAND},
-#line 39 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str51,		T_TYPE,		TF_COMMAND, S_STRING},
-      {-1}, {-1},
-#line 24 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str54,		T_HELP,		TF_COMMAND},
-      {-1},
-#line 31 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str56,		T_PROMPT,	TF_COMMAND},
-      {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-      {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
-#line 28 "scripts/kconfig/zconf.gperf"
-      {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str72,	T_DEPENDS,	TF_COMMAND}
-    };
-
-  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
-    {
-      register int key = kconf_id_hash (str, len);
-
-      if (key <= MAX_HASH_VALUE && key >= 0)
-        {
-          register int o = wordlist[key].name;
-          if (o >= 0)
-            {
-              register const char *s = o + kconf_id_strings;
-
-              if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
-                return &wordlist[key];
-            }
-        }
-    }
-  return 0;
-}
-#line 50 "scripts/kconfig/zconf.gperf"
-
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index c410d257da06..045093d827e1 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -1,5 +1,5 @@
 %option nostdinit noyywrap never-interactive full ecs
-%option 8bit nodefault perf-report perf-report
+%option 8bit nodefault yylineno
 %option noinput
 %x COMMAND HELP STRING PARAM
 %{
@@ -52,7 +52,7 @@ static void append_string(const char *str, int size)
 	if (new_size > text_asize) {
 		new_size += START_STRSIZE - 1;
 		new_size &= -START_STRSIZE;
-		text = realloc(text, new_size);
+		text = xrealloc(text, new_size);
 		text_asize = new_size;
 	}
 	memcpy(text + text_size, str, size);
@@ -83,7 +83,6 @@ n	[A-Za-z0-9_-]
 
 [ \t]*#.*\n	|
 [ \t]*\n	{
-	current_file->lineno++;
 	return T_EOL;
 }
 [ \t]*#.*
@@ -104,19 +103,18 @@ n	[A-Za-z0-9_-]
 		const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
 		BEGIN(PARAM);
 		current_pos.file = current_file;
-		current_pos.lineno = current_file->lineno;
+		current_pos.lineno = yylineno;
 		if (id && id->flags & TF_COMMAND) {
-			zconflval.id = id;
+			yylval.id = id;
 			return id->token;
 		}
 		alloc_string(yytext, yyleng);
-		zconflval.string = text;
+		yylval.string = text;
 		return T_WORD;
 	}
 	.	warn_ignored_character(*yytext);
 	\n	{
 		BEGIN(INITIAL);
-		current_file->lineno++;
 		return T_EOL;
 	}
 }
@@ -138,19 +136,19 @@ n	[A-Za-z0-9_-]
 		new_string();
 		BEGIN(STRING);
 	}
-	\n	BEGIN(INITIAL); current_file->lineno++; return T_EOL;
+	\n	BEGIN(INITIAL); return T_EOL;
 	({n}|[/.])+	{
 		const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
 		if (id && id->flags & TF_PARAM) {
-			zconflval.id = id;
+			yylval.id = id;
 			return id->token;
 		}
 		alloc_string(yytext, yyleng);
-		zconflval.string = text;
+		yylval.string = text;
 		return T_WORD;
 	}
 	#.*	/* comment */
-	\\\n	current_file->lineno++;
+	\\\n	;
 	[[:blank:]]+
 	.	warn_ignored_character(*yytext);
 	<<EOF>> {
@@ -161,7 +159,7 @@ n	[A-Za-z0-9_-]
 <STRING>{
 	[^'"\\\n]+/\n	{
 		append_string(yytext, yyleng);
-		zconflval.string = text;
+		yylval.string = text;
 		return T_WORD_QUOTE;
 	}
 	[^'"\\\n]+	{
@@ -169,7 +167,7 @@ n	[A-Za-z0-9_-]
 	}
 	\\.?/\n	{
 		append_string(yytext + 1, yyleng - 1);
-		zconflval.string = text;
+		yylval.string = text;
 		return T_WORD_QUOTE;
 	}
 	\\.?	{
@@ -178,14 +176,15 @@ n	[A-Za-z0-9_-]
 	\'|\"	{
 		if (str == yytext[0]) {
 			BEGIN(PARAM);
-			zconflval.string = text;
+			yylval.string = text;
 			return T_WORD_QUOTE;
 		} else
 			append_string(yytext, 1);
 	}
 	\n	{
-		printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno());
-		current_file->lineno++;
+		fprintf(stderr,
+			"%s:%d:warning: multi-line strings not supported\n",
+			zconf_curname(), zconf_lineno());
 		BEGIN(INITIAL);
 		return T_EOL;
 	}
@@ -218,12 +217,10 @@ n	[A-Za-z0-9_-]
 		}
 	}
 	[ \t]*\n/[^ \t\n] {
-		current_file->lineno++;
 		zconf_endhelp();
 		return T_HELPTEXT;
 	}
 	[ \t]*\n	{
-		current_file->lineno++;
 		append_string("\n", 1);
 	}
 	[^ \t\n].* {
@@ -261,7 +258,7 @@ void zconf_starthelp(void)
 
 static void zconf_endhelp(void)
 {
-	zconflval.string = text;
+	yylval.string = text;
 	BEGIN(INITIAL);
 }
 
@@ -294,7 +291,7 @@ void zconf_initscan(const char *name)
 {
 	yyin = zconf_fopen(name);
 	if (!yyin) {
-		printf("can't find file %s\n", name);
+		fprintf(stderr, "can't find file %s\n", name);
 		exit(1);
 	}
 
@@ -302,7 +299,7 @@ void zconf_initscan(const char *name)
 	memset(current_buf, 0, sizeof(*current_buf));
 
 	current_file = file_lookup(name);
-	current_file->lineno = 1;
+	yylineno = 1;
 }
 
 void zconf_nextfile(const char *name)
@@ -315,35 +312,34 @@ void zconf_nextfile(const char *name)
 	current_buf->state = YY_CURRENT_BUFFER;
 	yyin = zconf_fopen(file->name);
 	if (!yyin) {
-		printf("%s:%d: can't open file \"%s\"\n",
-		    zconf_curname(), zconf_lineno(), file->name);
+		fprintf(stderr, "%s:%d: can't open file \"%s\"\n",
+			zconf_curname(), zconf_lineno(), file->name);
 		exit(1);
 	}
 	yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
 	buf->parent = current_buf;
 	current_buf = buf;
 
-	for (iter = current_file->parent; iter; iter = iter->parent ) {
-		if (!strcmp(current_file->name,iter->name) ) {
-			printf("%s:%d: recursive inclusion detected. "
-			       "Inclusion path:\n  current file : '%s'\n",
-			       zconf_curname(), zconf_lineno(),
-			       zconf_curname());
-			iter = current_file->parent;
-			while (iter && \
-			       strcmp(iter->name,current_file->name)) {
-				printf("  included from: '%s:%d'\n",
-				       iter->name, iter->lineno-1);
+	current_file->lineno = yylineno;
+	file->parent = current_file;
+
+	for (iter = current_file; iter; iter = iter->parent) {
+		if (!strcmp(iter->name, file->name)) {
+			fprintf(stderr,
+				"Recursive inclusion detected.\n"
+				"Inclusion path:\n"
+				"  current file : %s\n", file->name);
+			iter = file;
+			do {
 				iter = iter->parent;
-			}
-			if (iter)
-				printf("  included from: '%s:%d'\n",
-				       iter->name, iter->lineno+1);
+				fprintf(stderr, "  included from: %s:%d\n",
+					iter->name, iter->lineno - 1);
+			} while (strcmp(iter->name, file->name));
 			exit(1);
 		}
 	}
-	file->lineno = 1;
-	file->parent = current_file;
+
+	yylineno = 1;
 	current_file = file;
 }
 
@@ -352,6 +348,8 @@ static void zconf_endfile(void)
 	struct buffer *parent;
 
 	current_file = current_file->parent;
+	if (current_file)
+		yylineno = current_file->lineno;
 
 	parent = current_buf->parent;
 	if (parent) {
diff --git a/scripts/kconfig/zconf.lex.c_shipped b/scripts/kconfig/zconf.lex.c_shipped
deleted file mode 100644
index 37fdf6123505..000000000000
--- a/scripts/kconfig/zconf.lex.c_shipped
+++ /dev/null
@@ -1,2473 +0,0 @@
-
-#line 3 "scripts/kconfig/zconf.lex.c_shipped"
-
-#define  YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define yy_create_buffer zconf_create_buffer
-#define yy_delete_buffer zconf_delete_buffer
-#define yy_flex_debug zconf_flex_debug
-#define yy_init_buffer zconf_init_buffer
-#define yy_flush_buffer zconf_flush_buffer
-#define yy_load_buffer_state zconf_load_buffer_state
-#define yy_switch_to_buffer zconf_switch_to_buffer
-#define yyin zconfin
-#define yyleng zconfleng
-#define yylex zconflex
-#define yylineno zconflineno
-#define yyout zconfout
-#define yyrestart zconfrestart
-#define yytext zconftext
-#define yywrap zconfwrap
-#define yyalloc zconfalloc
-#define yyrealloc zconfrealloc
-#define yyfree zconffree
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-/* First, we deal with  platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
- */
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
-#endif
-
-#include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN               (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN              (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN              (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX               (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX              (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX              (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX              (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX             (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX             (4294967295U)
-#endif
-
-#endif /* ! C99 */
-
-#endif /* ! FLEXINT_H */
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else	/* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif	/* defined (__STDC__) */
-#endif	/* ! __cplusplus */
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN (yy_start) = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START (((yy_start) - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE zconfrestart(zconfin  )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k.
- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
- * Ditto for the __ia64__ case accordingly.
- */
-#define YY_BUF_SIZE 32768
-#else
-#define YY_BUF_SIZE 16384
-#endif /* __ia64__ */
-#endif
-
-/* The state buf must be large enough to hold one state per character in the main buffer.
- */
-#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-extern int zconfleng;
-
-extern FILE *zconfin, *zconfout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-    #define YY_LESS_LINENO(n)
-    
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up zconftext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-		*yy_cp = (yy_hold_char); \
-		YY_RESTORE_YY_MORE_OFFSET \
-		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up zconftext again */ \
-		} \
-	while ( 0 )
-
-#define unput(c) yyunput( c, (yytext_ptr)  )
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
-	{
-	FILE *yy_input_file;
-
-	char *yy_ch_buf;		/* input buffer */
-	char *yy_buf_pos;		/* current position in input buffer */
-
-	/* Size of input buffer in bytes, not including room for EOB
-	 * characters.
-	 */
-	yy_size_t yy_buf_size;
-
-	/* Number of characters read into yy_ch_buf, not including EOB
-	 * characters.
-	 */
-	int yy_n_chars;
-
-	/* Whether we "own" the buffer - i.e., we know we created it,
-	 * and can realloc() it to grow it, and should free() it to
-	 * delete it.
-	 */
-	int yy_is_our_buffer;
-
-	/* Whether this is an "interactive" input source; if so, and
-	 * if we're using stdio for input, then we want to use getc()
-	 * instead of fread(), to make sure we stop fetching input after
-	 * each newline.
-	 */
-	int yy_is_interactive;
-
-	/* Whether we're considered to be at the beginning of a line.
-	 * If so, '^' rules will be active on the next match, otherwise
-	 * not.
-	 */
-	int yy_at_bol;
-
-    int yy_bs_lineno; /**< The line count. */
-    int yy_bs_column; /**< The column count. */
-    
-	/* Whether to try to fill the input buffer when we reach the
-	 * end of it.
-	 */
-	int yy_fill_buffer;
-
-	int yy_buffer_status;
-
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-	/* When an EOF's been seen but there's still some text to process
-	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-	 * shouldn't try reading from the input source any more.  We might
-	 * still have a bunch of tokens to match, though, because of
-	 * possible backing-up.
-	 *
-	 * When we actually see the EOF, we change the status to "new"
-	 * (via zconfrestart()), so that the user can continue scanning by
-	 * just pointing zconfin@a new input file.
-	 */
-#define YY_BUFFER_EOF_PENDING 2
-
-	};
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-/* Stack of input buffers. */
-static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
-static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- *
- * Returns the top of the stack, or NULL.
- */
-#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
-                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
-                          : NULL)
-
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-
-/* yy_hold_char holds the character lost when zconftext is formed. */
-static char yy_hold_char;
-static int yy_n_chars;		/* number of characters read into yy_ch_buf */
-int zconfleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0;		/* whether we need to initialize */
-static int yy_start = 0;	/* start state number */
-
-/* Flag which is used to allow zconfwrap()'s to do buffer switches
- * instead of setting up a fresh zconfin.  A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void zconfrestart (FILE *input_file  );
-void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
-YY_BUFFER_STATE zconf_create_buffer (FILE *file,int size  );
-void zconf_delete_buffer (YY_BUFFER_STATE b  );
-void zconf_flush_buffer (YY_BUFFER_STATE b  );
-void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer  );
-void zconfpop_buffer_state (void );
-
-static void zconfensure_buffer_stack (void );
-static void zconf_load_buffer_state (void );
-static void zconf_init_buffer (YY_BUFFER_STATE b,FILE *file  );
-
-#define YY_FLUSH_BUFFER zconf_flush_buffer(YY_CURRENT_BUFFER )
-
-YY_BUFFER_STATE zconf_scan_buffer (char *base,yy_size_t size  );
-YY_BUFFER_STATE zconf_scan_string (yyconst char *yy_str  );
-YY_BUFFER_STATE zconf_scan_bytes (yyconst char *bytes,int len  );
-
-void *zconfalloc (yy_size_t  );
-void *zconfrealloc (void *,yy_size_t  );
-void zconffree (void *  );
-
-#define yy_new_buffer zconf_create_buffer
-
-#define yy_set_interactive(is_interactive) \
-	{ \
-	if ( ! YY_CURRENT_BUFFER ){ \
-        zconfensure_buffer_stack (); \
-		YY_CURRENT_BUFFER_LVALUE =    \
-            zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
-	} \
-	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-	}
-
-#define yy_set_bol(at_bol) \
-	{ \
-	if ( ! YY_CURRENT_BUFFER ){\
-        zconfensure_buffer_stack (); \
-		YY_CURRENT_BUFFER_LVALUE =    \
-            zconf_create_buffer(zconfin,YY_BUF_SIZE ); \
-	} \
-	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
-	}
-
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-
-/* Begin user sect3 */
-
-#define zconfwrap(n) 1
-#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
-
-FILE *zconfin = (FILE *) 0, *zconfout = (FILE *) 0;
-
-typedef int yy_state_type;
-
-extern int zconflineno;
-
-int zconflineno = 1;
-
-extern char *zconftext;
-#define yytext_ptr zconftext
-static yyconst flex_int16_t yy_nxt[][18] =
-    {
-    {
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0
-    },
-
-    {
-       11,   12,   13,   14,   12,   12,   15,   12,   12,   12,
-       12,   12,   12,   12,   12,   12,   12,   12
-    },
-
-    {
-       11,   12,   13,   14,   12,   12,   15,   12,   12,   12,
-       12,   12,   12,   12,   12,   12,   12,   12
-    },
-
-    {
-       11,   16,   16,   17,   16,   16,   16,   16,   16,   16,
-       16,   18,   16,   16,   16,   16,   16,   16
-    },
-
-    {
-       11,   16,   16,   17,   16,   16,   16,   16,   16,   16,
-       16,   18,   16,   16,   16,   16,   16,   16
-
-    },
-
-    {
-       11,   19,   20,   21,   19,   19,   19,   19,   19,   19,
-       19,   19,   19,   19,   19,   19,   19,   19
-    },
-
-    {
-       11,   19,   20,   21,   19,   19,   19,   19,   19,   19,
-       19,   19,   19,   19,   19,   19,   19,   19
-    },
-
-    {
-       11,   22,   22,   23,   22,   24,   22,   22,   24,   22,
-       22,   22,   22,   22,   22,   22,   25,   22
-    },
-
-    {
-       11,   22,   22,   23,   22,   24,   22,   22,   24,   22,
-       22,   22,   22,   22,   22,   22,   25,   22
-    },
-
-    {
-       11,   26,   27,   28,   29,   30,   31,   32,   30,   33,
-       34,   35,   35,   36,   37,   38,   39,   40
-
-    },
-
-    {
-       11,   26,   27,   28,   29,   30,   31,   32,   30,   33,
-       34,   35,   35,   36,   37,   38,   39,   40
-    },
-
-    {
-      -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11,
-      -11,  -11,  -11,  -11,  -11,  -11,  -11,  -11
-    },
-
-    {
-       11,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12,
-      -12,  -12,  -12,  -12,  -12,  -12,  -12,  -12
-    },
-
-    {
-       11,  -13,   41,   42,  -13,  -13,   43,  -13,  -13,  -13,
-      -13,  -13,  -13,  -13,  -13,  -13,  -13,  -13
-    },
-
-    {
-       11,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14,
-      -14,  -14,  -14,  -14,  -14,  -14,  -14,  -14
-
-    },
-
-    {
-       11,   44,   44,   45,   44,   44,   44,   44,   44,   44,
-       44,   44,   44,   44,   44,   44,   44,   44
-    },
-
-    {
-       11,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16,
-      -16,  -16,  -16,  -16,  -16,  -16,  -16,  -16
-    },
-
-    {
-       11,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17,
-      -17,  -17,  -17,  -17,  -17,  -17,  -17,  -17
-    },
-
-    {
-       11,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,  -18,
-      -18,   46,  -18,  -18,  -18,  -18,  -18,  -18
-    },
-
-    {
-       11,   47,   47,  -19,   47,   47,   47,   47,   47,   47,
-       47,   47,   47,   47,   47,   47,   47,   47
-
-    },
-
-    {
-       11,  -20,   48,   49,  -20,  -20,  -20,  -20,  -20,  -20,
-      -20,  -20,  -20,  -20,  -20,  -20,  -20,  -20
-    },
-
-    {
-       11,   50,  -21,  -21,   50,   50,   50,   50,   50,   50,
-       50,   50,   50,   50,   50,   50,   50,   50
-    },
-
-    {
-       11,   51,   51,   52,   51,  -22,   51,   51,  -22,   51,
-       51,   51,   51,   51,   51,   51,  -22,   51
-    },
-
-    {
-       11,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23,
-      -23,  -23,  -23,  -23,  -23,  -23,  -23,  -23
-    },
-
-    {
-       11,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
-      -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24
-
-    },
-
-    {
-       11,   53,   53,   54,   53,   53,   53,   53,   53,   53,
-       53,   53,   53,   53,   53,   53,   53,   53
-    },
-
-    {
-       11,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26,
-      -26,  -26,  -26,  -26,  -26,  -26,  -26,  -26
-    },
-
-    {
-       11,  -27,   55,  -27,  -27,  -27,  -27,  -27,  -27,  -27,
-      -27,  -27,  -27,  -27,  -27,  -27,  -27,  -27
-    },
-
-    {
-       11,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28,
-      -28,  -28,  -28,  -28,  -28,  -28,  -28,  -28
-    },
-
-    {
-       11,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,  -29,
-      -29,  -29,  -29,  -29,   56,  -29,  -29,  -29
-
-    },
-
-    {
-       11,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30,
-      -30,  -30,  -30,  -30,  -30,  -30,  -30,  -30
-    },
-
-    {
-       11,   57,   57,  -31,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57
-    },
-
-    {
-       11,  -32,  -32,  -32,  -32,  -32,  -32,   58,  -32,  -32,
-      -32,  -32,  -32,  -32,  -32,  -32,  -32,  -32
-    },
-
-    {
-       11,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
-      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33
-    },
-
-    {
-       11,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,
-      -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34
-
-    },
-
-    {
-       11,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
-      -35,   59,   59,  -35,  -35,  -35,  -35,  -35
-    },
-
-    {
-       11,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
-      -36,  -36,  -36,  -36,   60,  -36,  -36,  -36
-    },
-
-    {
-       11,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,
-      -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37
-    },
-
-    {
-       11,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,
-      -38,  -38,  -38,  -38,   61,  -38,  -38,  -38
-    },
-
-    {
-       11,  -39,  -39,   62,  -39,  -39,  -39,  -39,  -39,  -39,
-      -39,  -39,  -39,  -39,  -39,  -39,  -39,  -39
-
-    },
-
-    {
-       11,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,
-      -40,  -40,  -40,  -40,  -40,  -40,  -40,   63
-    },
-
-    {
-       11,  -41,   41,   42,  -41,  -41,   43,  -41,  -41,  -41,
-      -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41
-    },
-
-    {
-       11,  -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,
-      -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42
-    },
-
-    {
-       11,   44,   44,   45,   44,   44,   44,   44,   44,   44,
-       44,   44,   44,   44,   44,   44,   44,   44
-    },
-
-    {
-       11,   44,   44,   45,   44,   44,   44,   44,   44,   44,
-       44,   44,   44,   44,   44,   44,   44,   44
-
-    },
-
-    {
-       11,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,
-      -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45
-    },
-
-    {
-       11,  -46,  -46,  -46,  -46,  -46,  -46,  -46,  -46,  -46,
-      -46,   46,  -46,  -46,  -46,  -46,  -46,  -46
-    },
-
-    {
-       11,   47,   47,  -47,   47,   47,   47,   47,   47,   47,
-       47,   47,   47,   47,   47,   47,   47,   47
-    },
-
-    {
-       11,  -48,   48,   49,  -48,  -48,  -48,  -48,  -48,  -48,
-      -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48
-    },
-
-    {
-       11,   50,  -49,  -49,   50,   50,   50,   50,   50,   50,
-       50,   50,   50,   50,   50,   50,   50,   50
-
-    },
-
-    {
-       11,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,
-      -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50
-    },
-
-    {
-       11,   51,   51,   52,   51,  -51,   51,   51,  -51,   51,
-       51,   51,   51,   51,   51,   51,  -51,   51
-    },
-
-    {
-       11,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,
-      -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52
-    },
-
-    {
-       11,  -53,  -53,   54,  -53,  -53,  -53,  -53,  -53,  -53,
-      -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53
-    },
-
-    {
-       11,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,
-      -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54
-
-    },
-
-    {
-       11,  -55,   55,  -55,  -55,  -55,  -55,  -55,  -55,  -55,
-      -55,  -55,  -55,  -55,  -55,  -55,  -55,  -55
-    },
-
-    {
-       11,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,
-      -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56
-    },
-
-    {
-       11,   57,   57,  -57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57
-    },
-
-    {
-       11,  -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,
-      -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58
-    },
-
-    {
-       11,  -59,  -59,  -59,  -59,  -59,  -59,  -59,  -59,  -59,
-      -59,   59,   59,  -59,  -59,  -59,  -59,  -59
-
-    },
-
-    {
-       11,  -60,  -60,  -60,  -60,  -60,  -60,  -60,  -60,  -60,
-      -60,  -60,  -60,  -60,  -60,  -60,  -60,  -60
-    },
-
-    {
-       11,  -61,  -61,  -61,  -61,  -61,  -61,  -61,  -61,  -61,
-      -61,  -61,  -61,  -61,  -61,  -61,  -61,  -61
-    },
-
-    {
-       11,  -62,  -62,  -62,  -62,  -62,  -62,  -62,  -62,  -62,
-      -62,  -62,  -62,  -62,  -62,  -62,  -62,  -62
-    },
-
-    {
-       11,  -63,  -63,  -63,  -63,  -63,  -63,  -63,  -63,  -63,
-      -63,  -63,  -63,  -63,  -63,  -63,  -63,  -63
-    },
-
-    } ;
-
-static yy_state_type yy_get_previous_state (void );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
-static int yy_get_next_buffer (void );
-static void yy_fatal_error (yyconst char msg[]  );
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up zconftext.
- */
-#define YY_DO_BEFORE_ACTION \
-	(yytext_ptr) = yy_bp; \
-	zconfleng = (size_t) (yy_cp - yy_bp); \
-	(yy_hold_char) = *yy_cp; \
-	*yy_cp = '\0'; \
-	(yy_c_buf_p) = yy_cp;
-
-#define YY_NUM_RULES 37
-#define YY_END_OF_BUFFER 38
-/* This struct is not used in this scanner,
-   but its presence is necessary. */
-struct yy_trans_info
-	{
-	flex_int32_t yy_verify;
-	flex_int32_t yy_nxt;
-	};
-static yyconst flex_int16_t yy_accept[64] =
-    {   0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-       38,    5,    4,    2,    3,    7,    8,    6,   36,   33,
-       35,   28,   32,   31,   30,   26,   25,   21,   13,   20,
-       23,   26,   11,   12,   22,   18,   14,   19,   26,   26,
-        4,    2,    3,    3,    1,    6,   36,   33,   35,   34,
-       28,   27,   30,   29,   25,   15,   23,    9,   22,   16,
-       17,   24,   10
-    } ;
-
-static yyconst flex_int32_t yy_ec[256] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2,    4,    5,    6,    1,    1,    7,    8,    9,
-       10,    1,    1,    1,   11,   12,   12,   11,   11,   11,
-       11,   11,   11,   11,   11,   11,   11,    1,    1,   13,
-       14,   15,    1,    1,   11,   11,   11,   11,   11,   11,
-       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
-       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
-        1,   16,    1,    1,   11,    1,   11,   11,   11,   11,
-
-       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
-       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
-       11,   11,    1,   17,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1
-    } ;
-
-extern int zconf_flex_debug;
-int zconf_flex_debug = 0;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-char *zconftext;
-#define YY_NO_INPUT 1
-
-/*
- * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
- * Released under the terms of the GNU GPL v2.0.
- */
-
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "lkc.h"
-
-#define START_STRSIZE	16
-
-static struct {
-	struct file *file;
-	int lineno;
-} current_pos;
-
-static char *text;
-static int text_size, text_asize;
-
-struct buffer {
-	struct buffer *parent;
-	YY_BUFFER_STATE state;
-};
-
-struct buffer *current_buf;
-
-static int last_ts, first_ts;
-
-static void zconf_endhelp(void);
-static void zconf_endfile(void);
-
-static void new_string(void)
-{
-	text = xmalloc(START_STRSIZE);
-	text_asize = START_STRSIZE;
-	text_size = 0;
-	*text = 0;
-}
-
-static void append_string(const char *str, int size)
-{
-	int new_size = text_size + size + 1;
-	if (new_size > text_asize) {
-		new_size += START_STRSIZE - 1;
-		new_size &= -START_STRSIZE;
-		text = realloc(text, new_size);
-		text_asize = new_size;
-	}
-	memcpy(text + text_size, str, size);
-	text_size += size;
-	text[text_size] = 0;
-}
-
-static void alloc_string(const char *str, int size)
-{
-	text = xmalloc(size + 1);
-	memcpy(text, str, size);
-	text[size] = 0;
-}
-
-static void warn_ignored_character(char chr)
-{
-	fprintf(stderr,
-	        "%s:%d:warning: ignoring unsupported character '%c'\n",
-	        zconf_curname(), zconf_lineno(), chr);
-}
-
-#define INITIAL 0
-#define COMMAND 1
-#define HELP 2
-#define STRING 3
-#define PARAM 4
-
-#ifndef YY_NO_UNISTD_H
-/* Special case for "unistd.h", since it is non-ANSI. We include it way
- * down here because we want the user's section 1 to have been scanned first.
- * The user has a chance to override it with an option.
- */
-#include <unistd.h>
-#endif
-
-#ifndef YY_EXTRA_TYPE
-#define YY_EXTRA_TYPE void *
-#endif
-
-static int yy_init_globals (void );
-
-/* Accessor methods to globals.
-   These are made visible to non-reentrant scanners for convenience. */
-
-int zconflex_destroy (void );
-
-int zconfget_debug (void );
-
-void zconfset_debug (int debug_flag  );
-
-YY_EXTRA_TYPE zconfget_extra (void );
-
-void zconfset_extra (YY_EXTRA_TYPE user_defined  );
-
-FILE *zconfget_in (void );
-
-void zconfset_in  (FILE * in_str  );
-
-FILE *zconfget_out (void );
-
-void zconfset_out  (FILE * out_str  );
-
-int zconfget_leng (void );
-
-char *zconfget_text (void );
-
-int zconfget_lineno (void );
-
-void zconfset_lineno (int line_number  );
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int zconfwrap (void );
-#else
-extern int zconfwrap (void );
-#endif
-#endif
-
-    static void yyunput (int c,char *buf_ptr  );
-    
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
-#endif
-
-#ifndef YY_NO_INPUT
-
-#ifdef __cplusplus
-static int yyinput (void );
-#else
-static int input (void );
-#endif
-
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k */
-#define YY_READ_BUF_SIZE 16384
-#else
-#define YY_READ_BUF_SIZE 8192
-#endif /* __ia64__ */
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO do { if (fwrite( zconftext, zconfleng, 1, zconfout )) {} } while (0)
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
-	errno=0; \
-	while ( (result = read( fileno(zconfin), (char *) buf, max_size )) < 0 ) \
-	{ \
-		if( errno != EINTR) \
-		{ \
-			YY_FATAL_ERROR( "input in flex scanner failed" ); \
-			break; \
-		} \
-		errno=0; \
-		clearerr(zconfin); \
-	}\
-\
-
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* end tables serialization structures and prototypes */
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-
-extern int zconflex (void);
-
-#define YY_DECL int zconflex (void)
-#endif /* !YY_DECL */
-
-/* Code executed at the beginning of each rule, after zconftext and zconfleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed@the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
-	YY_USER_ACTION
-
-/** The main scanner function which does all the work.
- */
-YY_DECL
-{
-	register yy_state_type yy_current_state;
-	register char *yy_cp, *yy_bp;
-	register int yy_act;
-    
-	int str = 0;
-	int ts, i;
-
-	if ( !(yy_init) )
-		{
-		(yy_init) = 1;
-
-#ifdef YY_USER_INIT
-		YY_USER_INIT;
-#endif
-
-		if ( ! (yy_start) )
-			(yy_start) = 1;	/* first start state */
-
-		if ( ! zconfin )
-			zconfin = stdin;
-
-		if ( ! zconfout )
-			zconfout = stdout;
-
-		if ( ! YY_CURRENT_BUFFER ) {
-			zconfensure_buffer_stack ();
-			YY_CURRENT_BUFFER_LVALUE =
-				zconf_create_buffer(zconfin,YY_BUF_SIZE );
-		}
-
-		zconf_load_buffer_state( );
-		}
-
-	while ( 1 )		/* loops until end-of-file is reached */
-		{
-		yy_cp = (yy_c_buf_p);
-
-		/* Support of zconftext. */
-		*yy_cp = (yy_hold_char);
-
-		/* yy_bp points to the position in yy_ch_buf of the start of
-		 * the current run.
-		 */
-		yy_bp = yy_cp;
-
-		yy_current_state = (yy_start);
-yy_match:
-		while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)]  ]) > 0 )
-			++yy_cp;
-
-		yy_current_state = -yy_current_state;
-
-yy_find_action:
-		yy_act = yy_accept[yy_current_state];
-
-		YY_DO_BEFORE_ACTION;
-
-do_action:	/* This label is used only to access EOF actions. */
-
-		switch ( yy_act )
-	{ /* beginning of action switch */
-case 1:
-/* rule 1 can match eol */
-case 2:
-/* rule 2 can match eol */
-YY_RULE_SETUP
-{
-	current_file->lineno++;
-	return T_EOL;
-}
-	YY_BREAK
-case 3:
-YY_RULE_SETUP
-
-	YY_BREAK
-case 4:
-YY_RULE_SETUP
-{
-	BEGIN(COMMAND);
-}
-	YY_BREAK
-case 5:
-YY_RULE_SETUP
-{
-	unput(zconftext[0]);
-	BEGIN(COMMAND);
-}
-	YY_BREAK
-
-case 6:
-YY_RULE_SETUP
-{
-		const struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
-		BEGIN(PARAM);
-		current_pos.file = current_file;
-		current_pos.lineno = current_file->lineno;
-		if (id && id->flags & TF_COMMAND) {
-			zconflval.id = id;
-			return id->token;
-		}
-		alloc_string(zconftext, zconfleng);
-		zconflval.string = text;
-		return T_WORD;
-	}
-	YY_BREAK
-case 7:
-YY_RULE_SETUP
-warn_ignored_character(*zconftext);
-	YY_BREAK
-case 8:
-/* rule 8 can match eol */
-YY_RULE_SETUP
-{
-		BEGIN(INITIAL);
-		current_file->lineno++;
-		return T_EOL;
-	}
-	YY_BREAK
-
-case 9:
-YY_RULE_SETUP
-return T_AND;
-	YY_BREAK
-case 10:
-YY_RULE_SETUP
-return T_OR;
-	YY_BREAK
-case 11:
-YY_RULE_SETUP
-return T_OPEN_PAREN;
-	YY_BREAK
-case 12:
-YY_RULE_SETUP
-return T_CLOSE_PAREN;
-	YY_BREAK
-case 13:
-YY_RULE_SETUP
-return T_NOT;
-	YY_BREAK
-case 14:
-YY_RULE_SETUP
-return T_EQUAL;
-	YY_BREAK
-case 15:
-YY_RULE_SETUP
-return T_UNEQUAL;
-	YY_BREAK
-case 16:
-YY_RULE_SETUP
-return T_LESS_EQUAL;
-	YY_BREAK
-case 17:
-YY_RULE_SETUP
-return T_GREATER_EQUAL;
-	YY_BREAK
-case 18:
-YY_RULE_SETUP
-return T_LESS;
-	YY_BREAK
-case 19:
-YY_RULE_SETUP
-return T_GREATER;
-	YY_BREAK
-case 20:
-YY_RULE_SETUP
-{
-		str = zconftext[0];
-		new_string();
-		BEGIN(STRING);
-	}
-	YY_BREAK
-case 21:
-/* rule 21 can match eol */
-YY_RULE_SETUP
-BEGIN(INITIAL); current_file->lineno++; return T_EOL;
-	YY_BREAK
-case 22:
-YY_RULE_SETUP
-{
-		const struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng);
-		if (id && id->flags & TF_PARAM) {
-			zconflval.id = id;
-			return id->token;
-		}
-		alloc_string(zconftext, zconfleng);
-		zconflval.string = text;
-		return T_WORD;
-	}
-	YY_BREAK
-case 23:
-YY_RULE_SETUP
-/* comment */
-	YY_BREAK
-case 24:
-/* rule 24 can match eol */
-YY_RULE_SETUP
-current_file->lineno++;
-	YY_BREAK
-case 25:
-YY_RULE_SETUP
-
-	YY_BREAK
-case 26:
-YY_RULE_SETUP
-warn_ignored_character(*zconftext);
-	YY_BREAK
-case YY_STATE_EOF(PARAM):
-{
-		BEGIN(INITIAL);
-	}
-	YY_BREAK
-
-case 27:
-/* rule 27 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
-(yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up zconftext again */
-YY_RULE_SETUP
-{
-		append_string(zconftext, zconfleng);
-		zconflval.string = text;
-		return T_WORD_QUOTE;
-	}
-	YY_BREAK
-case 28:
-YY_RULE_SETUP
-{
-		append_string(zconftext, zconfleng);
-	}
-	YY_BREAK
-case 29:
-/* rule 29 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
-(yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up zconftext again */
-YY_RULE_SETUP
-{
-		append_string(zconftext + 1, zconfleng - 1);
-		zconflval.string = text;
-		return T_WORD_QUOTE;
-	}
-	YY_BREAK
-case 30:
-YY_RULE_SETUP
-{
-		append_string(zconftext + 1, zconfleng - 1);
-	}
-	YY_BREAK
-case 31:
-YY_RULE_SETUP
-{
-		if (str == zconftext[0]) {
-			BEGIN(PARAM);
-			zconflval.string = text;
-			return T_WORD_QUOTE;
-		} else
-			append_string(zconftext, 1);
-	}
-	YY_BREAK
-case 32:
-/* rule 32 can match eol */
-YY_RULE_SETUP
-{
-		printf("%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno());
-		current_file->lineno++;
-		BEGIN(INITIAL);
-		return T_EOL;
-	}
-	YY_BREAK
-case YY_STATE_EOF(STRING):
-{
-		BEGIN(INITIAL);
-	}
-	YY_BREAK
-
-case 33:
-YY_RULE_SETUP
-{
-		ts = 0;
-		for (i = 0; i < zconfleng; i++) {
-			if (zconftext[i] == '\t')
-				ts = (ts & ~7) + 8;
-			else
-				ts++;
-		}
-		last_ts = ts;
-		if (first_ts) {
-			if (ts < first_ts) {
-				zconf_endhelp();
-				return T_HELPTEXT;
-			}
-			ts -= first_ts;
-			while (ts > 8) {
-				append_string("        ", 8);
-				ts -= 8;
-			}
-			append_string("        ", ts);
-		}
-	}
-	YY_BREAK
-case 34:
-/* rule 34 can match eol */
-*yy_cp = (yy_hold_char); /* undo effects of setting up zconftext */
-(yy_c_buf_p) = yy_cp -= 1;
-YY_DO_BEFORE_ACTION; /* set up zconftext again */
-YY_RULE_SETUP
-{
-		current_file->lineno++;
-		zconf_endhelp();
-		return T_HELPTEXT;
-	}
-	YY_BREAK
-case 35:
-/* rule 35 can match eol */
-YY_RULE_SETUP
-{
-		current_file->lineno++;
-		append_string("\n", 1);
-	}
-	YY_BREAK
-case 36:
-YY_RULE_SETUP
-{
-		while (zconfleng) {
-			if ((zconftext[zconfleng-1] != ' ') && (zconftext[zconfleng-1] != '\t'))
-				break;
-			zconfleng--;
-		}
-		append_string(zconftext, zconfleng);
-		if (!first_ts)
-			first_ts = last_ts;
-	}
-	YY_BREAK
-case YY_STATE_EOF(HELP):
-{
-		zconf_endhelp();
-		return T_HELPTEXT;
-	}
-	YY_BREAK
-
-case YY_STATE_EOF(INITIAL):
-case YY_STATE_EOF(COMMAND):
-{
-	if (current_file) {
-		zconf_endfile();
-		return T_EOL;
-	}
-	fclose(zconfin);
-	yyterminate();
-}
-	YY_BREAK
-case 37:
-YY_RULE_SETUP
-YY_FATAL_ERROR( "flex scanner jammed" );
-	YY_BREAK
-
-	case YY_END_OF_BUFFER:
-		{
-		/* Amount of text matched not including the EOB char. */
-		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
-		/* Undo the effects of YY_DO_BEFORE_ACTION. */
-		*yy_cp = (yy_hold_char);
-		YY_RESTORE_YY_MORE_OFFSET
-
-		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-			{
-			/* We're scanning a new file or input source.  It's
-			 * possible that this happened because the user
-			 * just pointed zconfin at a new source and called
-			 * zconflex().  If so, then we have to assure
-			 * consistency between YY_CURRENT_BUFFER and our
-			 * globals.  Here is the right place to do so, because
-			 * this is the first action (other than possibly a
-			 * back-up) that will match for the new input source.
-			 */
-			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-			YY_CURRENT_BUFFER_LVALUE->yy_input_file = zconfin;
-			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-			}
-
-		/* Note that here we test for yy_c_buf_p "<=" to the position
-		 * of the first EOB in the buffer, since yy_c_buf_p will
-		 * already have been incremented past the NUL character
-		 * (since all states make transitions on EOB to the
-		 * end-of-buffer state).  Contrast this with the test
-		 * in input().
-		 */
-		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-			{ /* This was really a NUL. */
-			yy_state_type yy_next_state;
-
-			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
-			yy_current_state = yy_get_previous_state(  );
-
-			/* Okay, we're now positioned to make the NUL
-			 * transition.  We couldn't have
-			 * yy_get_previous_state() go ahead and do it
-			 * for us because it doesn't know how to deal
-			 * with the possibility of jamming (and we don't
-			 * want to build jamming into it because then it
-			 * will run more slowly).
-			 */
-
-			yy_next_state = yy_try_NUL_trans( yy_current_state );
-
-			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
-			if ( yy_next_state )
-				{
-				/* Consume the NUL. */
-				yy_cp = ++(yy_c_buf_p);
-				yy_current_state = yy_next_state;
-				goto yy_match;
-				}
-
-			else
-				{
-				yy_cp = (yy_c_buf_p);
-				goto yy_find_action;
-				}
-			}
-
-		else switch ( yy_get_next_buffer(  ) )
-			{
-			case EOB_ACT_END_OF_FILE:
-				{
-				(yy_did_buffer_switch_on_eof) = 0;
-
-				if ( zconfwrap( ) )
-					{
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * zconftext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF(YY_START);
-					goto do_action;
-					}
-
-				else
-					{
-					if ( ! (yy_did_buffer_switch_on_eof) )
-						YY_NEW_FILE;
-					}
-				break;
-				}
-
-			case EOB_ACT_CONTINUE_SCAN:
-				(yy_c_buf_p) =
-					(yytext_ptr) + yy_amount_of_matched_text;
-
-				yy_current_state = yy_get_previous_state(  );
-
-				yy_cp = (yy_c_buf_p);
-				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-				goto yy_match;
-
-			case EOB_ACT_LAST_MATCH:
-				(yy_c_buf_p) =
-				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
-				yy_current_state = yy_get_previous_state(  );
-
-				yy_cp = (yy_c_buf_p);
-				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-				goto yy_find_action;
-			}
-		break;
-		}
-
-	default:
-		YY_FATAL_ERROR(
-			"fatal flex scanner internal error--no action found" );
-	} /* end of action switch */
-		} /* end of scanning one token */
-} /* end of zconflex */
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *	EOB_ACT_LAST_MATCH -
- *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *	EOB_ACT_END_OF_FILE - end of file
- */
-static int yy_get_next_buffer (void)
-{
-    	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-	register char *source = (yytext_ptr);
-	register int number_to_move, i;
-	int ret_val;
-
-	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
-		YY_FATAL_ERROR(
-		"fatal flex scanner internal error--end of buffer missed" );
-
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
-		{ /* Don't try to fill the buffer, so this is an EOF. */
-		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
-			{
-			/* We matched a single character, the EOB, so
-			 * treat this as a final EOF.
-			 */
-			return EOB_ACT_END_OF_FILE;
-			}
-
-		else
-			{
-			/* We matched some text prior to the EOB, first
-			 * process it.
-			 */
-			return EOB_ACT_LAST_MATCH;
-			}
-		}
-
-	/* Try to read more data. */
-
-	/* First move last chars to start of buffer. */
-	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
-	for ( i = 0; i < number_to_move; ++i )
-		*(dest++) = *(source++);
-
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-		/* don't do the read, it's not guaranteed to return an EOF,
-		 * just force an EOF
-		 */
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
-	else
-		{
-			int num_to_read =
-			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-		while ( num_to_read <= 0 )
-			{ /* Not enough room in the buffer - grow it. */
-
-			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
-			int yy_c_buf_p_offset =
-				(int) ((yy_c_buf_p) - b->yy_ch_buf);
-
-			if ( b->yy_is_our_buffer )
-				{
-				int new_size = b->yy_buf_size * 2;
-
-				if ( new_size <= 0 )
-					b->yy_buf_size += b->yy_buf_size / 8;
-				else
-					b->yy_buf_size *= 2;
-
-				b->yy_ch_buf = (char *)
-					/* Include room in for 2 EOB chars. */
-					zconfrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
-				}
-			else
-				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = 0;
-
-			if ( ! b->yy_ch_buf )
-				YY_FATAL_ERROR(
-				"fatal error - scanner input buffer overflow" );
-
-			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
-						number_to_move - 1;
-
-			}
-
-		if ( num_to_read > YY_READ_BUF_SIZE )
-			num_to_read = YY_READ_BUF_SIZE;
-
-		/* Read in more data. */
-		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			(yy_n_chars), (size_t) num_to_read );
-
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-		}
-
-	if ( (yy_n_chars) == 0 )
-		{
-		if ( number_to_move == YY_MORE_ADJ )
-			{
-			ret_val = EOB_ACT_END_OF_FILE;
-			zconfrestart(zconfin  );
-			}
-
-		else
-			{
-			ret_val = EOB_ACT_LAST_MATCH;
-			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-				YY_BUFFER_EOF_PENDING;
-			}
-		}
-
-	else
-		ret_val = EOB_ACT_CONTINUE_SCAN;
-
-	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-		/* Extend the array by 50%, plus the number we really need. */
-		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
-		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) zconfrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
-		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-	}
-
-	(yy_n_chars) += number_to_move;
-	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
-	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
-	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
-	return ret_val;
-}
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-    static yy_state_type yy_get_previous_state (void)
-{
-	register yy_state_type yy_current_state;
-	register char *yy_cp;
-    
-	yy_current_state = (yy_start);
-
-	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
-		{
-		yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)];
-		}
-
-	return yy_current_state;
-}
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *	next_state = yy_try_NUL_trans( current_state );
- */
-    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
-{
-	register int yy_is_jam;
-    
-	yy_current_state = yy_nxt[yy_current_state][1];
-	yy_is_jam = (yy_current_state <= 0);
-
-	return yy_is_jam ? 0 : yy_current_state;
-}
-
-    static void yyunput (int c, register char * yy_bp )
-{
-	register char *yy_cp;
-    
-    yy_cp = (yy_c_buf_p);
-
-	/* undo effects of setting up zconftext */
-	*yy_cp = (yy_hold_char);
-
-	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-		{ /* need to shift things up to make room */
-		/* +2 for EOB chars. */
-		register int number_to_move = (yy_n_chars) + 2;
-		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
-					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
-		register char *source =
-				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
-
-		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-			*--dest = *--source;
-
-		yy_cp += (int) (dest - source);
-		yy_bp += (int) (dest - source);
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
-			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
-
-		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-			YY_FATAL_ERROR( "flex scanner push-back overflow" );
-		}
-
-	*--yy_cp = (char) c;
-
-	(yytext_ptr) = yy_bp;
-	(yy_hold_char) = *yy_cp;
-	(yy_c_buf_p) = yy_cp;
-}
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-    static int yyinput (void)
-#else
-    static int input  (void)
-#endif
-
-{
-	int c;
-    
-	*(yy_c_buf_p) = (yy_hold_char);
-
-	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
-		{
-		/* yy_c_buf_p now points to the character we want to return.
-		 * If this occurs *before* the EOB characters, then it's a
-		 * valid NUL; if not, then we've hit the end of the buffer.
-		 */
-		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-			/* This was really a NUL. */
-			*(yy_c_buf_p) = '\0';
-
-		else
-			{ /* need more input */
-			int offset = (yy_c_buf_p) - (yytext_ptr);
-			++(yy_c_buf_p);
-
-			switch ( yy_get_next_buffer(  ) )
-				{
-				case EOB_ACT_LAST_MATCH:
-					/* This happens because yy_g_n_b()
-					 * sees that we've accumulated a
-					 * token and flags that we need to
-					 * try matching the token before
-					 * proceeding.  But for input(),
-					 * there's no matching to consider.
-					 * So convert the EOB_ACT_LAST_MATCH
-					 * to EOB_ACT_END_OF_FILE.
-					 */
-
-					/* Reset buffer status. */
-					zconfrestart(zconfin );
-
-					/*FALLTHROUGH*/
-
-				case EOB_ACT_END_OF_FILE:
-					{
-					if ( zconfwrap( ) )
-						return EOF;
-
-					if ( ! (yy_did_buffer_switch_on_eof) )
-						YY_NEW_FILE;
-#ifdef __cplusplus
-					return yyinput();
-#else
-					return input();
-#endif
-					}
-
-				case EOB_ACT_CONTINUE_SCAN:
-					(yy_c_buf_p) = (yytext_ptr) + offset;
-					break;
-				}
-			}
-		}
-
-	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
-	*(yy_c_buf_p) = '\0';	/* preserve zconftext */
-	(yy_hold_char) = *++(yy_c_buf_p);
-
-	return c;
-}
-#endif	/* ifndef YY_NO_INPUT */
-
-/** Immediately switch to a different input stream.
- * @param input_file A readable stream.
- * 
- * @note This function does not reset the start condition to @c INITIAL .
- */
-    void zconfrestart  (FILE * input_file )
-{
-    
-	if ( ! YY_CURRENT_BUFFER ){
-        zconfensure_buffer_stack ();
-		YY_CURRENT_BUFFER_LVALUE =
-            zconf_create_buffer(zconfin,YY_BUF_SIZE );
-	}
-
-	zconf_init_buffer(YY_CURRENT_BUFFER,input_file );
-	zconf_load_buffer_state( );
-}
-
-/** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
- * 
- */
-    void zconf_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
-{
-    
-	/* TODO. We should be able to replace this entire function body
-	 * with
-	 *		zconfpop_buffer_state();
-	 *		zconfpush_buffer_state(new_buffer);
-     */
-	zconfensure_buffer_stack ();
-	if ( YY_CURRENT_BUFFER == new_buffer )
-		return;
-
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*(yy_c_buf_p) = (yy_hold_char);
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-		}
-
-	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-	zconf_load_buffer_state( );
-
-	/* We don't actually know whether we did this switch during
-	 * EOF (zconfwrap()) processing, but the only time this flag
-	 * is looked at is after zconfwrap() is called, so it's safe
-	 * to go ahead and always set it.
-	 */
-	(yy_did_buffer_switch_on_eof) = 1;
-}
-
-static void zconf_load_buffer_state  (void)
-{
-    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-	zconfin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-	(yy_hold_char) = *(yy_c_buf_p);
-}
-
-/** Allocate and initialize an input buffer state.
- * @param file A readable stream.
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * 
- * @return the allocated buffer state.
- */
-    YY_BUFFER_STATE zconf_create_buffer  (FILE * file, int  size )
-{
-	YY_BUFFER_STATE b;
-    
-	b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state )  );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
-
-	b->yy_buf_size = size;
-
-	/* yy_ch_buf has to be 2 characters longer than the size given because
-	 * we need to put in 2 end-of-buffer characters.
-	 */
-	b->yy_ch_buf = (char *) zconfalloc(b->yy_buf_size + 2  );
-	if ( ! b->yy_ch_buf )
-		YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
-
-	b->yy_is_our_buffer = 1;
-
-	zconf_init_buffer(b,file );
-
-	return b;
-}
-
-/** Destroy the buffer.
- * @param b a buffer created with zconf_create_buffer()
- * 
- */
-    void zconf_delete_buffer (YY_BUFFER_STATE  b )
-{
-    
-	if ( ! b )
-		return;
-
-	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
-
-	if ( b->yy_is_our_buffer )
-		zconffree((void *) b->yy_ch_buf  );
-
-	zconffree((void *) b  );
-}
-
-/* Initializes or reinitializes a buffer.
- * This function is sometimes called more than once on the same buffer,
- * such as during a zconfrestart() or at EOF.
- */
-    static void zconf_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
-
-{
-	int oerrno = errno;
-    
-	zconf_flush_buffer(b );
-
-	b->yy_input_file = file;
-	b->yy_fill_buffer = 1;
-
-    /* If b is the current buffer, then zconf_init_buffer was _probably_
-     * called from zconfrestart() or through yy_get_next_buffer.
-     * In that case, we don't want to reset the lineno or column.
-     */
-    if (b != YY_CURRENT_BUFFER){
-        b->yy_bs_lineno = 1;
-        b->yy_bs_column = 0;
-    }
-
-        b->yy_is_interactive = 0;
-    
-	errno = oerrno;
-}
-
-/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * 
- */
-    void zconf_flush_buffer (YY_BUFFER_STATE  b )
-{
-    	if ( ! b )
-		return;
-
-	b->yy_n_chars = 0;
-
-	/* We always need two end-of-buffer characters.  The first causes
-	 * a transition to the end-of-buffer state.  The second causes
-	 * a jam in that state.
-	 */
-	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-	b->yy_buf_pos = &b->yy_ch_buf[0];
-
-	b->yy_at_bol = 1;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	if ( b == YY_CURRENT_BUFFER )
-		zconf_load_buffer_state( );
-}
-
-/** Pushes the new state onto the stack. The new state becomes
- *  the current state. This function will allocate the stack
- *  if necessary.
- *  @param new_buffer The new state.
- *  
- */
-void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
-{
-    	if (new_buffer == NULL)
-		return;
-
-	zconfensure_buffer_stack();
-
-	/* This block is copied from zconf_switch_to_buffer. */
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*(yy_c_buf_p) = (yy_hold_char);
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-		}
-
-	/* Only push if top exists. Otherwise, replace top. */
-	if (YY_CURRENT_BUFFER)
-		(yy_buffer_stack_top)++;
-	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
-	/* copied from zconf_switch_to_buffer. */
-	zconf_load_buffer_state( );
-	(yy_did_buffer_switch_on_eof) = 1;
-}
-
-/** Removes and deletes the top of the stack, if present.
- *  The next element becomes the new top.
- *  
- */
-void zconfpop_buffer_state (void)
-{
-    	if (!YY_CURRENT_BUFFER)
-		return;
-
-	zconf_delete_buffer(YY_CURRENT_BUFFER );
-	YY_CURRENT_BUFFER_LVALUE = NULL;
-	if ((yy_buffer_stack_top) > 0)
-		--(yy_buffer_stack_top);
-
-	if (YY_CURRENT_BUFFER) {
-		zconf_load_buffer_state( );
-		(yy_did_buffer_switch_on_eof) = 1;
-	}
-}
-
-/* Allocates the stack if it does not exist.
- *  Guarantees space for at least one push.
- */
-static void zconfensure_buffer_stack (void)
-{
-	int num_to_alloc;
-    
-	if (!(yy_buffer_stack)) {
-
-		/* First allocation is just for 2 elements, since we don't know if this
-		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
-		 * immediate realloc on the next call.
-         */
-		num_to_alloc = 1;
-		(yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc
-								(num_to_alloc * sizeof(struct yy_buffer_state*)
-								);
-		if ( ! (yy_buffer_stack) )
-			YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" );
-								  
-		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-				
-		(yy_buffer_stack_max) = num_to_alloc;
-		(yy_buffer_stack_top) = 0;
-		return;
-	}
-
-	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
-		/* Increase the buffer to prepare for a possible push. */
-		int grow_size = 8 /* arbitrary grow size */;
-
-		num_to_alloc = (yy_buffer_stack_max) + grow_size;
-		(yy_buffer_stack) = (struct yy_buffer_state**)zconfrealloc
-								((yy_buffer_stack),
-								num_to_alloc * sizeof(struct yy_buffer_state*)
-								);
-		if ( ! (yy_buffer_stack) )
-			YY_FATAL_ERROR( "out of dynamic memory in zconfensure_buffer_stack()" );
-
-		/* zero only the new slots.*/
-		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
-		(yy_buffer_stack_max) = num_to_alloc;
-	}
-}
-
-/** Setup the input buffer state to scan directly from a user-specified character buffer.
- * @param base the character buffer
- * @param size the size in bytes of the character buffer
- * 
- * @return the newly allocated buffer state object. 
- */
-YY_BUFFER_STATE zconf_scan_buffer  (char * base, yy_size_t  size )
-{
-	YY_BUFFER_STATE b;
-    
-	if ( size < 2 ||
-	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
-	     base[size-1] != YY_END_OF_BUFFER_CHAR )
-		/* They forgot to leave room for the EOB's. */
-		return 0;
-
-	b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state )  );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_buffer()" );
-
-	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
-	b->yy_buf_pos = b->yy_ch_buf = base;
-	b->yy_is_our_buffer = 0;
-	b->yy_input_file = 0;
-	b->yy_n_chars = b->yy_buf_size;
-	b->yy_is_interactive = 0;
-	b->yy_at_bol = 1;
-	b->yy_fill_buffer = 0;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	zconf_switch_to_buffer(b  );
-
-	return b;
-}
-
-/** Setup the input buffer state to scan a string. The next call to zconflex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
- * 
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- *       zconf_scan_bytes() instead.
- */
-YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
-{
-    
-	return zconf_scan_bytes(yystr,strlen(yystr) );
-}
-
-/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will
- * scan from a @e copy of @a bytes.
- * @param yybytes the byte buffer to scan
- * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
- * 
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE zconf_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
-{
-	YY_BUFFER_STATE b;
-	char *buf;
-	yy_size_t n;
-	int i;
-    
-	/* Get memory for full buffer, including space for trailing EOB's. */
-	n = _yybytes_len + 2;
-	buf = (char *) zconfalloc(n  );
-	if ( ! buf )
-		YY_FATAL_ERROR( "out of dynamic memory in zconf_scan_bytes()" );
-
-	for ( i = 0; i < _yybytes_len; ++i )
-		buf[i] = yybytes[i];
-
-	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
-
-	b = zconf_scan_buffer(buf,n );
-	if ( ! b )
-		YY_FATAL_ERROR( "bad buffer in zconf_scan_bytes()" );
-
-	/* It's okay to grow etc. this buffer, and we should throw it
-	 * away when we're done.
-	 */
-	b->yy_is_our_buffer = 1;
-
-	return b;
-}
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-static void yy_fatal_error (yyconst char* msg )
-{
-    	(void) fprintf( stderr, "%s\n", msg );
-	exit( YY_EXIT_FAILURE );
-}
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up zconftext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-		zconftext[zconfleng] = (yy_hold_char); \
-		(yy_c_buf_p) = zconftext + yyless_macro_arg; \
-		(yy_hold_char) = *(yy_c_buf_p); \
-		*(yy_c_buf_p) = '\0'; \
-		zconfleng = yyless_macro_arg; \
-		} \
-	while ( 0 )
-
-/* Accessor  methods (get/set functions) to struct members. */
-
-/** Get the current line number.
- * 
- */
-int zconfget_lineno  (void)
-{
-        
-    return zconflineno;
-}
-
-/** Get the input stream.
- * 
- */
-FILE *zconfget_in  (void)
-{
-        return zconfin;
-}
-
-/** Get the output stream.
- * 
- */
-FILE *zconfget_out  (void)
-{
-        return zconfout;
-}
-
-/** Get the length of the current token.
- * 
- */
-int zconfget_leng  (void)
-{
-        return zconfleng;
-}
-
-/** Get the current token.
- * 
- */
-
-char *zconfget_text  (void)
-{
-        return zconftext;
-}
-
-/** Set the current line number.
- * @param line_number
- * 
- */
-void zconfset_lineno (int  line_number )
-{
-    
-    zconflineno = line_number;
-}
-
-/** Set the input stream. This does not discard the current
- * input buffer.
- * @param in_str A readable stream.
- * 
- * @see zconf_switch_to_buffer
- */
-void zconfset_in (FILE *  in_str )
-{
-        zconfin = in_str ;
-}
-
-void zconfset_out (FILE *  out_str )
-{
-        zconfout = out_str ;
-}
-
-int zconfget_debug  (void)
-{
-        return zconf_flex_debug;
-}
-
-void zconfset_debug (int  bdebug )
-{
-        zconf_flex_debug = bdebug ;
-}
-
-static int yy_init_globals (void)
-{
-        /* Initialization is the same as for the non-reentrant scanner.
-     * This function is called from zconflex_destroy(), so don't allocate here.
-     */
-
-    (yy_buffer_stack) = 0;
-    (yy_buffer_stack_top) = 0;
-    (yy_buffer_stack_max) = 0;
-    (yy_c_buf_p) = (char *) 0;
-    (yy_init) = 0;
-    (yy_start) = 0;
-
-/* Defined in main.c */
-#ifdef YY_STDINIT
-    zconfin = stdin;
-    zconfout = stdout;
-#else
-    zconfin = (FILE *) 0;
-    zconfout = (FILE *) 0;
-#endif
-
-    /* For future reference: Set errno on error, since we are called by
-     * zconflex_init()
-     */
-    return 0;
-}
-
-/* zconflex_destroy is for both reentrant and non-reentrant scanners. */
-int zconflex_destroy  (void)
-{
-    
-    /* Pop the buffer stack, destroying each element. */
-	while(YY_CURRENT_BUFFER){
-		zconf_delete_buffer(YY_CURRENT_BUFFER  );
-		YY_CURRENT_BUFFER_LVALUE = NULL;
-		zconfpop_buffer_state();
-	}
-
-	/* Destroy the stack itself. */
-	zconffree((yy_buffer_stack) );
-	(yy_buffer_stack) = NULL;
-
-    /* Reset the globals. This is important in a non-reentrant scanner so the next time
-     * zconflex() is called, initialization will occur. */
-    yy_init_globals( );
-
-    return 0;
-}
-
-/*
- * Internal utility routines.
- */
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
-{
-	register int i;
-	for ( i = 0; i < n; ++i )
-		s1[i] = s2[i];
-}
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s )
-{
-	register int n;
-	for ( n = 0; s[n]; ++n )
-		;
-
-	return n;
-}
-#endif
-
-void *zconfalloc (yy_size_t  size )
-{
-	return (void *) malloc( size );
-}
-
-void *zconfrealloc  (void * ptr, yy_size_t  size )
-{
-	/* The cast to (char *) in the following accommodates both
-	 * implementations that use char* generic pointers, and those
-	 * that use void* generic pointers.  It works with the latter
-	 * because both ANSI C and C++ allow castless assignment from
-	 * any pointer type to void*, and deal with argument conversions
-	 * as though doing an assignment.
-	 */
-	return (void *) realloc( (char *) ptr, size );
-}
-
-void zconffree (void * ptr )
-{
-	free( (char *) ptr );	/* see zconfrealloc() for (char *) cast */
-}
-
-#define YYTABLES_NAME "yytables"
-
-void zconf_starthelp(void)
-{
-	new_string();
-	last_ts = first_ts = 0;
-	BEGIN(HELP);
-}
-
-static void zconf_endhelp(void)
-{
-	zconflval.string = text;
-	BEGIN(INITIAL);
-}
-
-/*
- * Try to open specified file with following names:
- * ./name
- * $(srctree)/name
- * The latter is used when srctree is separate from objtree
- * when compiling the kernel.
- * Return NULL if file is not found.
- */
-FILE *zconf_fopen(const char *name)
-{
-	char *env, fullname[PATH_MAX+1];
-	FILE *f;
-
-	f = fopen(name, "r");
-	if (!f && name != NULL && name[0] != '/') {
-		env = getenv(SRCTREE);
-		if (env) {
-			sprintf(fullname, "%s/%s", env, name);
-			f = fopen(fullname, "r");
-		}
-	}
-	return f;
-}
-
-void zconf_initscan(const char *name)
-{
-	zconfin = zconf_fopen(name);
-	if (!zconfin) {
-		printf("can't find file %s\n", name);
-		exit(1);
-	}
-
-	current_buf = xmalloc(sizeof(*current_buf));
-	memset(current_buf, 0, sizeof(*current_buf));
-
-	current_file = file_lookup(name);
-	current_file->lineno = 1;
-}
-
-void zconf_nextfile(const char *name)
-{
-	struct file *iter;
-	struct file *file = file_lookup(name);
-	struct buffer *buf = xmalloc(sizeof(*buf));
-	memset(buf, 0, sizeof(*buf));
-
-	current_buf->state = YY_CURRENT_BUFFER;
-	zconfin = zconf_fopen(file->name);
-	if (!zconfin) {
-		printf("%s:%d: can't open file \"%s\"\n",
-		    zconf_curname(), zconf_lineno(), file->name);
-		exit(1);
-	}
-	zconf_switch_to_buffer(zconf_create_buffer(zconfin,YY_BUF_SIZE));
-	buf->parent = current_buf;
-	current_buf = buf;
-
-	for (iter = current_file->parent; iter; iter = iter->parent ) {
-		if (!strcmp(current_file->name,iter->name) ) {
-			printf("%s:%d: recursive inclusion detected. "
-			       "Inclusion path:\n  current file : '%s'\n",
-			       zconf_curname(), zconf_lineno(),
-			       zconf_curname());
-			iter = current_file->parent;
-			while (iter && \
-			       strcmp(iter->name,current_file->name)) {
-				printf("  included from: '%s:%d'\n",
-				       iter->name, iter->lineno-1);
-				iter = iter->parent;
-			}
-			if (iter)
-				printf("  included from: '%s:%d'\n",
-				       iter->name, iter->lineno+1);
-			exit(1);
-		}
-	}
-	file->lineno = 1;
-	file->parent = current_file;
-	current_file = file;
-}
-
-static void zconf_endfile(void)
-{
-	struct buffer *parent;
-
-	current_file = current_file->parent;
-
-	parent = current_buf->parent;
-	if (parent) {
-		fclose(zconfin);
-		zconf_delete_buffer(YY_CURRENT_BUFFER);
-		zconf_switch_to_buffer(parent->state);
-	}
-	free(current_buf);
-	current_buf = parent;
-}
-
-int zconf_lineno(void)
-{
-	return current_pos.lineno;
-}
-
-const char *zconf_curname(void)
-{
-	return current_pos.file ? current_pos.file->name : "<none>";
-}
-
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped
deleted file mode 100644
index 65b7515a577c..000000000000
--- a/scripts/kconfig/zconf.tab.c_shipped
+++ /dev/null
@@ -1,2471 +0,0 @@
-/* A Bison parser, made by GNU Bison 3.0.4.  */
-
-/* Bison implementation for Yacc-like parsers in C
-
-   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-/* C LALR(1) parser skeleton written by Richard Stallman, by
-   simplifying the original so-called "semantic" parser.  */
-
-/* All symbols defined below should begin with yy or YY, to avoid
-   infringing on user name space.  This should be done even for local
-   variables, as they might otherwise be expanded by user macros.
-   There are some unavoidable exceptions within include files to
-   define necessary library symbols; they are noted "INFRINGES ON
-   USER NAME SPACE" below.  */
-
-/* Identify Bison output.  */
-#define YYBISON 1
-
-/* Bison version.  */
-#define YYBISON_VERSION "3.0.4"
-
-/* Skeleton name.  */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers.  */
-#define YYPURE 0
-
-/* Push parsers.  */
-#define YYPUSH 0
-
-/* Pull parsers.  */
-#define YYPULL 1
-
-
-/* Substitute the variable and function names.  */
-#define yyparse         zconfparse
-#define yylex           zconflex
-#define yyerror         zconferror
-#define yydebug         zconfdebug
-#define yynerrs         zconfnerrs
-
-#define yylval          zconflval
-#define yychar          zconfchar
-
-/* Copy the first part of user declarations.  */
-
-
-/*
- * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
- * Released under the terms of the GNU GPL v2.0.
- */
-
-#include <ctype.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdbool.h>
-
-#include "lkc.h"
-
-#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
-
-#define PRINTD		0x0001
-#define DEBUG_PARSE	0x0002
-
-int cdebug = PRINTD;
-
-extern int zconflex(void);
-static void zconfprint(const char *err, ...);
-static void zconf_error(const char *err, ...);
-static void zconferror(const char *err);
-static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
-
-struct symbol *symbol_hash[SYMBOL_HASHSIZE];
-
-static struct menu *current_menu, *current_entry;
-
-
-
-
-# ifndef YY_NULLPTR
-#  if defined __cplusplus && 201103L <= __cplusplus
-#   define YY_NULLPTR nullptr
-#  else
-#   define YY_NULLPTR 0
-#  endif
-# endif
-
-/* Enabling verbose error messages.  */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-
-/* Debug traces.  */
-#ifndef YYDEBUG
-# define YYDEBUG 1
-#endif
-#if YYDEBUG
-extern int zconfdebug;
-#endif
-
-/* Token type.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-  enum yytokentype
-  {
-    T_MAINMENU = 258,
-    T_MENU = 259,
-    T_ENDMENU = 260,
-    T_SOURCE = 261,
-    T_CHOICE = 262,
-    T_ENDCHOICE = 263,
-    T_COMMENT = 264,
-    T_CONFIG = 265,
-    T_MENUCONFIG = 266,
-    T_HELP = 267,
-    T_HELPTEXT = 268,
-    T_IF = 269,
-    T_ENDIF = 270,
-    T_DEPENDS = 271,
-    T_OPTIONAL = 272,
-    T_PROMPT = 273,
-    T_TYPE = 274,
-    T_DEFAULT = 275,
-    T_SELECT = 276,
-    T_IMPLY = 277,
-    T_RANGE = 278,
-    T_VISIBLE = 279,
-    T_OPTION = 280,
-    T_ON = 281,
-    T_WORD = 282,
-    T_WORD_QUOTE = 283,
-    T_UNEQUAL = 284,
-    T_LESS = 285,
-    T_LESS_EQUAL = 286,
-    T_GREATER = 287,
-    T_GREATER_EQUAL = 288,
-    T_CLOSE_PAREN = 289,
-    T_OPEN_PAREN = 290,
-    T_EOL = 291,
-    T_OR = 292,
-    T_AND = 293,
-    T_EQUAL = 294,
-    T_NOT = 295
-  };
-#endif
-
-/* Value type.  */
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
-union YYSTYPE
-{
-
-
-	char *string;
-	struct file *file;
-	struct symbol *symbol;
-	struct expr *expr;
-	struct menu *menu;
-	const struct kconf_id *id;
-
-
-};
-
-typedef union YYSTYPE YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-
-extern YYSTYPE zconflval;
-
-int zconfparse (void);
-
-
-
-/* Copy the second part of user declarations.  */
-
-
-/* Include zconf.hash.c here so it can see the token constants. */
-#include "zconf.hash.c"
-
-
-
-#ifdef short
-# undef short
-#endif
-
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
-#endif
-
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#else
-typedef signed char yytype_int8;
-#endif
-
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
-#else
-typedef unsigned short int yytype_uint16;
-#endif
-
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
-#else
-typedef short int yytype_int16;
-#endif
-
-#ifndef YYSIZE_T
-# ifdef __SIZE_TYPE__
-#  define YYSIZE_T __SIZE_TYPE__
-# elif defined size_t
-#  define YYSIZE_T size_t
-# elif ! defined YYSIZE_T
-#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYSIZE_T size_t
-# else
-#  define YYSIZE_T unsigned int
-# endif
-#endif
-
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-
-#ifndef YY_
-# if defined YYENABLE_NLS && YYENABLE_NLS
-#  if ENABLE_NLS
-#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
-#  endif
-# endif
-# ifndef YY_
-#  define YY_(Msgid) Msgid
-# endif
-#endif
-
-#ifndef YY_ATTRIBUTE
-# if (defined __GNUC__                                               \
-      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
-     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
-#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
-# else
-#  define YY_ATTRIBUTE(Spec) /* empty */
-# endif
-#endif
-
-#ifndef YY_ATTRIBUTE_PURE
-# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
-#endif
-
-#ifndef YY_ATTRIBUTE_UNUSED
-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
-#endif
-
-#if !defined _Noreturn \
-     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-# if defined _MSC_VER && 1200 <= _MSC_VER
-#  define _Noreturn __declspec (noreturn)
-# else
-#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
-# endif
-#endif
-
-/* Suppress unused-variable warnings by "using" E.  */
-#if ! defined lint || defined __GNUC__
-# define YYUSE(E) ((void) (E))
-#else
-# define YYUSE(E) /* empty */
-#endif
-
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
-/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
-    _Pragma ("GCC diagnostic push") \
-    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
-    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
-    _Pragma ("GCC diagnostic pop")
-#else
-# define YY_INITIAL_VALUE(Value) Value
-#endif
-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END
-#endif
-#ifndef YY_INITIAL_VALUE
-# define YY_INITIAL_VALUE(Value) /* Nothing. */
-#endif
-
-
-#if ! defined yyoverflow || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols.  */
-
-# ifdef YYSTACK_USE_ALLOCA
-#  if YYSTACK_USE_ALLOCA
-#   ifdef __GNUC__
-#    define YYSTACK_ALLOC __builtin_alloca
-#   elif defined __BUILTIN_VA_ARG_INCR
-#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
-#   elif defined _AIX
-#    define YYSTACK_ALLOC __alloca
-#   elif defined _MSC_VER
-#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
-#    define alloca _alloca
-#   else
-#    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
-#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
-#     ifndef EXIT_SUCCESS
-#      define EXIT_SUCCESS 0
-#     endif
-#    endif
-#   endif
-#  endif
-# endif
-
-# ifdef YYSTACK_ALLOC
-   /* Pacify GCC's 'empty if-body' warning.  */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-#  ifndef YYSTACK_ALLOC_MAXIMUM
-    /* The OS might guarantee only one guard page at the bottom of the stack,
-       and a page size can be as small as 4096 bytes.  So we cannot safely
-       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
-       to allow for a few compiler-allocated temporary stack slots.  */
-#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
-#  endif
-# else
-#  define YYSTACK_ALLOC YYMALLOC
-#  define YYSTACK_FREE YYFREE
-#  ifndef YYSTACK_ALLOC_MAXIMUM
-#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
-#  endif
-#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
-       && ! ((defined YYMALLOC || defined malloc) \
-             && (defined YYFREE || defined free)))
-#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   ifndef EXIT_SUCCESS
-#    define EXIT_SUCCESS 0
-#   endif
-#  endif
-#  ifndef YYMALLOC
-#   define YYMALLOC malloc
-#   if ! defined malloc && ! defined EXIT_SUCCESS
-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-#   endif
-#  endif
-#  ifndef YYFREE
-#   define YYFREE free
-#   if ! defined free && ! defined EXIT_SUCCESS
-void free (void *); /* INFRINGES ON USER NAME SPACE */
-#   endif
-#  endif
-# endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
-
-#if (! defined yyoverflow \
-     && (! defined __cplusplus \
-         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member.  */
-union yyalloc
-{
-  yytype_int16 yyss_alloc;
-  YYSTYPE yyvs_alloc;
-};
-
-/* The size of the maximum gap between one aligned stack and the next.  */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
-   N elements.  */
-# define YYSTACK_BYTES(N) \
-     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
-      + YYSTACK_GAP_MAXIMUM)
-
-# define YYCOPY_NEEDED 1
-
-/* Relocate STACK from its old location to the new one.  The
-   local variables YYSIZE and YYSTACKSIZE give the old and new number of
-   elements in the stack, and YYPTR gives the new location of the
-   stack.  Advance YYPTR to a properly aligned location for the next
-   stack.  */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
-    do                                                                  \
-      {                                                                 \
-        YYSIZE_T yynewbytes;                                            \
-        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
-        Stack = &yyptr->Stack_alloc;                                    \
-        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-        yyptr += yynewbytes / sizeof (*yyptr);                          \
-      }                                                                 \
-    while (0)
-
-#endif
-
-#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
-/* Copy COUNT objects from SRC to DST.  The source and destination do
-   not overlap.  */
-# ifndef YYCOPY
-#  if defined __GNUC__ && 1 < __GNUC__
-#   define YYCOPY(Dst, Src, Count) \
-      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
-#  else
-#   define YYCOPY(Dst, Src, Count)              \
-      do                                        \
-        {                                       \
-          YYSIZE_T yyi;                         \
-          for (yyi = 0; yyi < (Count); yyi++)   \
-            (Dst)[yyi] = (Src)[yyi];            \
-        }                                       \
-      while (0)
-#  endif
-# endif
-#endif /* !YYCOPY_NEEDED */
-
-/* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  11
-/* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   301
-
-/* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  41
-/* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  50
-/* YYNRULES -- Number of rules.  */
-#define YYNRULES  124
-/* YYNSTATES -- Number of states.  */
-#define YYNSTATES  204
-
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
-   by yylex, with out-of-bounds checking.  */
-#define YYUNDEFTOK  2
-#define YYMAXUTOK   295
-
-#define YYTRANSLATE(YYX)                                                \
-  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
-   as returned by yylex, without out-of-bounds checking.  */
-static const yytype_uint8 yytranslate[] =
-{
-       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
-       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
-      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
-      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
-      35,    36,    37,    38,    39,    40
-};
-
-#if YYDEBUG
-  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
-static const yytype_uint16 yyrline[] =
-{
-       0,   109,   109,   109,   111,   111,   113,   115,   116,   117,
-     118,   119,   120,   124,   128,   128,   128,   128,   128,   128,
-     128,   128,   128,   132,   133,   134,   135,   136,   137,   141,
-     142,   148,   156,   162,   170,   180,   182,   183,   184,   185,
-     186,   187,   190,   198,   204,   214,   220,   226,   232,   235,
-     237,   248,   249,   254,   263,   268,   276,   279,   281,   282,
-     283,   284,   285,   288,   294,   305,   311,   321,   323,   328,
-     336,   344,   347,   349,   350,   351,   356,   363,   370,   375,
-     383,   386,   388,   389,   390,   393,   401,   408,   415,   421,
-     428,   430,   431,   432,   435,   443,   445,   446,   449,   456,
-     458,   463,   464,   467,   468,   469,   473,   474,   477,   478,
-     481,   482,   483,   484,   485,   486,   487,   488,   489,   490,
-     491,   494,   495,   498,   499
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE || 0
-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting@YYNTOKENS, nonterminals.  */
-static const char *const yytname[] =
-{
-  "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
-  "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
-  "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
-  "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_IMPLY",
-  "T_RANGE", "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE",
-  "T_UNEQUAL", "T_LESS", "T_LESS_EQUAL", "T_GREATER", "T_GREATER_EQUAL",
-  "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
-  "T_NOT", "$accept", "input", "start", "stmt_list", "option_name",
-  "common_stmt", "option_error", "config_entry_start", "config_stmt",
-  "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
-  "config_option", "symbol_option", "symbol_option_list",
-  "symbol_option_arg", "choice", "choice_entry", "choice_end",
-  "choice_stmt", "choice_option_list", "choice_option", "choice_block",
-  "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu",
-  "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt",
-  "comment", "comment_stmt", "help_start", "help", "depends_list",
-  "depends", "visibility_list", "visible", "prompt_stmt_opt", "prompt",
-  "end", "nl", "if_expr", "expr", "symbol", "word_opt", YY_NULLPTR
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[NUM] -- (External) token number corresponding to the
-   (internal) symbol number NUM (which must be that of a token).  */
-static const yytype_uint16 yytoknum[] =
-{
-       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
-     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
-     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295
-};
-# endif
-
-#define YYPACT_NINF -92
-
-#define yypact_value_is_default(Yystate) \
-  (!!((Yystate) == (-92)))
-
-#define YYTABLE_NINF -88
-
-#define yytable_value_is_error(Yytable_value) \
-  0
-
-  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-     STATE-NUM.  */
-static const yytype_int16 yypact[] =
-{
-      17,    41,   -92,    15,   -92,   150,   -92,    19,   -92,   -92,
-     -13,   -92,    28,    41,    38,    41,    50,    47,    41,    79,
-      82,    44,    76,   -92,   -92,   -92,   -92,   -92,   -92,   -92,
-     -92,   -92,   118,   -92,   129,   -92,   -92,   -92,   -92,   -92,
-     -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,
-     -92,   -92,   184,   -92,   -92,   107,   -92,   111,   -92,   113,
-     -92,   116,   -92,   139,   140,   151,   -92,   -92,    44,    44,
-     142,   256,   -92,   160,   173,    27,   117,    80,    51,   255,
-     -15,   255,   217,   -92,   -92,   -92,   -92,   -92,   -92,    -8,
-     -92,    44,    44,   107,    87,    87,    87,    87,    87,    87,
-     -92,   -92,   174,   176,   187,    41,    41,    44,   188,   189,
-      87,   -92,   213,   -92,   -92,   -92,   -92,   206,   -92,   -92,
-     193,    41,    41,   203,   -92,   -92,   -92,   -92,   -92,   -92,
-     -92,   -92,   -92,   -92,   -92,   -92,   -92,   229,   -92,   241,
-     -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,
-     216,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,
-      44,   229,   222,   229,    64,   229,   229,    87,    31,   231,
-     -92,   -92,   229,   236,   229,    44,   -92,   145,   242,   -92,
-     -92,   243,   244,   245,   229,   251,   -92,   -92,   247,   -92,
-     257,   125,   -92,   -92,   -92,   -92,   -92,   260,    41,   -92,
-     -92,   -92,   -92,   -92
-};
-
-  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
-     Performed when YYTABLE does not specify something else to do.  Zero
-     means the default is an error.  */
-static const yytype_uint8 yydefact[] =
-{
-       6,     0,   106,     0,     3,     0,     6,     6,   101,   102,
-       0,     1,     0,     0,     0,     0,   123,     0,     0,     0,
-       0,     0,     0,    14,    19,    15,    16,    21,    17,    18,
-      20,    22,     0,    23,     0,     7,    35,    26,    35,    27,
-      57,    67,     8,    72,    24,    95,    81,     9,    28,    90,
-      25,    10,     0,   107,     2,    76,    13,     0,   103,     0,
-     124,     0,   104,     0,     0,     0,   121,   122,     0,     0,
-       0,   110,   105,     0,     0,     0,     0,     0,     0,     0,
-      90,     0,     0,    77,    85,    53,    86,    31,    33,     0,
-     118,     0,     0,    69,     0,     0,     0,     0,     0,     0,
-      11,    12,     0,     0,     0,     0,    99,     0,     0,     0,
-       0,    49,     0,    41,    40,    36,    37,     0,    39,    38,
-       0,     0,    99,     0,    61,    62,    58,    60,    59,    68,
-      56,    55,    73,    75,    71,    74,    70,   108,    97,     0,
-      96,    82,    84,    80,    83,    79,    92,    93,    91,   117,
-     119,   120,   116,   111,   112,   113,   114,   115,    30,    88,
-       0,   108,     0,   108,   108,   108,   108,     0,     0,     0,
-      89,    65,   108,     0,   108,     0,    98,     0,     0,    42,
-     100,     0,     0,     0,   108,    51,    48,    29,     0,    64,
-       0,   109,    94,    43,    44,    45,    46,     0,     0,    50,
-      63,    66,    47,    52
-};
-
-  /* YYPGOTO[NTERM-NUM].  */
-static const yytype_int16 yypgoto[] =
-{
-     -92,   -92,   285,   291,   -92,    32,   -66,   -92,   -92,   -92,
-     -92,   261,   -92,   -92,   -92,   -92,   -92,   -92,   -92,     1,
-     -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,
-     -92,    24,   -92,   -92,   -92,   -92,   -92,   221,   220,   -64,
-     -92,   -92,   179,    -1,    67,     0,   110,   -67,   -91,   -92
-};
-
-  /* YYDEFGOTO[NTERM-NUM].  */
-static const yytype_int16 yydefgoto[] =
-{
-      -1,     3,     4,     5,    34,    35,   114,    36,    37,    38,
-      39,    75,   115,   116,   168,   199,    40,    41,   130,    42,
-      77,   126,    78,    43,   134,    44,    79,     6,    45,    46,
-     143,    47,    81,    48,    49,    50,   117,   118,    82,   119,
-      80,   140,   162,   163,    51,     7,   176,    70,    71,    61
-};
-
-  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
-     positive, shift that token.  If negative, reduce the rule whose
-     number is the opposite.  If YYTABLE_NINF, syntax error.  */
-static const yytype_int16 yytable[] =
-{
-      10,    89,    90,   152,   153,   154,   155,   156,   157,   137,
-      55,   125,    57,   128,    59,    11,   147,    63,   148,   167,
-       1,   138,     1,     2,   150,   151,   149,   -32,   102,    91,
-      92,   -32,   -32,   -32,   -32,   -32,   -32,   -32,   -32,   103,
-     164,   -32,   -32,   104,   -32,   105,   106,   107,   108,   109,
-     110,   -32,   111,     2,   112,    53,    14,    15,   185,    17,
-      18,    19,    20,   113,    56,    21,    22,   186,     8,     9,
-      93,    66,    67,   147,    58,   148,   184,    60,   175,    68,
-     133,   102,   142,    62,    69,   -54,   -54,    33,   -54,   -54,
-     -54,   -54,   103,   177,   -54,   -54,   104,   120,   121,   122,
-     123,    91,    92,   135,   161,   144,    64,   112,   191,    65,
-     129,   132,    72,   141,    66,    67,   124,   -34,   102,    73,
-     172,   -34,   -34,   -34,   -34,   -34,   -34,   -34,   -34,   103,
-      74,   -34,   -34,   104,   -34,   105,   106,   107,   108,   109,
-     110,   -34,   111,    53,   112,   131,   136,    83,   145,    84,
-      -5,    12,    85,   113,    13,    14,    15,    16,    17,    18,
-      19,    20,    91,    92,    21,    22,    23,    24,    25,    26,
-      27,    28,    29,    30,    31,    86,    87,    32,     2,    91,
-      92,   192,    91,    92,    -4,    12,    33,    88,    13,    14,
-      15,    16,    17,    18,    19,    20,   100,   203,    21,    22,
-      23,    24,    25,    26,    27,    28,    29,    30,    31,   101,
-     158,    32,   159,   160,   169,   165,   166,   -87,   102,   170,
-      33,   -87,   -87,   -87,   -87,   -87,   -87,   -87,   -87,   171,
-     174,   -87,   -87,   104,   -87,   -87,   -87,   -87,   -87,   -87,
-     -87,   -87,   102,   175,   112,   -78,   -78,   -78,   -78,   -78,
-     -78,   -78,   -78,   146,    92,   -78,   -78,   104,   179,    13,
-      14,    15,    16,    17,    18,    19,    20,   187,   112,    21,
-      22,   178,   189,   180,   181,   182,   183,   146,   193,   194,
-     195,   196,   188,   200,   190,    94,    95,    96,    97,    98,
-     198,    33,    54,   201,   197,    99,   202,    52,   127,    76,
-     139,   173
-};
-
-static const yytype_uint8 yycheck[] =
-{
-       1,    68,    69,    94,    95,    96,    97,    98,    99,    24,
-      10,    77,    13,    77,    15,     0,    82,    18,    82,   110,
-       3,    36,     3,    36,    91,    92,    34,     0,     1,    37,
-      38,     4,     5,     6,     7,     8,     9,    10,    11,    12,
-     107,    14,    15,    16,    17,    18,    19,    20,    21,    22,
-      23,    24,    25,    36,    27,    36,     5,     6,    27,     8,
-       9,    10,    11,    36,    36,    14,    15,    36,    27,    28,
-      70,    27,    28,   139,    36,   139,   167,    27,    14,    35,
-      79,     1,    81,    36,    40,     5,     6,    36,     8,     9,
-      10,    11,    12,   160,    14,    15,    16,    17,    18,    19,
-      20,    37,    38,    79,   105,    81,    27,    27,   175,    27,
-      78,    79,    36,    81,    27,    28,    36,     0,     1,     1,
-     121,     4,     5,     6,     7,     8,     9,    10,    11,    12,
-       1,    14,    15,    16,    17,    18,    19,    20,    21,    22,
-      23,    24,    25,    36,    27,    78,    79,    36,    81,    36,
-       0,     1,    36,    36,     4,     5,     6,     7,     8,     9,
-      10,    11,    37,    38,    14,    15,    16,    17,    18,    19,
-      20,    21,    22,    23,    24,    36,    36,    27,    36,    37,
-      38,    36,    37,    38,     0,     1,    36,    36,     4,     5,
-       6,     7,     8,     9,    10,    11,    36,   198,    14,    15,
-      16,    17,    18,    19,    20,    21,    22,    23,    24,    36,
-      36,    27,    36,    26,     1,    27,    27,     0,     1,    13,
-      36,     4,     5,     6,     7,     8,     9,    10,    11,    36,
-      27,    14,    15,    16,    17,    18,    19,    20,    21,    22,
-      23,    24,     1,    14,    27,     4,     5,     6,     7,     8,
-       9,    10,    11,    36,    38,    14,    15,    16,    36,     4,
-       5,     6,     7,     8,     9,    10,    11,    36,    27,    14,
-      15,   161,    36,   163,   164,   165,   166,    36,    36,    36,
-      36,    36,   172,    36,   174,    29,    30,    31,    32,    33,
-      39,    36,     7,    36,   184,    39,    36,     6,    77,    38,
-      80,   122
-};
-
-  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-     symbol of state STATE-NUM.  */
-static const yytype_uint8 yystos[] =
-{
-       0,     3,    36,    42,    43,    44,    68,    86,    27,    28,
-      84,     0,     1,     4,     5,     6,     7,     8,     9,    10,
-      11,    14,    15,    16,    17,    18,    19,    20,    21,    22,
-      23,    24,    27,    36,    45,    46,    48,    49,    50,    51,
-      57,    58,    60,    64,    66,    69,    70,    72,    74,    75,
-      76,    85,    44,    36,    43,    86,    36,    84,    36,    84,
-      27,    90,    36,    84,    27,    27,    27,    28,    35,    40,
-      88,    89,    36,     1,     1,    52,    52,    61,    63,    67,
-      81,    73,    79,    36,    36,    36,    36,    36,    36,    88,
-      88,    37,    38,    86,    29,    30,    31,    32,    33,    39,
-      36,    36,     1,    12,    16,    18,    19,    20,    21,    22,
-      23,    25,    27,    36,    47,    53,    54,    77,    78,    80,
-      17,    18,    19,    20,    36,    47,    62,    78,    80,    46,
-      59,    85,    46,    60,    65,    72,    85,    24,    36,    79,
-      82,    46,    60,    71,    72,    85,    36,    47,    80,    34,
-      88,    88,    89,    89,    89,    89,    89,    89,    36,    36,
-      26,    84,    83,    84,    88,    27,    27,    89,    55,     1,
-      13,    36,    84,    83,    27,    14,    87,    88,    87,    36,
-      87,    87,    87,    87,    89,    27,    36,    36,    87,    36,
-      87,    88,    36,    36,    36,    36,    36,    87,    39,    56,
-      36,    36,    36,    84
-};
-
-  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const yytype_uint8 yyr1[] =
-{
-       0,    41,    42,    42,    43,    43,    44,    44,    44,    44,
-      44,    44,    44,    44,    45,    45,    45,    45,    45,    45,
-      45,    45,    45,    46,    46,    46,    46,    46,    46,    47,
-      47,    48,    49,    50,    51,    52,    52,    52,    52,    52,
-      52,    52,    53,    53,    53,    53,    53,    53,    54,    55,
-      55,    56,    56,    57,    58,    59,    60,    61,    61,    61,
-      61,    61,    61,    62,    62,    62,    62,    63,    63,    64,
-      65,    66,    67,    67,    67,    67,    68,    69,    70,    71,
-      72,    73,    73,    73,    73,    74,    75,    76,    77,    78,
-      79,    79,    79,    79,    80,    81,    81,    81,    82,    83,
-      83,    84,    84,    85,    85,    85,    86,    86,    87,    87,
-      88,    88,    88,    88,    88,    88,    88,    88,    88,    88,
-      88,    89,    89,    90,    90
-};
-
-  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
-static const yytype_uint8 yyr2[] =
-{
-       0,     2,     2,     1,     2,     1,     0,     2,     2,     2,
-       2,     4,     4,     3,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     3,
-       2,     3,     2,     3,     2,     0,     2,     2,     2,     2,
-       2,     2,     3,     4,     4,     4,     4,     5,     3,     0,
-       3,     0,     2,     3,     2,     1,     3,     0,     2,     2,
-       2,     2,     2,     4,     3,     2,     4,     0,     2,     3,
-       1,     3,     0,     2,     2,     2,     3,     3,     3,     1,
-       3,     0,     2,     2,     2,     3,     3,     2,     2,     2,
-       0,     2,     2,     2,     4,     0,     2,     2,     2,     0,
-       2,     1,     1,     2,     2,     2,     1,     2,     0,     2,
-       1,     3,     3,     3,     3,     3,     3,     3,     2,     3,
-       3,     1,     1,     0,     1
-};
-
-
-#define yyerrok         (yyerrstatus = 0)
-#define yyclearin       (yychar = YYEMPTY)
-#define YYEMPTY         (-2)
-#define YYEOF           0
-
-#define YYACCEPT        goto yyacceptlab
-#define YYABORT         goto yyabortlab
-#define YYERROR         goto yyerrorlab
-
-
-#define YYRECOVERING()  (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value)                                  \
-do                                                              \
-  if (yychar == YYEMPTY)                                        \
-    {                                                           \
-      yychar = (Token);                                         \
-      yylval = (Value);                                         \
-      YYPOPSTACK (yylen);                                       \
-      yystate = *yyssp;                                         \
-      goto yybackup;                                            \
-    }                                                           \
-  else                                                          \
-    {                                                           \
-      yyerror (YY_("syntax error: cannot back up")); \
-      YYERROR;                                                  \
-    }                                                           \
-while (0)
-
-/* Error token number */
-#define YYTERROR        1
-#define YYERRCODE       256
-
-
-
-/* Enable debugging if requested.  */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args)                        \
-do {                                            \
-  if (yydebug)                                  \
-    YYFPRINTF Args;                             \
-} while (0)
-
-/* This macro is provided for backward compatibility. */
-#ifndef YY_LOCATION_PRINT
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-#endif
-
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
-do {                                                                      \
-  if (yydebug)                                                            \
-    {                                                                     \
-      YYFPRINTF (stderr, "%s ", Title);                                   \
-      yy_symbol_print (stderr,                                            \
-                  Type, Value); \
-      YYFPRINTF (stderr, "\n");                                           \
-    }                                                                     \
-} while (0)
-
-
-/*----------------------------------------.
-| Print this symbol's value on YYOUTPUT.  |
-`----------------------------------------*/
-
-static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-{
-  FILE *yyo = yyoutput;
-  YYUSE (yyo);
-  if (!yyvaluep)
-    return;
-# ifdef YYPRINT
-  if (yytype < YYNTOKENS)
-    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
-  YYUSE (yytype);
-}
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-{
-  YYFPRINTF (yyoutput, "%s %s (",
-             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
-
-  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
-  YYFPRINTF (yyoutput, ")");
-}
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included).                                                   |
-`------------------------------------------------------------------*/
-
-static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
-{
-  YYFPRINTF (stderr, "Stack now");
-  for (; yybottom <= yytop; yybottom++)
-    {
-      int yybot = *yybottom;
-      YYFPRINTF (stderr, " %d", yybot);
-    }
-  YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top)                            \
-do {                                                            \
-  if (yydebug)                                                  \
-    yy_stack_print ((Bottom), (Top));                           \
-} while (0)
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced.  |
-`------------------------------------------------*/
-
-static void
-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
-{
-  unsigned long int yylno = yyrline[yyrule];
-  int yynrhs = yyr2[yyrule];
-  int yyi;
-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
-             yyrule - 1, yylno);
-  /* The symbols being reduced.  */
-  for (yyi = 0; yyi < yynrhs; yyi++)
-    {
-      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
-      yy_symbol_print (stderr,
-                       yystos[yyssp[yyi + 1 - yynrhs]],
-                       &(yyvsp[(yyi + 1) - (yynrhs)])
-                                              );
-      YYFPRINTF (stderr, "\n");
-    }
-}
-
-# define YY_REDUCE_PRINT(Rule)          \
-do {                                    \
-  if (yydebug)                          \
-    yy_reduce_print (yyssp, yyvsp, Rule); \
-} while (0)
-
-/* Nonzero means print parse trace.  It is left uninitialized so that
-   multiple parsers can coexist.  */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-
-/* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
-   if the built-in stack extension method is used).
-
-   Do not make this value too large; the results are undefined if
-   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
-   evaluated with infinite-precision integer arithmetic.  */
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-#  if defined __GLIBC__ && defined _STRING_H
-#   define yystrlen strlen
-#  else
-/* Return the length of YYSTR.  */
-static YYSIZE_T
-yystrlen (const char *yystr)
-{
-  YYSIZE_T yylen;
-  for (yylen = 0; yystr[yylen]; yylen++)
-    continue;
-  return yylen;
-}
-#  endif
-# endif
-
-# ifndef yystpcpy
-#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-#   define yystpcpy stpcpy
-#  else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
-   YYDEST.  */
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-{
-  char *yyd = yydest;
-  const char *yys = yysrc;
-
-  while ((*yyd++ = *yys++) != '\0')
-    continue;
-
-  return yyd - 1;
-}
-#  endif
-# endif
-
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
-   quotes and backslashes, so that it's suitable for yyerror.  The
-   heuristic is that double-quoting is unnecessary unless the string
-   contains an apostrophe, a comma, or backslash (other than
-   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
-   null, do not copy; instead, return the length of what the result
-   would have been.  */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
-  if (*yystr == '"')
-    {
-      YYSIZE_T yyn = 0;
-      char const *yyp = yystr;
-
-      for (;;)
-        switch (*++yyp)
-          {
-          case '\'':
-          case ',':
-            goto do_not_strip_quotes;
-
-          case '\\':
-            if (*++yyp != '\\')
-              goto do_not_strip_quotes;
-            /* Fall through.  */
-          default:
-            if (yyres)
-              yyres[yyn] = *yyp;
-            yyn++;
-            break;
-
-          case '"':
-            if (yyres)
-              yyres[yyn] = '\0';
-            return yyn;
-          }
-    do_not_strip_quotes: ;
-    }
-
-  if (! yyres)
-    return yystrlen (yystr);
-
-  return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
-   about the unexpected token YYTOKEN for the state stack whose top is
-   YYSSP.
-
-   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
-   not large enough to hold the message.  In that case, also set
-   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
-   required number of bytes is too large to store.  */
-static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
-                yytype_int16 *yyssp, int yytoken)
-{
-  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
-  YYSIZE_T yysize = yysize0;
-  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
-  /* Internationalized format string. */
-  const char *yyformat = YY_NULLPTR;
-  /* Arguments of yyformat. */
-  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-  /* Number of reported tokens (one for the "unexpected", one per
-     "expected"). */
-  int yycount = 0;
-
-  /* There are many possibilities here to consider:
-     - If this state is a consistent state with a default action, then
-       the only way this function was invoked is if the default action
-       is an error action.  In that case, don't check for expected
-       tokens because there are none.
-     - The only way there can be no lookahead present (in yychar) is if
-       this state is a consistent state with a default action.  Thus,
-       detecting the absence of a lookahead is sufficient to determine
-       that there is no unexpected or expected token to report.  In that
-       case, just report a simple "syntax error".
-     - Don't assume there isn't a lookahead just because this state is a
-       consistent state with a default action.  There might have been a
-       previous inconsistent state, consistent state with a non-default
-       action, or user semantic action that manipulated yychar.
-     - Of course, the expected token list depends on states to have
-       correct lookahead information, and it depends on the parser not
-       to perform extra reductions after fetching a lookahead from the
-       scanner and before detecting a syntax error.  Thus, state merging
-       (from LALR or IELR) and default reductions corrupt the expected
-       token list.  However, the list is correct for canonical LR with
-       one exception: it will still contain any token that will not be
-       accepted due to an error action in a later state.
-  */
-  if (yytoken != YYEMPTY)
-    {
-      int yyn = yypact[*yyssp];
-      yyarg[yycount++] = yytname[yytoken];
-      if (!yypact_value_is_default (yyn))
-        {
-          /* Start YYX@-YYN if negative to avoid negative indexes in
-             YYCHECK.  In other words, skip the first -YYN actions for
-             this state because they are default actions.  */
-          int yyxbegin = yyn < 0 ? -yyn : 0;
-          /* Stay within bounds of both yycheck and yytname.  */
-          int yychecklim = YYLAST - yyn + 1;
-          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-          int yyx;
-
-          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
-                && !yytable_value_is_error (yytable[yyx + yyn]))
-              {
-                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-                  {
-                    yycount = 1;
-                    yysize = yysize0;
-                    break;
-                  }
-                yyarg[yycount++] = yytname[yyx];
-                {
-                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
-                  if (! (yysize <= yysize1
-                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-                    return 2;
-                  yysize = yysize1;
-                }
-              }
-        }
-    }
-
-  switch (yycount)
-    {
-# define YYCASE_(N, S)                      \
-      case N:                               \
-        yyformat = S;                       \
-      break
-      YYCASE_(0, YY_("syntax error"));
-      YYCASE_(1, YY_("syntax error, unexpected %s"));
-      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
-      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
-      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
-      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-# undef YYCASE_
-    }
-
-  {
-    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
-    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-      return 2;
-    yysize = yysize1;
-  }
-
-  if (*yymsg_alloc < yysize)
-    {
-      *yymsg_alloc = 2 * yysize;
-      if (! (yysize <= *yymsg_alloc
-             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
-        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
-      return 1;
-    }
-
-  /* Avoid sprintf, as that infringes on the user's name space.
-     Don't have undefined behavior even if the translation
-     produced a string with the wrong number of "%s"s.  */
-  {
-    char *yyp = *yymsg;
-    int yyi = 0;
-    while ((*yyp = *yyformat) != '\0')
-      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
-        {
-          yyp += yytnamerr (yyp, yyarg[yyi++]);
-          yyformat += 2;
-        }
-      else
-        {
-          yyp++;
-          yyformat++;
-        }
-  }
-  return 0;
-}
-#endif /* YYERROR_VERBOSE */
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol.  |
-`-----------------------------------------------*/
-
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
-{
-  YYUSE (yyvaluep);
-  if (!yymsg)
-    yymsg = "Deleting";
-  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
-  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-  switch (yytype)
-    {
-          case 58: /* choice_entry  */
-
-      {
-	fprintf(stderr, "%s:%d: missing end statement for this entry\n",
-		((*yyvaluep).menu)->file->name, ((*yyvaluep).menu)->lineno);
-	if (current_menu == ((*yyvaluep).menu))
-		menu_end_menu();
-}
-
-        break;
-
-    case 64: /* if_entry  */
-
-      {
-	fprintf(stderr, "%s:%d: missing end statement for this entry\n",
-		((*yyvaluep).menu)->file->name, ((*yyvaluep).menu)->lineno);
-	if (current_menu == ((*yyvaluep).menu))
-		menu_end_menu();
-}
-
-        break;
-
-    case 70: /* menu_entry  */
-
-      {
-	fprintf(stderr, "%s:%d: missing end statement for this entry\n",
-		((*yyvaluep).menu)->file->name, ((*yyvaluep).menu)->lineno);
-	if (current_menu == ((*yyvaluep).menu))
-		menu_end_menu();
-}
-
-        break;
-
-
-      default:
-        break;
-    }
-  YY_IGNORE_MAYBE_UNINITIALIZED_END
-}
-
-
-
-
-/* The lookahead symbol.  */
-int yychar;
-
-/* The semantic value of the lookahead symbol.  */
-YYSTYPE yylval;
-/* Number of syntax errors so far.  */
-int yynerrs;
-
-
-/*----------.
-| yyparse.  |
-`----------*/
-
-int
-yyparse (void)
-{
-    int yystate;
-    /* Number of tokens to shift before error messages enabled.  */
-    int yyerrstatus;
-
-    /* The stacks and their tools:
-       'yyss': related to states.
-       'yyvs': related to semantic values.
-
-       Refer to the stacks through separate pointers, to allow yyoverflow
-       to reallocate them elsewhere.  */
-
-    /* The state stack.  */
-    yytype_int16 yyssa[YYINITDEPTH];
-    yytype_int16 *yyss;
-    yytype_int16 *yyssp;
-
-    /* The semantic value stack.  */
-    YYSTYPE yyvsa[YYINITDEPTH];
-    YYSTYPE *yyvs;
-    YYSTYPE *yyvsp;
-
-    YYSIZE_T yystacksize;
-
-  int yyn;
-  int yyresult;
-  /* Lookahead token as an internal (translated) token number.  */
-  int yytoken = 0;
-  /* The variables used to return semantic value and location from the
-     action routines.  */
-  YYSTYPE yyval;
-
-#if YYERROR_VERBOSE
-  /* Buffer for error messages, and its allocated size.  */
-  char yymsgbuf[128];
-  char *yymsg = yymsgbuf;
-  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
-#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
-
-  /* The number of symbols on the RHS of the reduced rule.
-     Keep to zero when no symbol should be popped.  */
-  int yylen = 0;
-
-  yyssp = yyss = yyssa;
-  yyvsp = yyvs = yyvsa;
-  yystacksize = YYINITDEPTH;
-
-  YYDPRINTF ((stderr, "Starting parse\n"));
-
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY; /* Cause a token to be read.  */
-  goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate.  |
-`------------------------------------------------------------*/
- yynewstate:
-  /* In all cases, when you get here, the value and location stacks
-     have just been pushed.  So pushing a state here evens the stacks.  */
-  yyssp++;
-
- yysetstate:
-  *yyssp = yystate;
-
-  if (yyss + yystacksize - 1 <= yyssp)
-    {
-      /* Get the current used size of the three stacks, in elements.  */
-      YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-      {
-        /* Give user a chance to reallocate the stack.  Use copies of
-           these so that the &'s don't force the real ones into
-           memory.  */
-        YYSTYPE *yyvs1 = yyvs;
-        yytype_int16 *yyss1 = yyss;
-
-        /* Each stack pointer address is followed by the size of the
-           data in use in that stack, in bytes.  This used to be a
-           conditional around just the two extra args, but that might
-           be undefined if yyoverflow is a macro.  */
-        yyoverflow (YY_("memory exhausted"),
-                    &yyss1, yysize * sizeof (*yyssp),
-                    &yyvs1, yysize * sizeof (*yyvsp),
-                    &yystacksize);
-
-        yyss = yyss1;
-        yyvs = yyvs1;
-      }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
-      goto yyexhaustedlab;
-# else
-      /* Extend the stack our own way.  */
-      if (YYMAXDEPTH <= yystacksize)
-        goto yyexhaustedlab;
-      yystacksize *= 2;
-      if (YYMAXDEPTH < yystacksize)
-        yystacksize = YYMAXDEPTH;
-
-      {
-        yytype_int16 *yyss1 = yyss;
-        union yyalloc *yyptr =
-          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
-        if (! yyptr)
-          goto yyexhaustedlab;
-        YYSTACK_RELOCATE (yyss_alloc, yyss);
-        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
-#  undef YYSTACK_RELOCATE
-        if (yyss1 != yyssa)
-          YYSTACK_FREE (yyss1);
-      }
-# endif
-#endif /* no yyoverflow */
-
-      yyssp = yyss + yysize - 1;
-      yyvsp = yyvs + yysize - 1;
-
-      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-                  (unsigned long int) yystacksize));
-
-      if (yyss + yystacksize - 1 <= yyssp)
-        YYABORT;
-    }
-
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
-  if (yystate == YYFINAL)
-    YYACCEPT;
-
-  goto yybackup;
-
-/*-----------.
-| yybackup.  |
-`-----------*/
-yybackup:
-
-  /* Do appropriate processing given the current state.  Read a
-     lookahead token if we need one and don't already have one.  */
-
-  /* First try to decide what to do without reference to lookahead token.  */
-  yyn = yypact[yystate];
-  if (yypact_value_is_default (yyn))
-    goto yydefault;
-
-  /* Not known => get a lookahead token if don't already have one.  */
-
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
-  if (yychar == YYEMPTY)
-    {
-      YYDPRINTF ((stderr, "Reading a token: "));
-      yychar = yylex ();
-    }
-
-  if (yychar <= YYEOF)
-    {
-      yychar = yytoken = YYEOF;
-      YYDPRINTF ((stderr, "Now@end of input.\n"));
-    }
-  else
-    {
-      yytoken = YYTRANSLATE (yychar);
-      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
-    }
-
-  /* If the proper action on seeing token YYTOKEN is to reduce or to
-     detect an error, take that action.  */
-  yyn += yytoken;
-  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
-    goto yydefault;
-  yyn = yytable[yyn];
-  if (yyn <= 0)
-    {
-      if (yytable_value_is_error (yyn))
-        goto yyerrlab;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-
-  /* Count tokens shifted since error; after three, turn off error
-     status.  */
-  if (yyerrstatus)
-    yyerrstatus--;
-
-  /* Shift the lookahead token.  */
-  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
-  /* Discard the shifted token.  */
-  yychar = YYEMPTY;
-
-  yystate = yyn;
-  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-  *++yyvsp = yylval;
-  YY_IGNORE_MAYBE_UNINITIALIZED_END
-
-  goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state.  |
-`-----------------------------------------------------------*/
-yydefault:
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-  goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction.  |
-`-----------------------------*/
-yyreduce:
-  /* yyn is the number of a rule to reduce with.  */
-  yylen = yyr2[yyn];
-
-  /* If YYLEN is nonzero, implement the default value of the action:
-     '$$ = $1'.
-
-     Otherwise, the following line sets YYVAL to garbage.
-     This behavior is undocumented and Bison
-     users should not rely upon it.  Assigning to YYVAL
-     unconditionally makes the parser a bit smaller, and it avoids a
-     GCC warning that YYVAL may be used uninitialized.  */
-  yyval = yyvsp[1-yylen];
-
-
-  YY_REDUCE_PRINT (yyn);
-  switch (yyn)
-    {
-        case 10:
-
-    { zconf_error("unexpected end statement"); }
-
-    break;
-
-  case 11:
-
-    { zconf_error("unknown statement \"%s\"", (yyvsp[-2].string)); }
-
-    break;
-
-  case 12:
-
-    {
-	zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[-2].id)->name);
-}
-
-    break;
-
-  case 13:
-
-    { zconf_error("invalid statement"); }
-
-    break;
-
-  case 29:
-
-    { zconf_error("unknown option \"%s\"", (yyvsp[-2].string)); }
-
-    break;
-
-  case 30:
-
-    { zconf_error("invalid option"); }
-
-    break;
-
-  case 31:
-
-    {
-	struct symbol *sym = sym_lookup((yyvsp[-1].string), 0);
-	sym->flags |= SYMBOL_OPTIONAL;
-	menu_add_entry(sym);
-	printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string));
-}
-
-    break;
-
-  case 32:
-
-    {
-	menu_end_entry();
-	printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
-}
-
-    break;
-
-  case 33:
-
-    {
-	struct symbol *sym = sym_lookup((yyvsp[-1].string), 0);
-	sym->flags |= SYMBOL_OPTIONAL;
-	menu_add_entry(sym);
-	printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string));
-}
-
-    break;
-
-  case 34:
-
-    {
-	if (current_entry->prompt)
-		current_entry->prompt->type = P_MENU;
-	else
-		zconfprint("warning: menuconfig statement without prompt");
-	menu_end_entry();
-	printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
-}
-
-    break;
-
-  case 42:
-
-    {
-	menu_set_type((yyvsp[-2].id)->stype);
-	printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
-		zconf_curname(), zconf_lineno(),
-		(yyvsp[-2].id)->stype);
-}
-
-    break;
-
-  case 43:
-
-    {
-	menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr));
-	printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
-}
-
-    break;
-
-  case 44:
-
-    {
-	menu_add_expr(P_DEFAULT, (yyvsp[-2].expr), (yyvsp[-1].expr));
-	if ((yyvsp[-3].id)->stype != S_UNKNOWN)
-		menu_set_type((yyvsp[-3].id)->stype);
-	printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
-		zconf_curname(), zconf_lineno(),
-		(yyvsp[-3].id)->stype);
-}
-
-    break;
-
-  case 45:
-
-    {
-	menu_add_symbol(P_SELECT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr));
-	printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
-}
-
-    break;
-
-  case 46:
-
-    {
-	menu_add_symbol(P_IMPLY, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr));
-	printd(DEBUG_PARSE, "%s:%d:imply\n", zconf_curname(), zconf_lineno());
-}
-
-    break;
-
-  case 47:
-
-    {
-	menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[-3].symbol), (yyvsp[-2].symbol)), (yyvsp[-1].expr));
-	printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
-}
-
-    break;
-
-  case 50:
-
-    {
-	const struct kconf_id *id = kconf_id_lookup((yyvsp[-1].string), strlen((yyvsp[-1].string)));
-	if (id && id->flags & TF_OPTION)
-		menu_add_option(id->token, (yyvsp[0].string));
-	else
-		zconfprint("warning: ignoring unknown option %s", (yyvsp[-1].string));
-	free((yyvsp[-1].string));
-}
-
-    break;
-
-  case 51:
-
-    { (yyval.string) = NULL; }
-
-    break;
-
-  case 52:
-
-    { (yyval.string) = (yyvsp[0].string); }
-
-    break;
-
-  case 53:
-
-    {
-	struct symbol *sym = sym_lookup((yyvsp[-1].string), SYMBOL_CHOICE);
-	sym->flags |= SYMBOL_AUTO;
-	menu_add_entry(sym);
-	menu_add_expr(P_CHOICE, NULL, NULL);
-	printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
-}
-
-    break;
-
-  case 54:
-
-    {
-	(yyval.menu) = menu_add_menu();
-}
-
-    break;
-
-  case 55:
-
-    {
-	if (zconf_endtoken((yyvsp[0].id), T_CHOICE, T_ENDCHOICE)) {
-		menu_end_menu();
-		printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
-	}
-}
-
-    break;
-
-  case 63:
-
-    {
-	menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr));
-	printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
-}
-
-    break;
-
-  case 64:
-
-    {
-	if ((yyvsp[-2].id)->stype == S_BOOLEAN || (yyvsp[-2].id)->stype == S_TRISTATE) {
-		menu_set_type((yyvsp[-2].id)->stype);
-		printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
-			zconf_curname(), zconf_lineno(),
-			(yyvsp[-2].id)->stype);
-	} else
-		YYERROR;
-}
-
-    break;
-
-  case 65:
-
-    {
-	current_entry->sym->flags |= SYMBOL_OPTIONAL;
-	printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
-}
-
-    break;
-
-  case 66:
-
-    {
-	if ((yyvsp[-3].id)->stype == S_UNKNOWN) {
-		menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr));
-		printd(DEBUG_PARSE, "%s:%d:default\n",
-			zconf_curname(), zconf_lineno());
-	} else
-		YYERROR;
-}
-
-    break;
-
-  case 69:
-
-    {
-	printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
-	menu_add_entry(NULL);
-	menu_add_dep((yyvsp[-1].expr));
-	(yyval.menu) = menu_add_menu();
-}
-
-    break;
-
-  case 70:
-
-    {
-	if (zconf_endtoken((yyvsp[0].id), T_IF, T_ENDIF)) {
-		menu_end_menu();
-		printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
-	}
-}
-
-    break;
-
-  case 76:
-
-    {
-	menu_add_prompt(P_MENU, (yyvsp[-1].string), NULL);
-}
-
-    break;
-
-  case 77:
-
-    {
-	menu_add_entry(NULL);
-	menu_add_prompt(P_MENU, (yyvsp[-1].string), NULL);
-	printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
-}
-
-    break;
-
-  case 78:
-
-    {
-	(yyval.menu) = menu_add_menu();
-}
-
-    break;
-
-  case 79:
-
-    {
-	if (zconf_endtoken((yyvsp[0].id), T_MENU, T_ENDMENU)) {
-		menu_end_menu();
-		printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
-	}
-}
-
-    break;
-
-  case 85:
-
-    {
-	printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string));
-	zconf_nextfile((yyvsp[-1].string));
-}
-
-    break;
-
-  case 86:
-
-    {
-	menu_add_entry(NULL);
-	menu_add_prompt(P_COMMENT, (yyvsp[-1].string), NULL);
-	printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
-}
-
-    break;
-
-  case 87:
-
-    {
-	menu_end_entry();
-}
-
-    break;
-
-  case 88:
-
-    {
-	printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
-	zconf_starthelp();
-}
-
-    break;
-
-  case 89:
-
-    {
-	current_entry->help = (yyvsp[0].string);
-}
-
-    break;
-
-  case 94:
-
-    {
-	menu_add_dep((yyvsp[-1].expr));
-	printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
-}
-
-    break;
-
-  case 98:
-
-    {
-	menu_add_visibility((yyvsp[0].expr));
-}
-
-    break;
-
-  case 100:
-
-    {
-	menu_add_prompt(P_PROMPT, (yyvsp[-1].string), (yyvsp[0].expr));
-}
-
-    break;
-
-  case 103:
-
-    { (yyval.id) = (yyvsp[-1].id); }
-
-    break;
-
-  case 104:
-
-    { (yyval.id) = (yyvsp[-1].id); }
-
-    break;
-
-  case 105:
-
-    { (yyval.id) = (yyvsp[-1].id); }
-
-    break;
-
-  case 108:
-
-    { (yyval.expr) = NULL; }
-
-    break;
-
-  case 109:
-
-    { (yyval.expr) = (yyvsp[0].expr); }
-
-    break;
-
-  case 110:
-
-    { (yyval.expr) = expr_alloc_symbol((yyvsp[0].symbol)); }
-
-    break;
-
-  case 111:
-
-    { (yyval.expr) = expr_alloc_comp(E_LTH, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
-
-    break;
-
-  case 112:
-
-    { (yyval.expr) = expr_alloc_comp(E_LEQ, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
-
-    break;
-
-  case 113:
-
-    { (yyval.expr) = expr_alloc_comp(E_GTH, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
-
-    break;
-
-  case 114:
-
-    { (yyval.expr) = expr_alloc_comp(E_GEQ, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
-
-    break;
-
-  case 115:
-
-    { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
-
-    break;
-
-  case 116:
-
-    { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
-
-    break;
-
-  case 117:
-
-    { (yyval.expr) = (yyvsp[-1].expr); }
-
-    break;
-
-  case 118:
-
-    { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[0].expr)); }
-
-    break;
-
-  case 119:
-
-    { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[-2].expr), (yyvsp[0].expr)); }
-
-    break;
-
-  case 120:
-
-    { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); }
-
-    break;
-
-  case 121:
-
-    { (yyval.symbol) = sym_lookup((yyvsp[0].string), 0); free((yyvsp[0].string)); }
-
-    break;
-
-  case 122:
-
-    { (yyval.symbol) = sym_lookup((yyvsp[0].string), SYMBOL_CONST); free((yyvsp[0].string)); }
-
-    break;
-
-  case 123:
-
-    { (yyval.string) = NULL; }
-
-    break;
-
-
-
-      default: break;
-    }
-  /* User semantic actions sometimes alter yychar, and that requires
-     that yytoken be updated with the new translation.  We take the
-     approach of translating immediately before every use of yytoken.
-     One alternative is translating here after every semantic action,
-     but that translation would be missed if the semantic action invokes
-     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
-     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
-     incorrect destructor might then be invoked immediately.  In the
-     case of YYERROR or YYBACKUP, subsequent parser actions might lead
-     to an incorrect destructor call or verbose syntax error message
-     before the lookahead is translated.  */
-  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-
-  YYPOPSTACK (yylen);
-  yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
-
-  *++yyvsp = yyval;
-
-  /* Now 'shift' the result of the reduction.  Determine what state
-     that goes to, based on the state we popped back to and the rule
-     number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
-  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTOKENS];
-
-  goto yynewstate;
-
-
-/*--------------------------------------.
-| yyerrlab -- here on detecting error.  |
-`--------------------------------------*/
-yyerrlab:
-  /* Make sure we have latest lookahead translation.  See comments at
-     user semantic actions for why this is necessary.  */
-  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
-
-  /* If not already recovering from an error, report this error.  */
-  if (!yyerrstatus)
-    {
-      ++yynerrs;
-#if ! YYERROR_VERBOSE
-      yyerror (YY_("syntax error"));
-#else
-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
-                                        yyssp, yytoken)
-      {
-        char const *yymsgp = YY_("syntax error");
-        int yysyntax_error_status;
-        yysyntax_error_status = YYSYNTAX_ERROR;
-        if (yysyntax_error_status == 0)
-          yymsgp = yymsg;
-        else if (yysyntax_error_status == 1)
-          {
-            if (yymsg != yymsgbuf)
-              YYSTACK_FREE (yymsg);
-            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
-            if (!yymsg)
-              {
-                yymsg = yymsgbuf;
-                yymsg_alloc = sizeof yymsgbuf;
-                yysyntax_error_status = 2;
-              }
-            else
-              {
-                yysyntax_error_status = YYSYNTAX_ERROR;
-                yymsgp = yymsg;
-              }
-          }
-        yyerror (yymsgp);
-        if (yysyntax_error_status == 2)
-          goto yyexhaustedlab;
-      }
-# undef YYSYNTAX_ERROR
-#endif
-    }
-
-
-
-  if (yyerrstatus == 3)
-    {
-      /* If just tried and failed to reuse lookahead token after an
-         error, discard it.  */
-
-      if (yychar <= YYEOF)
-        {
-          /* Return failure if@end of input.  */
-          if (yychar == YYEOF)
-            YYABORT;
-        }
-      else
-        {
-          yydestruct ("Error: discarding",
-                      yytoken, &yylval);
-          yychar = YYEMPTY;
-        }
-    }
-
-  /* Else will try to reuse lookahead token after shifting the error
-     token.  */
-  goto yyerrlab1;
-
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR.  |
-`---------------------------------------------------*/
-yyerrorlab:
-
-  /* Pacify compilers like GCC when the user code never invokes
-     YYERROR and the label yyerrorlab therefore never appears in user
-     code.  */
-  if (/*CONSTCOND*/ 0)
-     goto yyerrorlab;
-
-  /* Do not reclaim the symbols of the rule whose action triggered
-     this YYERROR.  */
-  YYPOPSTACK (yylen);
-  yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
-  yystate = *yyssp;
-  goto yyerrlab1;
-
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR.  |
-`-------------------------------------------------------------*/
-yyerrlab1:
-  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
-
-  for (;;)
-    {
-      yyn = yypact[yystate];
-      if (!yypact_value_is_default (yyn))
-        {
-          yyn += YYTERROR;
-          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-            {
-              yyn = yytable[yyn];
-              if (0 < yyn)
-                break;
-            }
-        }
-
-      /* Pop the current state because it cannot handle the error token.  */
-      if (yyssp == yyss)
-        YYABORT;
-
-
-      yydestruct ("Error: popping",
-                  yystos[yystate], yyvsp);
-      YYPOPSTACK (1);
-      yystate = *yyssp;
-      YY_STACK_PRINT (yyss, yyssp);
-    }
-
-  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-  *++yyvsp = yylval;
-  YY_IGNORE_MAYBE_UNINITIALIZED_END
-
-
-  /* Shift the error token.  */
-  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
-
-  yystate = yyn;
-  goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here.  |
-`-------------------------------------*/
-yyacceptlab:
-  yyresult = 0;
-  goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here.  |
-`-----------------------------------*/
-yyabortlab:
-  yyresult = 1;
-  goto yyreturn;
-
-#if !defined yyoverflow || YYERROR_VERBOSE
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here.  |
-`-------------------------------------------------*/
-yyexhaustedlab:
-  yyerror (YY_("memory exhausted"));
-  yyresult = 2;
-  /* Fall through.  */
-#endif
-
-yyreturn:
-  if (yychar != YYEMPTY)
-    {
-      /* Make sure we have latest lookahead translation.  See comments at
-         user semantic actions for why this is necessary.  */
-      yytoken = YYTRANSLATE (yychar);
-      yydestruct ("Cleanup: discarding lookahead",
-                  yytoken, &yylval);
-    }
-  /* Do not reclaim the symbols of the rule whose action triggered
-     this YYABORT or YYACCEPT.  */
-  YYPOPSTACK (yylen);
-  YY_STACK_PRINT (yyss, yyssp);
-  while (yyssp != yyss)
-    {
-      yydestruct ("Cleanup: popping",
-                  yystos[*yyssp], yyvsp);
-      YYPOPSTACK (1);
-    }
-#ifndef yyoverflow
-  if (yyss != yyssa)
-    YYSTACK_FREE (yyss);
-#endif
-#if YYERROR_VERBOSE
-  if (yymsg != yymsgbuf)
-    YYSTACK_FREE (yymsg);
-#endif
-  return yyresult;
-}
-
-
-
-void conf_parse(const char *name)
-{
-	struct symbol *sym;
-	int i;
-
-	zconf_initscan(name);
-
-	sym_init();
-	_menu_init();
-	rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
-
-	if (getenv("ZCONF_DEBUG"))
-		zconfdebug = 1;
-	zconfparse();
-	if (zconfnerrs)
-		exit(1);
-	if (!modules_sym)
-		modules_sym = sym_find( "n" );
-
-	rootmenu.prompt->text = _(rootmenu.prompt->text);
-	rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
-
-	menu_finalize(&rootmenu);
-	for_all_symbols(i, sym) {
-		if (sym_check_deps(sym))
-			zconfnerrs++;
-	}
-	if (zconfnerrs)
-		exit(1);
-	sym_set_change_count(1);
-}
-
-static const char *zconf_tokenname(int token)
-{
-	switch (token) {
-	case T_MENU:		return "menu";
-	case T_ENDMENU:		return "endmenu";
-	case T_CHOICE:		return "choice";
-	case T_ENDCHOICE:	return "endchoice";
-	case T_IF:		return "if";
-	case T_ENDIF:		return "endif";
-	case T_DEPENDS:		return "depends";
-	case T_VISIBLE:		return "visible";
-	}
-	return "<token>";
-}
-
-static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken)
-{
-	if (id->token != endtoken) {
-		zconf_error("unexpected '%s' within %s block",
-			kconf_id_strings + id->name, zconf_tokenname(starttoken));
-		zconfnerrs++;
-		return false;
-	}
-	if (current_menu->file != current_file) {
-		zconf_error("'%s' in different file than '%s'",
-			kconf_id_strings + id->name, zconf_tokenname(starttoken));
-		fprintf(stderr, "%s:%d: location of the '%s'\n",
-			current_menu->file->name, current_menu->lineno,
-			zconf_tokenname(starttoken));
-		zconfnerrs++;
-		return false;
-	}
-	return true;
-}
-
-static void zconfprint(const char *err, ...)
-{
-	va_list ap;
-
-	fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
-	va_start(ap, err);
-	vfprintf(stderr, err, ap);
-	va_end(ap);
-	fprintf(stderr, "\n");
-}
-
-static void zconf_error(const char *err, ...)
-{
-	va_list ap;
-
-	zconfnerrs++;
-	fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
-	va_start(ap, err);
-	vfprintf(stderr, err, ap);
-	va_end(ap);
-	fprintf(stderr, "\n");
-}
-
-static void zconferror(const char *err)
-{
-	fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
-}
-
-static void print_quoted_string(FILE *out, const char *str)
-{
-	const char *p;
-	int len;
-
-	putc('"', out);
-	while ((p = strchr(str, '"'))) {
-		len = p - str;
-		if (len)
-			fprintf(out, "%.*s", len, str);
-		fputs("\\\"", out);
-		str = p + 1;
-	}
-	fputs(str, out);
-	putc('"', out);
-}
-
-static void print_symbol(FILE *out, struct menu *menu)
-{
-	struct symbol *sym = menu->sym;
-	struct property *prop;
-
-	if (sym_is_choice(sym))
-		fprintf(out, "\nchoice\n");
-	else
-		fprintf(out, "\nconfig %s\n", sym->name);
-	switch (sym->type) {
-	case S_BOOLEAN:
-		fputs("  boolean\n", out);
-		break;
-	case S_TRISTATE:
-		fputs("  tristate\n", out);
-		break;
-	case S_STRING:
-		fputs("  string\n", out);
-		break;
-	case S_INT:
-		fputs("  integer\n", out);
-		break;
-	case S_HEX:
-		fputs("  hex\n", out);
-		break;
-	default:
-		fputs("  ???\n", out);
-		break;
-	}
-	for (prop = sym->prop; prop; prop = prop->next) {
-		if (prop->menu != menu)
-			continue;
-		switch (prop->type) {
-		case P_PROMPT:
-			fputs("  prompt ", out);
-			print_quoted_string(out, prop->text);
-			if (!expr_is_yes(prop->visible.expr)) {
-				fputs(" if ", out);
-				expr_fprint(prop->visible.expr, out);
-			}
-			fputc('\n', out);
-			break;
-		case P_DEFAULT:
-			fputs( "  default ", out);
-			expr_fprint(prop->expr, out);
-			if (!expr_is_yes(prop->visible.expr)) {
-				fputs(" if ", out);
-				expr_fprint(prop->visible.expr, out);
-			}
-			fputc('\n', out);
-			break;
-		case P_CHOICE:
-			fputs("  #choice value\n", out);
-			break;
-		case P_SELECT:
-			fputs( "  select ", out);
-			expr_fprint(prop->expr, out);
-			fputc('\n', out);
-			break;
-		case P_IMPLY:
-			fputs( "  imply ", out);
-			expr_fprint(prop->expr, out);
-			fputc('\n', out);
-			break;
-		case P_RANGE:
-			fputs( "  range ", out);
-			expr_fprint(prop->expr, out);
-			fputc('\n', out);
-			break;
-		case P_MENU:
-			fputs( "  menu ", out);
-			print_quoted_string(out, prop->text);
-			fputc('\n', out);
-			break;
-		default:
-			fprintf(out, "  unknown prop %d!\n", prop->type);
-			break;
-		}
-	}
-	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);
-	}
-}
-
-void zconfdump(FILE *out)
-{
-	struct property *prop;
-	struct symbol *sym;
-	struct menu *menu;
-
-	menu = rootmenu.list;
-	while (menu) {
-		if ((sym = menu->sym))
-			print_symbol(out, menu);
-		else if ((prop = menu->prompt)) {
-			switch (prop->type) {
-			case P_COMMENT:
-				fputs("\ncomment ", out);
-				print_quoted_string(out, prop->text);
-				fputs("\n", out);
-				break;
-			case P_MENU:
-				fputs("\nmenu ", out);
-				print_quoted_string(out, prop->text);
-				fputs("\n", out);
-				break;
-			default:
-				;
-			}
-			if (!expr_is_yes(prop->visible.expr)) {
-				fputs("  depends ", out);
-				expr_fprint(prop->visible.expr, out);
-				fputc('\n', out);
-			}
-		}
-
-		if (menu->list)
-			menu = menu->list;
-		else if (menu->next)
-			menu = menu->next;
-		else while ((menu = menu->parent)) {
-			if (menu->prompt && menu->prompt->type == P_MENU)
-				fputs("\nendmenu\n", out);
-			if (menu->next) {
-				menu = menu->next;
-				break;
-			}
-		}
-	}
-}
-
-#include "zconf.lex.c"
-#include "util.c"
-#include "confdata.c"
-#include "expr.c"
-#include "symbol.c"
-#include "menu.c"
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 001305fa080b..ad6305b0f40c 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -20,10 +20,10 @@
 
 int cdebug = PRINTD;
 
-extern int zconflex(void);
+int yylex(void);
+static void yyerror(const char *err);
 static void zconfprint(const char *err, ...);
 static void zconf_error(const char *err, ...);
-static void zconferror(const char *err);
 static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
 
 struct symbol *symbol_hash[SYMBOL_HASHSIZE];
@@ -85,6 +85,7 @@ static struct menu *current_menu, *current_entry;
 %nonassoc T_NOT
 
 %type <string> prompt
+%type <symbol> nonconst_symbol
 %type <symbol> symbol
 %type <expr> expr
 %type <expr> if_expr
@@ -101,14 +102,34 @@ static struct menu *current_menu, *current_entry;
 } if_entry menu_entry choice_entry
 
 %{
-/* Include zconf.hash.c here so it can see the token constants. */
-#include "zconf.hash.c"
+/* Include kconf_id.c here so it can see the token constants. */
+#include "kconf_id.c"
 %}
 
 %%
 input: nl start | start;
 
-start: mainmenu_stmt stmt_list | stmt_list;
+start: mainmenu_stmt stmt_list | no_mainmenu_stmt stmt_list;
+
+/* mainmenu entry */
+
+mainmenu_stmt: T_MAINMENU prompt nl
+{
+	menu_add_prompt(P_MENU, $2, NULL);
+};
+
+/* Default main menu, if there's no mainmenu entry */
+
+no_mainmenu_stmt: /* empty */
+{
+	/*
+	 * Hack: Keep the main menu title on the heap so we can safely free it
+	 * later regardless of whether it comes from the 'prompt' in
+	 * mainmenu_stmt or here
+	 */
+	menu_add_prompt(P_MENU, xstrdup("Linux Kernel Configuration"), NULL);
+};
+
 
 stmt_list:
 	  /* empty */
@@ -119,7 +140,7 @@ stmt_list:
 	| stmt_list T_WORD error T_EOL	{ zconf_error("unknown statement \"%s\"", $2); }
 	| stmt_list option_name error T_EOL
 {
-	zconf_error("unexpected option \"%s\"", kconf_id_strings + $2->name);
+	zconf_error("unexpected option \"%s\"", $2->name);
 }
 	| stmt_list error T_EOL		{ zconf_error("invalid statement"); }
 ;
@@ -145,26 +166,23 @@ option_error:
 
 /* config/menuconfig entry */
 
-config_entry_start: T_CONFIG T_WORD T_EOL
+config_entry_start: T_CONFIG nonconst_symbol T_EOL
 {
-	struct symbol *sym = sym_lookup($2, 0);
-	sym->flags |= SYMBOL_OPTIONAL;
-	menu_add_entry(sym);
-	printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), $2);
+	$2->flags |= SYMBOL_OPTIONAL;
+	menu_add_entry($2);
+	printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), $2->name);
 };
 
 config_stmt: config_entry_start config_option_list
 {
-	menu_end_entry();
 	printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
 };
 
-menuconfig_entry_start: T_MENUCONFIG T_WORD T_EOL
+menuconfig_entry_start: T_MENUCONFIG nonconst_symbol T_EOL
 {
-	struct symbol *sym = sym_lookup($2, 0);
-	sym->flags |= SYMBOL_OPTIONAL;
-	menu_add_entry(sym);
-	printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), $2);
+	$2->flags |= SYMBOL_OPTIONAL;
+	menu_add_entry($2);
+	printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), $2->name);
 };
 
 menuconfig_stmt: menuconfig_entry_start config_option_list
@@ -173,7 +191,6 @@ menuconfig_stmt: menuconfig_entry_start config_option_list
 		current_entry->prompt->type = P_MENU;
 	else
 		zconfprint("warning: menuconfig statement without prompt");
-	menu_end_entry();
 	printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
 };
 
@@ -211,15 +228,15 @@ config_option: T_DEFAULT expr if_expr T_EOL
 		$1->stype);
 };
 
-config_option: T_SELECT T_WORD if_expr T_EOL
+config_option: T_SELECT nonconst_symbol if_expr T_EOL
 {
-	menu_add_symbol(P_SELECT, sym_lookup($2, 0), $3);
+	menu_add_symbol(P_SELECT, $2, $3);
 	printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
 };
 
-config_option: T_IMPLY T_WORD if_expr T_EOL
+config_option: T_IMPLY nonconst_symbol if_expr T_EOL
 {
-	menu_add_symbol(P_IMPLY, sym_lookup($2, 0), $3);
+	menu_add_symbol(P_IMPLY, $2, $3);
 	printd(DEBUG_PARSE, "%s:%d:imply\n", zconf_curname(), zconf_lineno());
 };
 
@@ -237,8 +254,10 @@ symbol_option_list:
 	| symbol_option_list T_WORD symbol_option_arg
 {
 	const struct kconf_id *id = kconf_id_lookup($2, strlen($2));
-	if (id && id->flags & TF_OPTION)
+	if (id && id->flags & TF_OPTION) {
 		menu_add_option(id->token, $3);
+		free($3);
+	}
 	else
 		zconfprint("warning: ignoring unknown option %s", $2);
 	free($2);
@@ -257,6 +276,7 @@ choice: T_CHOICE word_opt T_EOL
 	sym->flags |= SYMBOL_AUTO;
 	menu_add_entry(sym);
 	menu_add_expr(P_CHOICE, NULL, NULL);
+	free($2);
 	printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
 };
 
@@ -308,10 +328,10 @@ choice_option: T_OPTIONAL T_EOL
 	printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
 };
 
-choice_option: T_DEFAULT T_WORD if_expr T_EOL
+choice_option: T_DEFAULT nonconst_symbol if_expr T_EOL
 {
 	if ($1->stype == S_UNKNOWN) {
-		menu_add_symbol(P_DEFAULT, sym_lookup($2, 0), $3);
+		menu_add_symbol(P_DEFAULT, $2, $3);
 		printd(DEBUG_PARSE, "%s:%d:default\n",
 			zconf_curname(), zconf_lineno());
 	} else
@@ -351,13 +371,6 @@ if_block:
 	| if_block choice_stmt
 ;
 
-/* mainmenu entry */
-
-mainmenu_stmt: T_MAINMENU prompt nl
-{
-	menu_add_prompt(P_MENU, $2, NULL);
-};
-
 /* menu entry */
 
 menu: T_MENU prompt T_EOL
@@ -394,6 +407,7 @@ source_stmt: T_SOURCE prompt T_EOL
 {
 	printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), $2);
 	zconf_nextfile($2);
+	free($2);
 };
 
 /* comment entry */
@@ -406,9 +420,7 @@ comment: T_COMMENT prompt T_EOL
 };
 
 comment_stmt: comment depends_list
-{
-	menu_end_entry();
-};
+;
 
 /* help option */
 
@@ -420,6 +432,17 @@ help_start: T_HELP T_EOL
 
 help: help_start T_HELPTEXT
 {
+	if (current_entry->help) {
+		free(current_entry->help);
+		zconfprint("warning: '%s' defined with more than one help text -- only the last one will be used",
+			   current_entry->sym->name ?: "<choice>");
+	}
+
+	/* Is the help text empty or all whitespace? */
+	if ($2[strspn($2, " \f\n\r\t\v")] == '\0')
+		zconfprint("warning: '%s' defined with blank help text",
+			   current_entry->sym->name ?: "<choice>");
+
 	current_entry->help = $2;
 };
 
@@ -491,7 +514,10 @@ expr:	  symbol				{ $$ = expr_alloc_symbol($1); }
 	| expr T_AND expr			{ $$ = expr_alloc_two(E_AND, $1, $3); }
 ;
 
-symbol:	  T_WORD	{ $$ = sym_lookup($1, 0); free($1); }
+/* For symbol definitions, selects, etc., where quotes are not accepted */
+nonconst_symbol: T_WORD { $$ = sym_lookup($1, 0); free($1); };
+
+symbol:	  nonconst_symbol
 	| T_WORD_QUOTE	{ $$ = sym_lookup($1, SYMBOL_CONST); free($1); }
 ;
 
@@ -502,6 +528,7 @@ word_opt: /* empty */			{ $$ = NULL; }
 
 void conf_parse(const char *name)
 {
+	const char *tmp;
 	struct symbol *sym;
 	int i;
 
@@ -509,25 +536,26 @@ void conf_parse(const char *name)
 
 	sym_init();
 	_menu_init();
-	rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
 
 	if (getenv("ZCONF_DEBUG"))
-		zconfdebug = 1;
-	zconfparse();
-	if (zconfnerrs)
+		yydebug = 1;
+	yyparse();
+	if (yynerrs)
 		exit(1);
 	if (!modules_sym)
 		modules_sym = sym_find( "n" );
 
+	tmp = rootmenu.prompt->text;
 	rootmenu.prompt->text = _(rootmenu.prompt->text);
 	rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
+	free((char*)tmp);
 
 	menu_finalize(&rootmenu);
 	for_all_symbols(i, sym) {
 		if (sym_check_deps(sym))
-			zconfnerrs++;
+			yynerrs++;
 	}
-	if (zconfnerrs)
+	if (yynerrs)
 		exit(1);
 	sym_set_change_count(1);
 }
@@ -551,17 +579,17 @@ static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtok
 {
 	if (id->token != endtoken) {
 		zconf_error("unexpected '%s' within %s block",
-			kconf_id_strings + id->name, zconf_tokenname(starttoken));
-		zconfnerrs++;
+			id->name, zconf_tokenname(starttoken));
+		yynerrs++;
 		return false;
 	}
 	if (current_menu->file != current_file) {
 		zconf_error("'%s' in different file than '%s'",
-			kconf_id_strings + id->name, zconf_tokenname(starttoken));
+			id->name, zconf_tokenname(starttoken));
 		fprintf(stderr, "%s:%d: location of the '%s'\n",
 			current_menu->file->name, current_menu->lineno,
 			zconf_tokenname(starttoken));
-		zconfnerrs++;
+		yynerrs++;
 		return false;
 	}
 	return true;
@@ -582,7 +610,7 @@ static void zconf_error(const char *err, ...)
 {
 	va_list ap;
 
-	zconfnerrs++;
+	yynerrs++;
 	fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
 	va_start(ap, err);
 	vfprintf(stderr, err, ap);
@@ -590,7 +618,7 @@ static void zconf_error(const char *err, ...)
 	fprintf(stderr, "\n");
 }
 
-static void zconferror(const char *err)
+static void yyerror(const char *err)
 {
 	fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
 }
@@ -623,7 +651,7 @@ static void print_symbol(FILE *out, struct menu *menu)
 		fprintf(out, "\nconfig %s\n", sym->name);
 	switch (sym->type) {
 	case S_BOOLEAN:
-		fputs("  boolean\n", out);
+		fputs("  bool\n", out);
 		break;
 	case S_TRISTATE:
 		fputs("  tristate\n", out);
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 2/6] board: eets: pdu001: Fix wrong default value in Kconfig
  2018-05-12 17:13 [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4 Eugeniu Rosca
@ 2018-05-12 17:13 ` Eugeniu Rosca
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 3/6] scripts/dtc: Update to upstream version v1.4.5-6-gc1e55a5513e9 Eugeniu Rosca
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-12 17:13 UTC (permalink / raw)
  To: u-boot

After importing linux v4.16-rc1 commit 2c37e08464a8 ("kconfig: Warn if
choice default is not in choice"), Kconfig complains:

scripts/kconfig/conf  --syncconfig Kconfig
board/eets/pdu001/Kconfig:22:warning:        \
  choice default symbol 'PDU001_RUN_LED_RED' \
  is not contained in the choice

This looks to be caused by a typo. Fix it.

Fixes: 85ab0452fefc ("arm: add support for PDU001")
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
---

v1->v2:
* Added: Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>

 board/eets/pdu001/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/eets/pdu001/Kconfig b/board/eets/pdu001/Kconfig
index f28ba6e7bff2..e64ae28875b1 100644
--- a/board/eets/pdu001/Kconfig
+++ b/board/eets/pdu001/Kconfig
@@ -19,7 +19,7 @@ config SYS_CONFIG_NAME
 
 choice
 	prompt "State of Run LED"
-	default PDU001_RUN_LED_RED
+	default RUN_LED_RED
 	help
 	  The PDU001 has a bi-color (red/green) LED labeled 'Run' which
 	  can be used to indicate the operating state of the board. By
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 3/6] scripts/dtc: Update to upstream version v1.4.5-6-gc1e55a5513e9
  2018-05-12 17:13 [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4 Eugeniu Rosca
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 2/6] board: eets: pdu001: Fix wrong default value in Kconfig Eugeniu Rosca
@ 2018-05-12 17:13 ` Eugeniu Rosca
  2018-05-13 22:00   ` Simon Glass
  2018-05-16  1:54   ` Masahiro Yamada
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 4/6] scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987 Eugeniu Rosca
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-12 17:13 UTC (permalink / raw)
  To: u-boot

From: Rob Herring <robh@kernel.org>

Pickup the fix for handling unresolved phandles in overlays.

This adds the following commits from upstream:

c1e55a5513e9 checks: fix handling of unresolved phandles for dts plugins
f8872e29ce06 tests: Avoid 64-bit arithmetic in assembler
48c91c08bcfa libfdt: add stringlist functions to linker script

Signed-off-by: Rob Herring <robh@kernel.org>
[ Linux commit: e45fe7f788dd1395befe5639149ad8dacfbd94ab ]
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
---

v1->v2:
* Newly pushed

 scripts/dtc/checks.c      | 9 +++++++++
 scripts/dtc/version_gen.h | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
index 08a3a29edae3..e66138449886 100644
--- a/scripts/dtc/checks.c
+++ b/scripts/dtc/checks.c
@@ -988,6 +988,10 @@ static void check_property_phandle_args(struct check *c,
 		 * entries when each index position has a specific definition.
 		 */
 		if (phandle == 0 || phandle == -1) {
+			/* Give up if this is an overlay with external references */
+			if (dti->dtsflags & DTSF_PLUGIN)
+				break;
+
 			cellsize = 0;
 			continue;
 		}
@@ -1176,6 +1180,11 @@ static void check_interrupts_property(struct check *c,
 		prop = get_property(parent, "interrupt-parent");
 		if (prop) {
 			phandle = propval_cell(prop);
+			/* Give up if this is an overlay with external references */
+			if ((phandle == 0 || phandle == -1) &&
+			    (dti->dtsflags & DTSF_PLUGIN))
+					return;
+
 			irq_node = get_node_by_phandle(root, phandle);
 			if (!irq_node) {
 				FAIL(c, dti, "Bad interrupt-parent phandle for %s",
diff --git a/scripts/dtc/version_gen.h b/scripts/dtc/version_gen.h
index d88393cab14a..6a4e84798966 100644
--- a/scripts/dtc/version_gen.h
+++ b/scripts/dtc/version_gen.h
@@ -1 +1 @@
-#define DTC_VERSION "DTC 1.4.5-gb1a60033"
+#define DTC_VERSION "DTC 1.4.5-gc1e55a55"
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 4/6] scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987
  2018-05-12 17:13 [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4 Eugeniu Rosca
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 2/6] board: eets: pdu001: Fix wrong default value in Kconfig Eugeniu Rosca
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 3/6] scripts/dtc: Update to upstream version v1.4.5-6-gc1e55a5513e9 Eugeniu Rosca
@ 2018-05-12 17:13 ` Eugeniu Rosca
  2018-05-13 22:00   ` Simon Glass
  2018-05-16  1:49   ` Masahiro Yamada
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 5/6] scripts/dtc: Re-sync with Linux 4.17-rc4 Eugeniu Rosca
                   ` (3 subsequent siblings)
  6 siblings, 2 replies; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-12 17:13 UTC (permalink / raw)
  To: u-boot

From: Rob Herring <robh@kernel.org>

This adds the following commits from upstream:

aadd0b65c987 checks: centralize printing of property names in failure messages
88960e398907 checks: centralize printing of node path in check_msg
f1879e1a50eb Add limited read-only support for older (V2 and V3) device tree to libfdt.
37dea76e9700 srcpos: drop special handling of tab
65893da4aee0 libfdt: overlay: Add missing license
962a45ca034d Avoid installing pylibfdt when dependencies are missing
cd6ea1b2bea6 Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT}
51b3a16338df Makefile.tests: Add LIBDL make(1) variable for portability sake
333d533a8f4d Attempt to auto-detect stat(1) being used if not given proper invocation
e54388015af1 dtc: Bump version to v1.4.6
a1fe86f380cb fdtoverlay: Switch from using alloca to malloc
c8d5472de3ff tests: Improve compatibility with other platforms
c81d389a10cc checks: add chosen node checks
e671852042a7 checks: add aliases node checks
d0c44ebe3f42 checks: check for #{size,address}-cells without child nodes
18a3d84bb802 checks: add string list check for *-names properties
8fe94fd6f19f checks: add string list check
6c5730819604 checks: add a string check for 'label' property
a384191eba09 checks: fix sound-dai phandle with arg property check
b260c4f610c0 Fix ambiguous grammar for devicetree rule
fe667e382bac tests: Add some basic tests for the pci_bridge checks
7975f6422260 Fix widespread incorrect use of strneq(), replace with new strprefixeq()
fca296445eab Add strstarts() helper function
cc392f089007 tests: Check non-matching cases for fdt_node_check_compatible()
bba26a5291c8 livetree: avoid assertion of orphan phandles with overlays
c8f8194d76cc implement strnlen for systems that need it
c8b38f65fdec libfdt: Remove leading underscores from identifiers
3b62fdaebfe5 Remove leading underscores from identifiers
2d45d1c5c65e Replace FDT_VERSION() with stringify()
2e6fe5a107b5 Fix some errors in comments
b0ae9e4b0ceb tests: Correct warning in sw_tree1.c

Commit c8b38f65fdec upstream ("libfdt: Remove leading underscores from
identifiers") changed the multiple inclusion define protection, so the
kernel's libfdt_env.h needs the corresponding update.

Signed-off-by: Rob Herring <robh@kernel.org>
[ Linux commit: 9130ba884640328bb78aaa4840e5ddf06ccafb1c ]
[erosca: - Fixup conflicts in include/linux/libfdt_env.h caused by v2018.03-rc4
           commit b08c8c487083 ("libfdt: move headers to <linux/libfdt.h>
	   and <linux/libfdt_env.h>")
	 - Fix build errors in lib/libfdt/fdt_ro.c, tools/libfdt/fdt_rw.c by:
	   - s/_fdt_mem_rsv/fdt_mem_rsv_/
	   - s/_fdt_offset_ptr/fdt_offset_ptr_/
	   - s/_fdt_check_node_offset/fdt_check_node_offset_/
	   - s/_fdt_check_prop_offset/fdt_check_prop_offset_/
	   - s/_fdt_find_add_string/fdt_find_add_string_/]
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
---

v1-v2:
* Newly pushed

 include/linux/libfdt_env.h           |   6 +-
 lib/libfdt/fdt_ro.c                  |  18 +-
 scripts/dtc/checks.c                 | 439 ++++++++++++++++++---------
 scripts/dtc/dtc-parser.y             |  17 +-
 scripts/dtc/dtc.c                    |   7 +-
 scripts/dtc/dtc.h                    |  11 +-
 scripts/dtc/flattree.c               |   2 +-
 scripts/dtc/libfdt/fdt.c             |  13 +-
 scripts/dtc/libfdt/fdt.h             |   6 +-
 scripts/dtc/libfdt/fdt_overlay.c     |  51 ++++
 scripts/dtc/libfdt/fdt_ro.c          | 132 ++++++--
 scripts/dtc/libfdt/fdt_rw.c          |  90 +++---
 scripts/dtc/libfdt/fdt_sw.c          |  24 +-
 scripts/dtc/libfdt/fdt_wip.c         |  10 +-
 scripts/dtc/libfdt/libfdt.h          |  37 +--
 scripts/dtc/libfdt/libfdt_env.h      |  33 +-
 scripts/dtc/libfdt/libfdt_internal.h |  32 +-
 scripts/dtc/livetree.c               |  10 +-
 scripts/dtc/srcpos.c                 |   5 -
 scripts/dtc/srcpos.h                 |   6 +-
 scripts/dtc/util.h                   |   9 +-
 scripts/dtc/version_gen.h            |   2 +-
 tools/libfdt/fdt_rw.c                |   2 +-
 23 files changed, 632 insertions(+), 330 deletions(-)

diff --git a/include/linux/libfdt_env.h b/include/linux/libfdt_env.h
index 0d209a649286..e2bf79c7ee8d 100644
--- a/include/linux/libfdt_env.h
+++ b/include/linux/libfdt_env.h
@@ -6,8 +6,8 @@
  * Using the same guard name as that of scripts/dtc/libfdt/libfdt_env.h
  * prevents it from being included.
  */
-#ifndef _LIBFDT_ENV_H
-#define _LIBFDT_ENV_H
+#ifndef LIBFDT_ENV_H
+#define LIBFDT_ENV_H
 
 #include <linux/string.h>
 
@@ -27,5 +27,5 @@ typedef __be64 fdt64_t;
 
 #define strtoul(cp, endp, base)	simple_strtoul(cp, endp, base)
 
-#endif /* _LIBFDT_ENV_H */
+#endif /* LIBFDT_ENV_H */
 #endif
diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c
index 4b7008d88fe9..b6ca4e0b0c30 100644
--- a/lib/libfdt/fdt_ro.c
+++ b/lib/libfdt/fdt_ro.c
@@ -76,8 +76,8 @@ uint32_t fdt_get_max_phandle(const void *fdt)
 int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size)
 {
 	FDT_CHECK_HEADER(fdt);
-	*address = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->address);
-	*size = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->size);
+	*address = fdt64_to_cpu(fdt_mem_rsv_(fdt, n)->address);
+	*size = fdt64_to_cpu(fdt_mem_rsv_(fdt, n)->size);
 	return 0;
 }
 
@@ -85,7 +85,7 @@ int fdt_num_mem_rsv(const void *fdt)
 {
 	int i = 0;
 
-	while (fdt64_to_cpu(_fdt_mem_rsv(fdt, i)->size) != 0)
+	while (fdt64_to_cpu(fdt_mem_rsv_(fdt, i)->size) != 0)
 		i++;
 	return i;
 }
@@ -211,11 +211,11 @@ int fdt_path_offset(const void *fdt, const char *path)
 
 const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
 {
-	const struct fdt_node_header *nh = _fdt_offset_ptr(fdt, nodeoffset);
+	const struct fdt_node_header *nh = fdt_offset_ptr_(fdt, nodeoffset);
 	int err;
 
 	if (((err = fdt_check_header(fdt)) != 0)
-	    || ((err = _fdt_check_node_offset(fdt, nodeoffset)) < 0))
+	    || ((err = fdt_check_node_offset_(fdt, nodeoffset)) < 0))
 			goto fail;
 
 	if (len)
@@ -233,7 +233,7 @@ int fdt_first_property_offset(const void *fdt, int nodeoffset)
 {
 	int offset;
 
-	if ((offset = _fdt_check_node_offset(fdt, nodeoffset)) < 0)
+	if ((offset = fdt_check_node_offset_(fdt, nodeoffset)) < 0)
 		return offset;
 
 	return _nextprop(fdt, offset);
@@ -241,7 +241,7 @@ int fdt_first_property_offset(const void *fdt, int nodeoffset)
 
 int fdt_next_property_offset(const void *fdt, int offset)
 {
-	if ((offset = _fdt_check_prop_offset(fdt, offset)) < 0)
+	if ((offset = fdt_check_prop_offset_(fdt, offset)) < 0)
 		return offset;
 
 	return _nextprop(fdt, offset);
@@ -254,13 +254,13 @@ const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
 	int err;
 	const struct fdt_property *prop;
 
-	if ((err = _fdt_check_prop_offset(fdt, offset)) < 0) {
+	if ((err = fdt_check_prop_offset_(fdt, offset)) < 0) {
 		if (lenp)
 			*lenp = err;
 		return NULL;
 	}
 
-	prop = _fdt_offset_ptr(fdt, offset);
+	prop = fdt_offset_ptr_(fdt, offset);
 
 	if (lenp)
 		*lenp = fdt32_to_cpu(prop->len);
diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
index e66138449886..c07ba4da9e36 100644
--- a/scripts/dtc/checks.c
+++ b/scripts/dtc/checks.c
@@ -53,26 +53,28 @@ struct check {
 	struct check **prereq;
 };
 
-#define CHECK_ENTRY(_nm, _fn, _d, _w, _e, ...)	       \
-	static struct check *_nm##_prereqs[] = { __VA_ARGS__ }; \
-	static struct check _nm = { \
-		.name = #_nm, \
-		.fn = (_fn), \
-		.data = (_d), \
-		.warn = (_w), \
-		.error = (_e), \
+#define CHECK_ENTRY(nm_, fn_, d_, w_, e_, ...)	       \
+	static struct check *nm_##_prereqs[] = { __VA_ARGS__ }; \
+	static struct check nm_ = { \
+		.name = #nm_, \
+		.fn = (fn_), \
+		.data = (d_), \
+		.warn = (w_), \
+		.error = (e_), \
 		.status = UNCHECKED, \
-		.num_prereqs = ARRAY_SIZE(_nm##_prereqs), \
-		.prereq = _nm##_prereqs, \
+		.num_prereqs = ARRAY_SIZE(nm_##_prereqs), \
+		.prereq = nm_##_prereqs, \
 	};
-#define WARNING(_nm, _fn, _d, ...) \
-	CHECK_ENTRY(_nm, _fn, _d, true, false, __VA_ARGS__)
-#define ERROR(_nm, _fn, _d, ...) \
-	CHECK_ENTRY(_nm, _fn, _d, false, true, __VA_ARGS__)
-#define CHECK(_nm, _fn, _d, ...) \
-	CHECK_ENTRY(_nm, _fn, _d, false, false, __VA_ARGS__)
-
-static inline void  PRINTF(3, 4) check_msg(struct check *c, struct dt_info *dti,
+#define WARNING(nm_, fn_, d_, ...) \
+	CHECK_ENTRY(nm_, fn_, d_, true, false, __VA_ARGS__)
+#define ERROR(nm_, fn_, d_, ...) \
+	CHECK_ENTRY(nm_, fn_, d_, false, true, __VA_ARGS__)
+#define CHECK(nm_, fn_, d_, ...) \
+	CHECK_ENTRY(nm_, fn_, d_, false, false, __VA_ARGS__)
+
+static inline void  PRINTF(5, 6) check_msg(struct check *c, struct dt_info *dti,
+					   struct node *node,
+					   struct property *prop,
 					   const char *fmt, ...)
 {
 	va_list ap;
@@ -83,19 +85,33 @@ static inline void  PRINTF(3, 4) check_msg(struct check *c, struct dt_info *dti,
 		fprintf(stderr, "%s: %s (%s): ",
 			strcmp(dti->outname, "-") ? dti->outname : "<stdout>",
 			(c->error) ? "ERROR" : "Warning", c->name);
+		if (node) {
+			fprintf(stderr, "%s", node->fullpath);
+			if (prop)
+				fprintf(stderr, ":%s", prop->name);
+			fputs(": ", stderr);
+		}
 		vfprintf(stderr, fmt, ap);
 		fprintf(stderr, "\n");
 	}
 	va_end(ap);
 }
 
-#define FAIL(c, dti, ...)						\
+#define FAIL(c, dti, node, ...)						\
+	do {								\
+		TRACE((c), "\t\tFAILED at %s:%d", __FILE__, __LINE__);	\
+		(c)->status = FAILED;					\
+		check_msg((c), dti, node, NULL, __VA_ARGS__);		\
+	} while (0)
+
+#define FAIL_PROP(c, dti, node, prop, ...)				\
 	do {								\
 		TRACE((c), "\t\tFAILED at %s:%d", __FILE__, __LINE__);	\
 		(c)->status = FAILED;					\
-		check_msg((c), dti, __VA_ARGS__);			\
+		check_msg((c), dti, node, prop, __VA_ARGS__);		\
 	} while (0)
 
+
 static void check_nodes_props(struct check *c, struct dt_info *dti, struct node *node)
 {
 	struct node *child;
@@ -126,7 +142,7 @@ static bool run_check(struct check *c, struct dt_info *dti)
 		error = error || run_check(prq, dti);
 		if (prq->status != PASSED) {
 			c->status = PREREQ;
-			check_msg(c, dti, "Failed prerequisite '%s'",
+			check_msg(c, dti, NULL, NULL, "Failed prerequisite '%s'",
 				  c->prereq[i]->name);
 		}
 	}
@@ -156,7 +172,7 @@ out:
 static inline void check_always_fail(struct check *c, struct dt_info *dti,
 				     struct node *node)
 {
-	FAIL(c, dti, "always_fail check");
+	FAIL(c, dti, node, "always_fail check");
 }
 CHECK(always_fail, check_always_fail, NULL);
 
@@ -171,14 +187,42 @@ static void check_is_string(struct check *c, struct dt_info *dti,
 		return; /* Not present, assumed ok */
 
 	if (!data_is_one_string(prop->val))
-		FAIL(c, dti, "\"%s\" property in %s is not a string",
-		     propname, node->fullpath);
+		FAIL_PROP(c, dti, node, prop, "property is not a string");
 }
 #define WARNING_IF_NOT_STRING(nm, propname) \
 	WARNING(nm, check_is_string, (propname))
 #define ERROR_IF_NOT_STRING(nm, propname) \
 	ERROR(nm, check_is_string, (propname))
 
+static void check_is_string_list(struct check *c, struct dt_info *dti,
+				 struct node *node)
+{
+	int rem, l;
+	struct property *prop;
+	char *propname = c->data;
+	char *str;
+
+	prop = get_property(node, propname);
+	if (!prop)
+		return; /* Not present, assumed ok */
+
+	str = prop->val.val;
+	rem = prop->val.len;
+	while (rem > 0) {
+		l = strnlen(str, rem);
+		if (l == rem) {
+			FAIL_PROP(c, dti, node, prop, "property is not a string list");
+			break;
+		}
+		rem -= l + 1;
+		str += l + 1;
+	}
+}
+#define WARNING_IF_NOT_STRING_LIST(nm, propname) \
+	WARNING(nm, check_is_string_list, (propname))
+#define ERROR_IF_NOT_STRING_LIST(nm, propname) \
+	ERROR(nm, check_is_string_list, (propname))
+
 static void check_is_cell(struct check *c, struct dt_info *dti,
 			  struct node *node)
 {
@@ -190,8 +234,7 @@ static void check_is_cell(struct check *c, struct dt_info *dti,
 		return; /* Not present, assumed ok */
 
 	if (prop->val.len != sizeof(cell_t))
-		FAIL(c, dti, "\"%s\" property in %s is not a single cell",
-		     propname, node->fullpath);
+		FAIL_PROP(c, dti, node, prop, "property is not a single cell");
 }
 #define WARNING_IF_NOT_CELL(nm, propname) \
 	WARNING(nm, check_is_cell, (propname))
@@ -212,8 +255,7 @@ static void check_duplicate_node_names(struct check *c, struct dt_info *dti,
 		     child2;
 		     child2 = child2->next_sibling)
 			if (streq(child->name, child2->name))
-				FAIL(c, dti, "Duplicate node name %s",
-				     child->fullpath);
+				FAIL(c, dti, node, "Duplicate node name");
 }
 ERROR(duplicate_node_names, check_duplicate_node_names, NULL);
 
@@ -227,8 +269,7 @@ static void check_duplicate_property_names(struct check *c, struct dt_info *dti,
 			if (prop2->deleted)
 				continue;
 			if (streq(prop->name, prop2->name))
-				FAIL(c, dti, "Duplicate property name %s in %s",
-				     prop->name, node->fullpath);
+				FAIL_PROP(c, dti, node, prop, "Duplicate property name");
 		}
 	}
 }
@@ -246,8 +287,8 @@ static void check_node_name_chars(struct check *c, struct dt_info *dti,
 	int n = strspn(node->name, c->data);
 
 	if (n < strlen(node->name))
-		FAIL(c, dti, "Bad character '%c' in node %s",
-		     node->name[n], node->fullpath);
+		FAIL(c, dti, node, "Bad character '%c' in node name",
+		     node->name[n]);
 }
 ERROR(node_name_chars, check_node_name_chars, PROPNODECHARS "@");
 
@@ -257,8 +298,8 @@ static void check_node_name_chars_strict(struct check *c, struct dt_info *dti,
 	int n = strspn(node->name, c->data);
 
 	if (n < node->basenamelen)
-		FAIL(c, dti, "Character '%c' not recommended in node %s",
-		     node->name[n], node->fullpath);
+		FAIL(c, dti, node, "Character '%c' not recommended in node name",
+		     node->name[n]);
 }
 CHECK(node_name_chars_strict, check_node_name_chars_strict, PROPNODECHARSSTRICT);
 
@@ -266,8 +307,7 @@ static void check_node_name_format(struct check *c, struct dt_info *dti,
 				   struct node *node)
 {
 	if (strchr(get_unitname(node), '@'))
-		FAIL(c, dti, "Node %s has multiple '@' characters in name",
-		     node->fullpath);
+		FAIL(c, dti, node, "multiple '@' characters in node name");
 }
 ERROR(node_name_format, check_node_name_format, NULL, &node_name_chars);
 
@@ -285,12 +325,10 @@ static void check_unit_address_vs_reg(struct check *c, struct dt_info *dti,
 
 	if (prop) {
 		if (!unitname[0])
-			FAIL(c, dti, "Node %s has a reg or ranges property, but no unit name",
-			    node->fullpath);
+			FAIL(c, dti, node, "node has a reg or ranges property, but no unit name");
 	} else {
 		if (unitname[0])
-			FAIL(c, dti, "Node %s has a unit name, but no reg property",
-			    node->fullpath);
+			FAIL(c, dti, node, "node has a unit name, but no reg property");
 	}
 }
 WARNING(unit_address_vs_reg, check_unit_address_vs_reg, NULL);
@@ -304,8 +342,8 @@ static void check_property_name_chars(struct check *c, struct dt_info *dti,
 		int n = strspn(prop->name, c->data);
 
 		if (n < strlen(prop->name))
-			FAIL(c, dti, "Bad character '%c' in property name \"%s\", node %s",
-			     prop->name[n], prop->name, node->fullpath);
+			FAIL_PROP(c, dti, node, prop, "Bad character '%c' in property name",
+				  prop->name[n]);
 	}
 }
 ERROR(property_name_chars, check_property_name_chars, PROPNODECHARS);
@@ -336,8 +374,8 @@ static void check_property_name_chars_strict(struct check *c,
 			n = strspn(name, c->data);
 		}
 		if (n < strlen(name))
-			FAIL(c, dti, "Character '%c' not recommended in property name \"%s\", node %s",
-			     name[n], prop->name, node->fullpath);
+			FAIL_PROP(c, dti, node, prop, "Character '%c' not recommended in property name",
+				  name[n]);
 	}
 }
 CHECK(property_name_chars_strict, check_property_name_chars_strict, PROPNODECHARSSTRICT);
@@ -370,7 +408,7 @@ static void check_duplicate_label(struct check *c, struct dt_info *dti,
 		return;
 
 	if ((othernode != node) || (otherprop != prop) || (othermark != mark))
-		FAIL(c, dti, "Duplicate label '%s' on " DESCLABEL_FMT
+		FAIL(c, dti, node, "Duplicate label '%s' on " DESCLABEL_FMT
 		     " and " DESCLABEL_FMT,
 		     label, DESCLABEL_ARGS(node, prop, mark),
 		     DESCLABEL_ARGS(othernode, otherprop, othermark));
@@ -410,8 +448,8 @@ static cell_t check_phandle_prop(struct check *c, struct dt_info *dti,
 		return 0;
 
 	if (prop->val.len != sizeof(cell_t)) {
-		FAIL(c, dti, "%s has bad length (%d) %s property",
-		     node->fullpath, prop->val.len, prop->name);
+		FAIL_PROP(c, dti, node, prop, "bad length (%d) %s property",
+			  prop->val.len, prop->name);
 		return 0;
 	}
 
@@ -422,8 +460,8 @@ static cell_t check_phandle_prop(struct check *c, struct dt_info *dti,
 			/* "Set this node's phandle equal to some
 			 * other node's phandle".  That's nonsensical
 			 * by construction. */ {
-			FAIL(c, dti, "%s in %s is a reference to another node",
-			     prop->name, node->fullpath);
+			FAIL(c, dti, node, "%s is a reference to another node",
+			     prop->name);
 		}
 		/* But setting this node's phandle equal to its own
 		 * phandle is allowed - that means allocate a unique
@@ -436,8 +474,8 @@ static cell_t check_phandle_prop(struct check *c, struct dt_info *dti,
 	phandle = propval_cell(prop);
 
 	if ((phandle == 0) || (phandle == -1)) {
-		FAIL(c, dti, "%s has bad value (0x%x) in %s property",
-		     node->fullpath, phandle, prop->name);
+		FAIL_PROP(c, dti, node, prop, "bad value (0x%x) in %s property",
+		     phandle, prop->name);
 		return 0;
 	}
 
@@ -463,16 +501,16 @@ static void check_explicit_phandles(struct check *c, struct dt_info *dti,
 		return;
 
 	if (linux_phandle && phandle && (phandle != linux_phandle))
-		FAIL(c, dti, "%s has mismatching 'phandle' and 'linux,phandle'"
-		     " properties", node->fullpath);
+		FAIL(c, dti, node, "mismatching 'phandle' and 'linux,phandle'"
+		     " properties");
 
 	if (linux_phandle && !phandle)
 		phandle = linux_phandle;
 
 	other = get_node_by_phandle(root, phandle);
 	if (other && (other != node)) {
-		FAIL(c, dti, "%s has duplicated phandle 0x%x (seen before at %s)",
-		     node->fullpath, phandle, other->fullpath);
+		FAIL(c, dti, node, "duplicated phandle 0x%x (seen before at %s)",
+		     phandle, other->fullpath);
 		return;
 	}
 
@@ -496,8 +534,8 @@ static void check_name_properties(struct check *c, struct dt_info *dti,
 
 	if ((prop->val.len != node->basenamelen+1)
 	    || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) {
-		FAIL(c, dti, "\"name\" property in %s is incorrect (\"%s\" instead"
-		     " of base node name)", node->fullpath, prop->val.val);
+		FAIL(c, dti, node, "\"name\" property is incorrect (\"%s\" instead"
+		     " of base node name)", prop->val.val);
 	} else {
 		/* The name property is correct, and therefore redundant.
 		 * Delete it */
@@ -531,7 +569,7 @@ static void fixup_phandle_references(struct check *c, struct dt_info *dti,
 			refnode = get_node_by_ref(dt, m->ref);
 			if (! refnode) {
 				if (!(dti->dtsflags & DTSF_PLUGIN))
-					FAIL(c, dti, "Reference to non-existent node or "
+					FAIL(c, dti, node, "Reference to non-existent node or "
 							"label \"%s\"\n", m->ref);
 				else /* mark the entry as unresolved */
 					*((fdt32_t *)(prop->val.val + m->offset)) =
@@ -563,7 +601,7 @@ static void fixup_path_references(struct check *c, struct dt_info *dti,
 
 			refnode = get_node_by_ref(dt, m->ref);
 			if (!refnode) {
-				FAIL(c, dti, "Reference to non-existent node or label \"%s\"\n",
+				FAIL(c, dti, node, "Reference to non-existent node or label \"%s\"\n",
 				     m->ref);
 				continue;
 			}
@@ -586,6 +624,45 @@ WARNING_IF_NOT_CELL(interrupt_cells_is_cell, "#interrupt-cells");
 WARNING_IF_NOT_STRING(device_type_is_string, "device_type");
 WARNING_IF_NOT_STRING(model_is_string, "model");
 WARNING_IF_NOT_STRING(status_is_string, "status");
+WARNING_IF_NOT_STRING(label_is_string, "label");
+
+WARNING_IF_NOT_STRING_LIST(compatible_is_string_list, "compatible");
+
+static void check_names_is_string_list(struct check *c, struct dt_info *dti,
+				       struct node *node)
+{
+	struct property *prop;
+
+	for_each_property(node, prop) {
+		const char *s = strrchr(prop->name, '-');
+		if (!s || !streq(s, "-names"))
+			continue;
+
+		c->data = prop->name;
+		check_is_string_list(c, dti, node);
+	}
+}
+WARNING(names_is_string_list, check_names_is_string_list, NULL);
+
+static void check_alias_paths(struct check *c, struct dt_info *dti,
+				    struct node *node)
+{
+	struct property *prop;
+
+	if (!streq(node->name, "aliases"))
+		return;
+
+	for_each_property(node, prop) {
+		if (!prop->val.val || !get_node_by_path(dti->dt, prop->val.val)) {
+			FAIL_PROP(c, dti, node, prop, "aliases property is not a valid node (%s)",
+				  prop->val.val);
+			continue;
+		}
+		if (strspn(prop->name, LOWERCASE DIGITS "-") != strlen(prop->name))
+			FAIL(c, dti, node, "aliases property name must include only lowercase and '-'");
+	}
+}
+WARNING(alias_paths, check_alias_paths, NULL);
 
 static void fixup_addr_size_cells(struct check *c, struct dt_info *dti,
 				  struct node *node)
@@ -622,21 +699,21 @@ static void check_reg_format(struct check *c, struct dt_info *dti,
 		return; /* No "reg", that's fine */
 
 	if (!node->parent) {
-		FAIL(c, dti, "Root node has a \"reg\" property");
+		FAIL(c, dti, node, "Root node has a \"reg\" property");
 		return;
 	}
 
 	if (prop->val.len == 0)
-		FAIL(c, dti, "\"reg\" property in %s is empty", node->fullpath);
+		FAIL_PROP(c, dti, node, prop, "property is empty");
 
 	addr_cells = node_addr_cells(node->parent);
 	size_cells = node_size_cells(node->parent);
 	entrylen = (addr_cells + size_cells) * sizeof(cell_t);
 
 	if (!entrylen || (prop->val.len % entrylen) != 0)
-		FAIL(c, dti, "\"reg\" property in %s has invalid length (%d bytes) "
-		     "(#address-cells == %d, #size-cells == %d)",
-		     node->fullpath, prop->val.len, addr_cells, size_cells);
+		FAIL_PROP(c, dti, node, prop, "property has invalid length (%d bytes) "
+			  "(#address-cells == %d, #size-cells == %d)",
+			  prop->val.len, addr_cells, size_cells);
 }
 WARNING(reg_format, check_reg_format, NULL, &addr_size_cells);
 
@@ -651,7 +728,7 @@ static void check_ranges_format(struct check *c, struct dt_info *dti,
 		return;
 
 	if (!node->parent) {
-		FAIL(c, dti, "Root node has a \"ranges\" property");
+		FAIL_PROP(c, dti, node, prop, "Root node has a \"ranges\" property");
 		return;
 	}
 
@@ -663,20 +740,20 @@ static void check_ranges_format(struct check *c, struct dt_info *dti,
 
 	if (prop->val.len == 0) {
 		if (p_addr_cells != c_addr_cells)
-			FAIL(c, dti, "%s has empty \"ranges\" property but its "
-			     "#address-cells (%d) differs from %s (%d)",
-			     node->fullpath, c_addr_cells, node->parent->fullpath,
-			     p_addr_cells);
+			FAIL_PROP(c, dti, node, prop, "empty \"ranges\" property but its "
+				  "#address-cells (%d) differs from %s (%d)",
+				  c_addr_cells, node->parent->fullpath,
+				  p_addr_cells);
 		if (p_size_cells != c_size_cells)
-			FAIL(c, dti, "%s has empty \"ranges\" property but its "
-			     "#size-cells (%d) differs from %s (%d)",
-			     node->fullpath, c_size_cells, node->parent->fullpath,
-			     p_size_cells);
+			FAIL_PROP(c, dti, node, prop, "empty \"ranges\" property but its "
+				  "#size-cells (%d) differs from %s (%d)",
+				  c_size_cells, node->parent->fullpath,
+				  p_size_cells);
 	} else if ((prop->val.len % entrylen) != 0) {
-		FAIL(c, dti, "\"ranges\" property in %s has invalid length (%d bytes) "
-		     "(parent #address-cells == %d, child #address-cells == %d, "
-		     "#size-cells == %d)", node->fullpath, prop->val.len,
-		     p_addr_cells, c_addr_cells, c_size_cells);
+		FAIL_PROP(c, dti, node, prop, "\"ranges\" property has invalid length (%d bytes) "
+			  "(parent #address-cells == %d, child #address-cells == %d, "
+			  "#size-cells == %d)", prop->val.len,
+			  p_addr_cells, c_addr_cells, c_size_cells);
 	}
 }
 WARNING(ranges_format, check_ranges_format, NULL, &addr_size_cells);
@@ -696,41 +773,33 @@ static void check_pci_bridge(struct check *c, struct dt_info *dti, struct node *
 
 	node->bus = &pci_bus;
 
-	if (!strneq(node->name, "pci", node->basenamelen) &&
-	    !strneq(node->name, "pcie", node->basenamelen))
-		FAIL(c, dti, "Node %s node name is not \"pci\" or \"pcie\"",
-			     node->fullpath);
+	if (!strprefixeq(node->name, node->basenamelen, "pci") &&
+	    !strprefixeq(node->name, node->basenamelen, "pcie"))
+		FAIL(c, dti, node, "node name is not \"pci\" or \"pcie\"");
 
 	prop = get_property(node, "ranges");
 	if (!prop)
-		FAIL(c, dti, "Node %s missing ranges for PCI bridge (or not a bridge)",
-			     node->fullpath);
+		FAIL(c, dti, node, "missing ranges for PCI bridge (or not a bridge)");
 
 	if (node_addr_cells(node) != 3)
-		FAIL(c, dti, "Node %s incorrect #address-cells for PCI bridge",
-			     node->fullpath);
+		FAIL(c, dti, node, "incorrect #address-cells for PCI bridge");
 	if (node_size_cells(node) != 2)
-		FAIL(c, dti, "Node %s incorrect #size-cells for PCI bridge",
-			     node->fullpath);
+		FAIL(c, dti, node, "incorrect #size-cells for PCI bridge");
 
 	prop = get_property(node, "bus-range");
 	if (!prop) {
-		FAIL(c, dti, "Node %s missing bus-range for PCI bridge",
-			     node->fullpath);
+		FAIL(c, dti, node, "missing bus-range for PCI bridge");
 		return;
 	}
 	if (prop->val.len != (sizeof(cell_t) * 2)) {
-		FAIL(c, dti, "Node %s bus-range must be 2 cells",
-			     node->fullpath);
+		FAIL_PROP(c, dti, node, prop, "value must be 2 cells");
 		return;
 	}
 	cells = (cell_t *)prop->val.val;
 	if (fdt32_to_cpu(cells[0]) > fdt32_to_cpu(cells[1]))
-		FAIL(c, dti, "Node %s bus-range 1st cell must be less than or equal to 2nd cell",
-			     node->fullpath);
+		FAIL_PROP(c, dti, node, prop, "1st cell must be less than or equal to 2nd cell");
 	if (fdt32_to_cpu(cells[1]) > 0xff)
-		FAIL(c, dti, "Node %s bus-range maximum bus number must be less than 256",
-			     node->fullpath);
+		FAIL_PROP(c, dti, node, prop, "maximum bus number must be less than 256");
 }
 WARNING(pci_bridge, check_pci_bridge, NULL,
 	&device_type_is_string, &addr_size_cells);
@@ -760,8 +829,8 @@ static void check_pci_device_bus_num(struct check *c, struct dt_info *dti, struc
 		max_bus = fdt32_to_cpu(cells[0]);
 	}
 	if ((bus_num < min_bus) || (bus_num > max_bus))
-		FAIL(c, dti, "Node %s PCI bus number %d out of range, expected (%d - %d)",
-		     node->fullpath, bus_num, min_bus, max_bus);
+		FAIL_PROP(c, dti, node, prop, "PCI bus number %d out of range, expected (%d - %d)",
+			  bus_num, min_bus, max_bus);
 }
 WARNING(pci_device_bus_num, check_pci_device_bus_num, NULL, &reg_format, &pci_bridge);
 
@@ -778,25 +847,22 @@ static void check_pci_device_reg(struct check *c, struct dt_info *dti, struct no
 
 	prop = get_property(node, "reg");
 	if (!prop) {
-		FAIL(c, dti, "Node %s missing PCI reg property", node->fullpath);
+		FAIL(c, dti, node, "missing PCI reg property");
 		return;
 	}
 
 	cells = (cell_t *)prop->val.val;
 	if (cells[1] || cells[2])
-		FAIL(c, dti, "Node %s PCI reg config space address cells 2 and 3 must be 0",
-			     node->fullpath);
+		FAIL_PROP(c, dti, node, prop, "PCI reg config space address cells 2 and 3 must be 0");
 
 	reg = fdt32_to_cpu(cells[0]);
 	dev = (reg & 0xf800) >> 11;
 	func = (reg & 0x700) >> 8;
 
 	if (reg & 0xff000000)
-		FAIL(c, dti, "Node %s PCI reg address is not configuration space",
-			     node->fullpath);
+		FAIL_PROP(c, dti, node, prop, "PCI reg address is not configuration space");
 	if (reg & 0x000000ff)
-		FAIL(c, dti, "Node %s PCI reg config space address register number must be 0",
-			     node->fullpath);
+		FAIL_PROP(c, dti, node, prop, "PCI reg config space address register number must be 0");
 
 	if (func == 0) {
 		snprintf(unit_addr, sizeof(unit_addr), "%x", dev);
@@ -808,8 +874,8 @@ static void check_pci_device_reg(struct check *c, struct dt_info *dti, struct no
 	if (streq(unitname, unit_addr))
 		return;
 
-	FAIL(c, dti, "Node %s PCI unit address format error, expected \"%s\"",
-	     node->fullpath, unit_addr);
+	FAIL(c, dti, node, "PCI unit address format error, expected \"%s\"",
+	     unit_addr);
 }
 WARNING(pci_device_reg, check_pci_device_reg, NULL, &reg_format, &pci_bridge);
 
@@ -828,7 +894,7 @@ static bool node_is_compatible(struct node *node, const char *compat)
 
 	for (str = prop->val.val, end = str + prop->val.len; str < end;
 	     str += strnlen(str, end - str) + 1) {
-		if (strneq(str, compat, end - str))
+		if (strprefixeq(str, end - str, compat))
 			return true;
 	}
 	return false;
@@ -865,7 +931,7 @@ static void check_simple_bus_reg(struct check *c, struct dt_info *dti, struct no
 
 	if (!cells) {
 		if (node->parent->parent && !(node->bus == &simple_bus))
-			FAIL(c, dti, "Node %s missing or empty reg/ranges property", node->fullpath);
+			FAIL(c, dti, node, "missing or empty reg/ranges property");
 		return;
 	}
 
@@ -875,8 +941,8 @@ static void check_simple_bus_reg(struct check *c, struct dt_info *dti, struct no
 
 	snprintf(unit_addr, sizeof(unit_addr), "%"PRIx64, reg);
 	if (!streq(unitname, unit_addr))
-		FAIL(c, dti, "Node %s simple-bus unit address format error, expected \"%s\"",
-		     node->fullpath, unit_addr);
+		FAIL(c, dti, node, "simple-bus unit address format error, expected \"%s\"",
+		     unit_addr);
 }
 WARNING(simple_bus_reg, check_simple_bus_reg, NULL, &reg_format, &simple_bus_bridge);
 
@@ -892,14 +958,12 @@ static void check_unit_address_format(struct check *c, struct dt_info *dti,
 		return;
 
 	if (!strncmp(unitname, "0x", 2)) {
-		FAIL(c, dti, "Node %s unit name should not have leading \"0x\"",
-		    node->fullpath);
+		FAIL(c, dti, node, "unit name should not have leading \"0x\"");
 		/* skip over 0x for next test */
 		unitname += 2;
 	}
 	if (unitname[0] == '0' && isxdigit(unitname[1]))
-		FAIL(c, dti, "Node %s unit name should not have leading 0s",
-		    node->fullpath);
+		FAIL(c, dti, node, "unit name should not have leading 0s");
 }
 WARNING(unit_address_format, check_unit_address_format, NULL,
 	&node_name_format, &pci_bridge, &simple_bus_bridge);
@@ -922,16 +986,38 @@ static void check_avoid_default_addr_size(struct check *c, struct dt_info *dti,
 		return;
 
 	if (node->parent->addr_cells == -1)
-		FAIL(c, dti, "Relying on default #address-cells value for %s",
-		     node->fullpath);
+		FAIL(c, dti, node, "Relying on default #address-cells value");
 
 	if (node->parent->size_cells == -1)
-		FAIL(c, dti, "Relying on default #size-cells value for %s",
-		     node->fullpath);
+		FAIL(c, dti, node, "Relying on default #size-cells value");
 }
 WARNING(avoid_default_addr_size, check_avoid_default_addr_size, NULL,
 	&addr_size_cells);
 
+static void check_avoid_unnecessary_addr_size(struct check *c, struct dt_info *dti,
+					      struct node *node)
+{
+	struct property *prop;
+	struct node *child;
+	bool has_reg = false;
+
+	if (!node->parent || node->addr_cells < 0 || node->size_cells < 0)
+		return;
+
+	if (get_property(node, "ranges") || !node->children)
+		return;
+
+	for_each_child(node, child) {
+		prop = get_property(child, "reg");
+		if (prop)
+			has_reg = true;
+	}
+
+	if (!has_reg)
+		FAIL(c, dti, node, "unnecessary #address-cells/#size-cells without \"ranges\" or child \"reg\" property");
+}
+WARNING(avoid_unnecessary_addr_size, check_avoid_unnecessary_addr_size, NULL, &avoid_default_addr_size);
+
 static void check_obsolete_chosen_interrupt_controller(struct check *c,
 						       struct dt_info *dti,
 						       struct node *node)
@@ -950,12 +1036,61 @@ static void check_obsolete_chosen_interrupt_controller(struct check *c,
 
 	prop = get_property(chosen, "interrupt-controller");
 	if (prop)
-		FAIL(c, dti, "/chosen has obsolete \"interrupt-controller\" "
-		     "property");
+		FAIL_PROP(c, dti, node, prop,
+			  "/chosen has obsolete \"interrupt-controller\" property");
 }
 WARNING(obsolete_chosen_interrupt_controller,
 	check_obsolete_chosen_interrupt_controller, NULL);
 
+static void check_chosen_node_is_root(struct check *c, struct dt_info *dti,
+				      struct node *node)
+{
+	if (!streq(node->name, "chosen"))
+		return;
+
+	if (node->parent != dti->dt)
+		FAIL(c, dti, node, "chosen node must be at root node");
+}
+WARNING(chosen_node_is_root, check_chosen_node_is_root, NULL);
+
+static void check_chosen_node_bootargs(struct check *c, struct dt_info *dti,
+				       struct node *node)
+{
+	struct property *prop;
+
+	if (!streq(node->name, "chosen"))
+		return;
+
+	prop = get_property(node, "bootargs");
+	if (!prop)
+		return;
+
+	c->data = prop->name;
+	check_is_string(c, dti, node);
+}
+WARNING(chosen_node_bootargs, check_chosen_node_bootargs, NULL);
+
+static void check_chosen_node_stdout_path(struct check *c, struct dt_info *dti,
+					  struct node *node)
+{
+	struct property *prop;
+
+	if (!streq(node->name, "chosen"))
+		return;
+
+	prop = get_property(node, "stdout-path");
+	if (!prop) {
+		prop = get_property(node, "linux,stdout-path");
+		if (!prop)
+			return;
+		FAIL_PROP(c, dti, node, prop, "Use 'stdout-path' instead");
+	}
+
+	c->data = prop->name;
+	check_is_string(c, dti, node);
+}
+WARNING(chosen_node_stdout_path, check_chosen_node_stdout_path, NULL);
+
 struct provider {
 	const char *prop_name;
 	const char *cell_name;
@@ -972,8 +1107,9 @@ static void check_property_phandle_args(struct check *c,
 	int cell, cellsize = 0;
 
 	if (prop->val.len % sizeof(cell_t)) {
-		FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s",
-		     prop->name, prop->val.len, sizeof(cell_t), node->fullpath);
+		FAIL_PROP(c, dti, node, prop,
+			  "property size (%d) is invalid, expected multiple of %zu",
+			  prop->val.len, sizeof(cell_t));
 		return;
 	}
 
@@ -1004,14 +1140,16 @@ static void check_property_phandle_args(struct check *c,
 					break;
 			}
 			if (!m)
-				FAIL(c, dti, "Property '%s', cell %d is not a phandle reference in %s",
-				     prop->name, cell, node->fullpath);
+				FAIL_PROP(c, dti, node, prop,
+					  "cell %d is not a phandle reference",
+					  cell);
 		}
 
 		provider_node = get_node_by_phandle(root, phandle);
 		if (!provider_node) {
-			FAIL(c, dti, "Could not get phandle node for %s:%s(cell %d)",
-			     node->fullpath, prop->name, cell);
+			FAIL_PROP(c, dti, node, prop,
+				  "Could not get phandle node for (cell %d)",
+				  cell);
 			break;
 		}
 
@@ -1021,16 +1159,17 @@ static void check_property_phandle_args(struct check *c,
 		} else if (provider->optional) {
 			cellsize = 0;
 		} else {
-			FAIL(c, dti, "Missing property '%s' in node %s or bad phandle (referred from %s:%s[%d])",
+			FAIL(c, dti, node, "Missing property '%s' in node %s or bad phandle (referred from %s[%d])",
 			     provider->cell_name,
 			     provider_node->fullpath,
-			     node->fullpath, prop->name, cell);
+			     prop->name, cell);
 			break;
 		}
 
 		if (prop->val.len < ((cell + cellsize + 1) * sizeof(cell_t))) {
-			FAIL(c, dti, "%s property size (%d) too small for cell size %d in %s",
-			     prop->name, prop->val.len, cellsize, node->fullpath);
+			FAIL_PROP(c, dti, node, prop,
+				  "property size (%d) too small for cell size %d",
+				  prop->val.len, cellsize);
 		}
 	}
 }
@@ -1066,7 +1205,7 @@ WARNING_PROPERTY_PHANDLE_CELLS(phys, "phys", "#phy-cells");
 WARNING_PROPERTY_PHANDLE_CELLS(power_domains, "power-domains", "#power-domain-cells");
 WARNING_PROPERTY_PHANDLE_CELLS(pwms, "pwms", "#pwm-cells");
 WARNING_PROPERTY_PHANDLE_CELLS(resets, "resets", "#reset-cells");
-WARNING_PROPERTY_PHANDLE_CELLS(sound_dais, "sound-dais", "#sound-dai-cells");
+WARNING_PROPERTY_PHANDLE_CELLS(sound_dai, "sound-dai", "#sound-dai-cells");
 WARNING_PROPERTY_PHANDLE_CELLS(thermal_sensors, "thermal-sensors", "#thermal-sensor-cells");
 
 static bool prop_is_gpio(struct property *prop)
@@ -1132,8 +1271,8 @@ static void check_deprecated_gpio_property(struct check *c,
 		if (!streq(str, "gpio"))
 			continue;
 
-		FAIL(c, dti, "'[*-]gpio' is deprecated, use '[*-]gpios' instead for %s:%s",
-		     node->fullpath, prop->name);
+		FAIL_PROP(c, dti, node, prop,
+			  "'[*-]gpio' is deprecated, use '[*-]gpios' instead");
 	}
 
 }
@@ -1167,9 +1306,8 @@ static void check_interrupts_property(struct check *c,
 		return;
 
 	if (irq_prop->val.len % sizeof(cell_t))
-		FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s",
-		     irq_prop->name, irq_prop->val.len, sizeof(cell_t),
-		     node->fullpath);
+		FAIL_PROP(c, dti, node, irq_prop, "size (%d) is invalid, expected multiple of %zu",
+		     irq_prop->val.len, sizeof(cell_t));
 
 	while (parent && !prop) {
 		if (parent != node && node_is_interrupt_provider(parent)) {
@@ -1187,14 +1325,12 @@ static void check_interrupts_property(struct check *c,
 
 			irq_node = get_node_by_phandle(root, phandle);
 			if (!irq_node) {
-				FAIL(c, dti, "Bad interrupt-parent phandle for %s",
-				     node->fullpath);
+				FAIL_PROP(c, dti, parent, prop, "Bad phandle");
 				return;
 			}
 			if (!node_is_interrupt_provider(irq_node))
-				FAIL(c, dti,
-				     "Missing interrupt-controller or interrupt-map property in %s",
-				     irq_node->fullpath);
+				FAIL(c, dti, irq_node,
+				     "Missing interrupt-controller or interrupt-map property");
 
 			break;
 		}
@@ -1203,23 +1339,21 @@ static void check_interrupts_property(struct check *c,
 	}
 
 	if (!irq_node) {
-		FAIL(c, dti, "Missing interrupt-parent for %s", node->fullpath);
+		FAIL(c, dti, node, "Missing interrupt-parent");
 		return;
 	}
 
 	prop = get_property(irq_node, "#interrupt-cells");
 	if (!prop) {
-		FAIL(c, dti, "Missing #interrupt-cells in interrupt-parent %s",
-		     irq_node->fullpath);
+		FAIL(c, dti, irq_node, "Missing #interrupt-cells in interrupt-parent");
 		return;
 	}
 
 	irq_cells = propval_cell(prop);
 	if (irq_prop->val.len % (irq_cells * sizeof(cell_t))) {
-		FAIL(c, dti,
-		     "interrupts size is (%d), expected multiple of %d in %s",
-		     irq_prop->val.len, (int)(irq_cells * sizeof(cell_t)),
-		     node->fullpath);
+		FAIL_PROP(c, dti, node, prop,
+			  "size is (%d), expected multiple of %d",
+			  irq_prop->val.len, (int)(irq_cells * sizeof(cell_t)));
 	}
 }
 WARNING(interrupts_property, check_interrupts_property, &phandle_references);
@@ -1236,6 +1370,9 @@ static struct check *check_table[] = {
 
 	&address_cells_is_cell, &size_cells_is_cell, &interrupt_cells_is_cell,
 	&device_type_is_string, &model_is_string, &status_is_string,
+	&label_is_string,
+
+	&compatible_is_string_list, &names_is_string_list,
 
 	&property_name_chars_strict,
 	&node_name_chars_strict,
@@ -1253,7 +1390,9 @@ static struct check *check_table[] = {
 	&simple_bus_reg,
 
 	&avoid_default_addr_size,
+	&avoid_unnecessary_addr_size,
 	&obsolete_chosen_interrupt_controller,
+	&chosen_node_is_root, &chosen_node_bootargs, &chosen_node_stdout_path,
 
 	&clocks_property,
 	&cooling_device_property,
@@ -1269,13 +1408,15 @@ static struct check *check_table[] = {
 	&power_domains_property,
 	&pwms_property,
 	&resets_property,
-	&sound_dais_property,
+	&sound_dai_property,
 	&thermal_sensors_property,
 
 	&deprecated_gpio_property,
 	&gpios_property,
 	&interrupts_property,
 
+	&alias_paths,
+
 	&always_fail,
 };
 
diff --git a/scripts/dtc/dtc-parser.y b/scripts/dtc/dtc-parser.y
index affc81a8f9ab..44af170abfea 100644
--- a/scripts/dtc/dtc-parser.y
+++ b/scripts/dtc/dtc-parser.y
@@ -166,7 +166,17 @@ devicetree:
 		{
 			$$ = merge_nodes($1, $3);
 		}
-
+	| DT_REF nodedef
+		{
+			/*
+			 * We rely on the rule being always:
+			 *   versioninfo plugindecl memreserves devicetree
+			 * so $-1 is what we want (plugindecl)
+			 */
+			if (!($<flags>-1 & DTSF_PLUGIN))
+				ERROR(&@2, "Label or path %s not found", $1);
+			$$ = add_orphan_node(name_node(build_node(NULL, NULL), ""), $2, $1);
+		}
 	| devicetree DT_LABEL DT_REF nodedef
 		{
 			struct node *target = get_node_by_ref($1, $3);
@@ -209,11 +219,6 @@ devicetree:
 
 			$$ = $1;
 		}
-	| /* empty */
-		{
-			/* build empty node */
-			$$ = name_node(build_node(NULL, NULL), "");
-		}
 	;
 
 nodedef:
diff --git a/scripts/dtc/dtc.c b/scripts/dtc/dtc.c
index 5ed873c72ad1..c36994e6eac5 100644
--- a/scripts/dtc/dtc.c
+++ b/scripts/dtc/dtc.c
@@ -59,8 +59,6 @@ static void fill_fullpaths(struct node *tree, const char *prefix)
 }
 
 /* Usage related data. */
-#define FDT_VERSION(version)	_FDT_VERSION(version)
-#define _FDT_VERSION(version)	#version
 static const char usage_synopsis[] = "dtc [options] <input file>";
 static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:a:fb:i:H:sW:E:@Ahv";
 static struct option const usage_long_opts[] = {
@@ -98,7 +96,7 @@ static const char * const usage_opts_help[] = {
 	 "\t\tdts - device tree source text\n"
 	 "\t\tdtb - device tree blob\n"
 	 "\t\tasm - assembler source",
-	"\n\tBlob version to produce, defaults to "FDT_VERSION(DEFAULT_FDT_VERSION)" (for dtb and asm output)",
+	"\n\tBlob version to produce, defaults to "stringify(DEFAULT_FDT_VERSION)" (for dtb and asm output)",
 	"\n\tOutput dependency file",
 	"\n\tMake space for <number> reserve map entries (for dtb and asm output)",
 	"\n\tMake the blob at least <bytes> long (extra space)",
@@ -319,13 +317,14 @@ int main(int argc, char *argv[])
 		dti->boot_cpuid_phys = cmdline_boot_cpuid;
 
 	fill_fullpaths(dti->dt, "");
-	process_checks(force, dti);
 
 	/* on a plugin, generate by default */
 	if (dti->dtsflags & DTSF_PLUGIN) {
 		generate_fixups = 1;
 	}
 
+	process_checks(force, dti);
+
 	if (auto_label_aliases)
 		generate_label_tree(dti, "aliases", false);
 
diff --git a/scripts/dtc/dtc.h b/scripts/dtc/dtc.h
index 35cf926cc14a..3b18a42b866e 100644
--- a/scripts/dtc/dtc.h
+++ b/scripts/dtc/dtc.h
@@ -1,5 +1,5 @@
-#ifndef _DTC_H
-#define _DTC_H
+#ifndef DTC_H
+#define DTC_H
 
 /*
  * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
@@ -67,7 +67,8 @@ typedef uint32_t cell_t;
 
 
 #define streq(a, b)	(strcmp((a), (b)) == 0)
-#define strneq(a, b, n)	(strncmp((a), (b), (n)) == 0)
+#define strstarts(s, prefix)	(strncmp((s), (prefix), strlen(prefix)) == 0)
+#define strprefixeq(a, n, b)	(strlen(b) == (n) && (memcmp(a, b, n) == 0))
 
 #define ALIGN(x, a)	(((x) + (a) - 1) & ~((a) - 1))
 
@@ -203,7 +204,7 @@ struct node *build_node_delete(void);
 struct node *name_node(struct node *node, char *name);
 struct node *chain_node(struct node *first, struct node *list);
 struct node *merge_nodes(struct node *old_node, struct node *new_node);
-void add_orphan_node(struct node *old_node, struct node *new_node, char *ref);
+struct node *add_orphan_node(struct node *old_node, struct node *new_node, char *ref);
 
 void add_property(struct node *node, struct property *prop);
 void delete_property_by_name(struct node *node, char *name);
@@ -289,4 +290,4 @@ struct dt_info *dt_from_source(const char *f);
 
 struct dt_info *dt_from_fs(const char *dirname);
 
-#endif /* _DTC_H */
+#endif /* DTC_H */
diff --git a/scripts/dtc/flattree.c b/scripts/dtc/flattree.c
index fcf71541d8a7..8d268fb785db 100644
--- a/scripts/dtc/flattree.c
+++ b/scripts/dtc/flattree.c
@@ -731,7 +731,7 @@ static char *nodename_from_path(const char *ppath, const char *cpath)
 
 	plen = strlen(ppath);
 
-	if (!strneq(ppath, cpath, plen))
+	if (!strstarts(cpath, ppath))
 		die("Path \"%s\" is not valid as a child of \"%s\"\n",
 		    cpath, ppath);
 
diff --git a/scripts/dtc/libfdt/fdt.c b/scripts/dtc/libfdt/fdt.c
index 22286a1aaeaf..7855a1787763 100644
--- a/scripts/dtc/libfdt/fdt.c
+++ b/scripts/dtc/libfdt/fdt.c
@@ -88,7 +88,7 @@ const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len)
 		    || ((offset + len) > fdt_size_dt_struct(fdt)))
 			return NULL;
 
-	return _fdt_offset_ptr(fdt, offset);
+	return fdt_offset_ptr_(fdt, offset);
 }
 
 uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset)
@@ -123,6 +123,9 @@ uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset)
 		/* skip-name offset, length and value */
 		offset += sizeof(struct fdt_property) - FDT_TAGSIZE
 			+ fdt32_to_cpu(*lenp);
+		if (fdt_version(fdt) < 0x10 && fdt32_to_cpu(*lenp) >= 8 &&
+		    ((offset - fdt32_to_cpu(*lenp)) % 8) != 0)
+			offset += 4;
 		break;
 
 	case FDT_END:
@@ -141,7 +144,7 @@ uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset)
 	return tag;
 }
 
-int _fdt_check_node_offset(const void *fdt, int offset)
+int fdt_check_node_offset_(const void *fdt, int offset)
 {
 	if ((offset < 0) || (offset % FDT_TAGSIZE)
 	    || (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE))
@@ -150,7 +153,7 @@ int _fdt_check_node_offset(const void *fdt, int offset)
 	return offset;
 }
 
-int _fdt_check_prop_offset(const void *fdt, int offset)
+int fdt_check_prop_offset_(const void *fdt, int offset)
 {
 	if ((offset < 0) || (offset % FDT_TAGSIZE)
 	    || (fdt_next_tag(fdt, offset, &offset) != FDT_PROP))
@@ -165,7 +168,7 @@ int fdt_next_node(const void *fdt, int offset, int *depth)
 	uint32_t tag;
 
 	if (offset >= 0)
-		if ((nextoffset = _fdt_check_node_offset(fdt, offset)) < 0)
+		if ((nextoffset = fdt_check_node_offset_(fdt, offset)) < 0)
 			return nextoffset;
 
 	do {
@@ -227,7 +230,7 @@ int fdt_next_subnode(const void *fdt, int offset)
 	return offset;
 }
 
-const char *_fdt_find_string(const char *strtab, int tabsize, const char *s)
+const char *fdt_find_string_(const char *strtab, int tabsize, const char *s)
 {
 	int len = strlen(s) + 1;
 	const char *last = strtab + tabsize - len;
diff --git a/scripts/dtc/libfdt/fdt.h b/scripts/dtc/libfdt/fdt.h
index 526aedb51556..74961f9026d1 100644
--- a/scripts/dtc/libfdt/fdt.h
+++ b/scripts/dtc/libfdt/fdt.h
@@ -1,5 +1,5 @@
-#ifndef _FDT_H
-#define _FDT_H
+#ifndef FDT_H
+#define FDT_H
 /*
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
@@ -108,4 +108,4 @@ struct fdt_property {
 #define FDT_V16_SIZE	FDT_V3_SIZE
 #define FDT_V17_SIZE	(FDT_V16_SIZE + sizeof(fdt32_t))
 
-#endif /* _FDT_H */
+#endif /* FDT_H */
diff --git a/scripts/dtc/libfdt/fdt_overlay.c b/scripts/dtc/libfdt/fdt_overlay.c
index bd81241e6658..bf75388ec9a2 100644
--- a/scripts/dtc/libfdt/fdt_overlay.c
+++ b/scripts/dtc/libfdt/fdt_overlay.c
@@ -1,3 +1,54 @@
+/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2016 Free Electrons
+ * Copyright (C) 2016 NextThing Co.
+ *
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license,@your option.
+ *
+ *  a) This library is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This library is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
 #include "libfdt_env.h"
 
 #include <fdt.h>
diff --git a/scripts/dtc/libfdt/fdt_ro.c b/scripts/dtc/libfdt/fdt_ro.c
index 08de2cce674d..dfb3236da388 100644
--- a/scripts/dtc/libfdt/fdt_ro.c
+++ b/scripts/dtc/libfdt/fdt_ro.c
@@ -55,12 +55,13 @@
 
 #include "libfdt_internal.h"
 
-static int _fdt_nodename_eq(const void *fdt, int offset,
+static int fdt_nodename_eq_(const void *fdt, int offset,
 			    const char *s, int len)
 {
-	const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1);
+	int olen;
+	const char *p = fdt_get_name(fdt, offset, &olen);
 
-	if (!p)
+	if (!p || olen < len)
 		/* short match */
 		return 0;
 
@@ -80,7 +81,7 @@ const char *fdt_string(const void *fdt, int stroffset)
 	return (const char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
 }
 
-static int _fdt_string_eq(const void *fdt, int stroffset,
+static int fdt_string_eq_(const void *fdt, int stroffset,
 			  const char *s, int len)
 {
 	const char *p = fdt_string(fdt, stroffset);
@@ -117,8 +118,8 @@ uint32_t fdt_get_max_phandle(const void *fdt)
 int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size)
 {
 	FDT_CHECK_HEADER(fdt);
-	*address = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->address);
-	*size = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->size);
+	*address = fdt64_to_cpu(fdt_mem_rsv_(fdt, n)->address);
+	*size = fdt64_to_cpu(fdt_mem_rsv_(fdt, n)->size);
 	return 0;
 }
 
@@ -126,12 +127,12 @@ int fdt_num_mem_rsv(const void *fdt)
 {
 	int i = 0;
 
-	while (fdt64_to_cpu(_fdt_mem_rsv(fdt, i)->size) != 0)
+	while (fdt64_to_cpu(fdt_mem_rsv_(fdt, i)->size) != 0)
 		i++;
 	return i;
 }
 
-static int _nextprop(const void *fdt, int offset)
+static int nextprop_(const void *fdt, int offset)
 {
 	uint32_t tag;
 	int nextoffset;
@@ -166,7 +167,7 @@ int fdt_subnode_offset_namelen(const void *fdt, int offset,
 	     (offset >= 0) && (depth >= 0);
 	     offset = fdt_next_node(fdt, offset, &depth))
 		if ((depth == 1)
-		    && _fdt_nodename_eq(fdt, offset, name, namelen))
+		    && fdt_nodename_eq_(fdt, offset, name, namelen))
 			return offset;
 
 	if (depth < 0)
@@ -232,17 +233,35 @@ int fdt_path_offset(const void *fdt, const char *path)
 
 const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
 {
-	const struct fdt_node_header *nh = _fdt_offset_ptr(fdt, nodeoffset);
+	const struct fdt_node_header *nh = fdt_offset_ptr_(fdt, nodeoffset);
+	const char *nameptr;
 	int err;
 
 	if (((err = fdt_check_header(fdt)) != 0)
-	    || ((err = _fdt_check_node_offset(fdt, nodeoffset)) < 0))
+	    || ((err = fdt_check_node_offset_(fdt, nodeoffset)) < 0))
 			goto fail;
 
+	nameptr = nh->name;
+
+	if (fdt_version(fdt) < 0x10) {
+		/*
+		 * For old FDT versions, match the naming conventions of V16:
+		 * give only the leaf name (after all /). The actual tree
+		 * contents are loosely checked.
+		 */
+		const char *leaf;
+		leaf = strrchr(nameptr, '/');
+		if (leaf == NULL) {
+			err = -FDT_ERR_BADSTRUCTURE;
+			goto fail;
+		}
+		nameptr = leaf+1;
+	}
+
 	if (len)
-		*len = strlen(nh->name);
+		*len = strlen(nameptr);
 
-	return nh->name;
+	return nameptr;
 
  fail:
 	if (len)
@@ -254,34 +273,34 @@ int fdt_first_property_offset(const void *fdt, int nodeoffset)
 {
 	int offset;
 
-	if ((offset = _fdt_check_node_offset(fdt, nodeoffset)) < 0)
+	if ((offset = fdt_check_node_offset_(fdt, nodeoffset)) < 0)
 		return offset;
 
-	return _nextprop(fdt, offset);
+	return nextprop_(fdt, offset);
 }
 
 int fdt_next_property_offset(const void *fdt, int offset)
 {
-	if ((offset = _fdt_check_prop_offset(fdt, offset)) < 0)
+	if ((offset = fdt_check_prop_offset_(fdt, offset)) < 0)
 		return offset;
 
-	return _nextprop(fdt, offset);
+	return nextprop_(fdt, offset);
 }
 
-const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
-						      int offset,
-						      int *lenp)
+static const struct fdt_property *fdt_get_property_by_offset_(const void *fdt,
+						              int offset,
+						              int *lenp)
 {
 	int err;
 	const struct fdt_property *prop;
 
-	if ((err = _fdt_check_prop_offset(fdt, offset)) < 0) {
+	if ((err = fdt_check_prop_offset_(fdt, offset)) < 0) {
 		if (lenp)
 			*lenp = err;
 		return NULL;
 	}
 
-	prop = _fdt_offset_ptr(fdt, offset);
+	prop = fdt_offset_ptr_(fdt, offset);
 
 	if (lenp)
 		*lenp = fdt32_to_cpu(prop->len);
@@ -289,23 +308,44 @@ const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
 	return prop;
 }
 
-const struct fdt_property *fdt_get_property_namelen(const void *fdt,
-						    int offset,
-						    const char *name,
-						    int namelen, int *lenp)
+const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
+						      int offset,
+						      int *lenp)
+{
+	/* Prior to version 16, properties may need realignment
+	 * and this API does not work. fdt_getprop_*() will, however. */
+
+	if (fdt_version(fdt) < 0x10) {
+		if (lenp)
+			*lenp = -FDT_ERR_BADVERSION;
+		return NULL;
+	}
+
+	return fdt_get_property_by_offset_(fdt, offset, lenp);
+}
+
+static const struct fdt_property *fdt_get_property_namelen_(const void *fdt,
+						            int offset,
+						            const char *name,
+						            int namelen,
+							    int *lenp,
+							    int *poffset)
 {
 	for (offset = fdt_first_property_offset(fdt, offset);
 	     (offset >= 0);
 	     (offset = fdt_next_property_offset(fdt, offset))) {
 		const struct fdt_property *prop;
 
-		if (!(prop = fdt_get_property_by_offset(fdt, offset, lenp))) {
+		if (!(prop = fdt_get_property_by_offset_(fdt, offset, lenp))) {
 			offset = -FDT_ERR_INTERNAL;
 			break;
 		}
-		if (_fdt_string_eq(fdt, fdt32_to_cpu(prop->nameoff),
-				   name, namelen))
+		if (fdt_string_eq_(fdt, fdt32_to_cpu(prop->nameoff),
+				   name, namelen)) {
+			if (poffset)
+				*poffset = offset;
 			return prop;
+		}
 	}
 
 	if (lenp)
@@ -313,6 +353,25 @@ const struct fdt_property *fdt_get_property_namelen(const void *fdt,
 	return NULL;
 }
 
+
+const struct fdt_property *fdt_get_property_namelen(const void *fdt,
+						    int offset,
+						    const char *name,
+						    int namelen, int *lenp)
+{
+	/* Prior to version 16, properties may need realignment
+	 * and this API does not work. fdt_getprop_*() will, however. */
+	if (fdt_version(fdt) < 0x10) {
+		if (lenp)
+			*lenp = -FDT_ERR_BADVERSION;
+		return NULL;
+	}
+
+	return fdt_get_property_namelen_(fdt, offset, name, namelen, lenp,
+					 NULL);
+}
+
+
 const struct fdt_property *fdt_get_property(const void *fdt,
 					    int nodeoffset,
 					    const char *name, int *lenp)
@@ -324,12 +383,18 @@ const struct fdt_property *fdt_get_property(const void *fdt,
 const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
 				const char *name, int namelen, int *lenp)
 {
+	int poffset;
 	const struct fdt_property *prop;
 
-	prop = fdt_get_property_namelen(fdt, nodeoffset, name, namelen, lenp);
+	prop = fdt_get_property_namelen_(fdt, nodeoffset, name, namelen, lenp,
+					 &poffset);
 	if (!prop)
 		return NULL;
 
+	/* Handle realignment */
+	if (fdt_version(fdt) < 0x10 && (poffset + sizeof(*prop)) % 8 &&
+	    fdt32_to_cpu(prop->len) >= 8)
+		return prop->data + 4;
 	return prop->data;
 }
 
@@ -338,11 +403,16 @@ const void *fdt_getprop_by_offset(const void *fdt, int offset,
 {
 	const struct fdt_property *prop;
 
-	prop = fdt_get_property_by_offset(fdt, offset, lenp);
+	prop = fdt_get_property_by_offset_(fdt, offset, lenp);
 	if (!prop)
 		return NULL;
 	if (namep)
 		*namep = fdt_string(fdt, fdt32_to_cpu(prop->nameoff));
+
+	/* Handle realignment */
+	if (fdt_version(fdt) < 0x10 && (offset + sizeof(*prop)) % 8 &&
+	    fdt32_to_cpu(prop->len) >= 8)
+		return prop->data + 4;
 	return prop->data;
 }
 
diff --git a/scripts/dtc/libfdt/fdt_rw.c b/scripts/dtc/libfdt/fdt_rw.c
index 5c3a2bb0bc6b..9b829051e444 100644
--- a/scripts/dtc/libfdt/fdt_rw.c
+++ b/scripts/dtc/libfdt/fdt_rw.c
@@ -55,8 +55,8 @@
 
 #include "libfdt_internal.h"
 
-static int _fdt_blocks_misordered(const void *fdt,
-			      int mem_rsv_size, int struct_size)
+static int fdt_blocks_misordered_(const void *fdt,
+				  int mem_rsv_size, int struct_size)
 {
 	return (fdt_off_mem_rsvmap(fdt) < FDT_ALIGN(sizeof(struct fdt_header), 8))
 		|| (fdt_off_dt_struct(fdt) <
@@ -67,13 +67,13 @@ static int _fdt_blocks_misordered(const void *fdt,
 		    (fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt)));
 }
 
-static int _fdt_rw_check_header(void *fdt)
+static int fdt_rw_check_header_(void *fdt)
 {
 	FDT_CHECK_HEADER(fdt);
 
 	if (fdt_version(fdt) < 17)
 		return -FDT_ERR_BADVERSION;
-	if (_fdt_blocks_misordered(fdt, sizeof(struct fdt_reserve_entry),
+	if (fdt_blocks_misordered_(fdt, sizeof(struct fdt_reserve_entry),
 				   fdt_size_dt_struct(fdt)))
 		return -FDT_ERR_BADLAYOUT;
 	if (fdt_version(fdt) > 17)
@@ -84,20 +84,20 @@ static int _fdt_rw_check_header(void *fdt)
 
 #define FDT_RW_CHECK_HEADER(fdt) \
 	{ \
-		int __err; \
-		if ((__err = _fdt_rw_check_header(fdt)) != 0) \
-			return __err; \
+		int err_; \
+		if ((err_ = fdt_rw_check_header_(fdt)) != 0) \
+			return err_; \
 	}
 
-static inline int _fdt_data_size(void *fdt)
+static inline int fdt_data_size_(void *fdt)
 {
 	return fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
 }
 
-static int _fdt_splice(void *fdt, void *splicepoint, int oldlen, int newlen)
+static int fdt_splice_(void *fdt, void *splicepoint, int oldlen, int newlen)
 {
 	char *p = splicepoint;
-	char *end = (char *)fdt + _fdt_data_size(fdt);
+	char *end = (char *)fdt + fdt_data_size_(fdt);
 
 	if (((p + oldlen) < p) || ((p + oldlen) > end))
 		return -FDT_ERR_BADOFFSET;
@@ -109,12 +109,12 @@ static int _fdt_splice(void *fdt, void *splicepoint, int oldlen, int newlen)
 	return 0;
 }
 
-static int _fdt_splice_mem_rsv(void *fdt, struct fdt_reserve_entry *p,
+static int fdt_splice_mem_rsv_(void *fdt, struct fdt_reserve_entry *p,
 			       int oldn, int newn)
 {
 	int delta = (newn - oldn) * sizeof(*p);
 	int err;
-	err = _fdt_splice(fdt, p, oldn * sizeof(*p), newn * sizeof(*p));
+	err = fdt_splice_(fdt, p, oldn * sizeof(*p), newn * sizeof(*p));
 	if (err)
 		return err;
 	fdt_set_off_dt_struct(fdt, fdt_off_dt_struct(fdt) + delta);
@@ -122,13 +122,13 @@ static int _fdt_splice_mem_rsv(void *fdt, struct fdt_reserve_entry *p,
 	return 0;
 }
 
-static int _fdt_splice_struct(void *fdt, void *p,
+static int fdt_splice_struct_(void *fdt, void *p,
 			      int oldlen, int newlen)
 {
 	int delta = newlen - oldlen;
 	int err;
 
-	if ((err = _fdt_splice(fdt, p, oldlen, newlen)))
+	if ((err = fdt_splice_(fdt, p, oldlen, newlen)))
 		return err;
 
 	fdt_set_size_dt_struct(fdt, fdt_size_dt_struct(fdt) + delta);
@@ -136,20 +136,20 @@ static int _fdt_splice_struct(void *fdt, void *p,
 	return 0;
 }
 
-static int _fdt_splice_string(void *fdt, int newlen)
+static int fdt_splice_string_(void *fdt, int newlen)
 {
 	void *p = (char *)fdt
 		+ fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
 	int err;
 
-	if ((err = _fdt_splice(fdt, p, 0, newlen)))
+	if ((err = fdt_splice_(fdt, p, 0, newlen)))
 		return err;
 
 	fdt_set_size_dt_strings(fdt, fdt_size_dt_strings(fdt) + newlen);
 	return 0;
 }
 
-static int _fdt_find_add_string(void *fdt, const char *s)
+static int fdt_find_add_string_(void *fdt, const char *s)
 {
 	char *strtab = (char *)fdt + fdt_off_dt_strings(fdt);
 	const char *p;
@@ -157,13 +157,13 @@ static int _fdt_find_add_string(void *fdt, const char *s)
 	int len = strlen(s) + 1;
 	int err;
 
-	p = _fdt_find_string(strtab, fdt_size_dt_strings(fdt), s);
+	p = fdt_find_string_(strtab, fdt_size_dt_strings(fdt), s);
 	if (p)
 		/* found it */
 		return (p - strtab);
 
 	new = strtab + fdt_size_dt_strings(fdt);
-	err = _fdt_splice_string(fdt, len);
+	err = fdt_splice_string_(fdt, len);
 	if (err)
 		return err;
 
@@ -178,8 +178,8 @@ int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size)
 
 	FDT_RW_CHECK_HEADER(fdt);
 
-	re = _fdt_mem_rsv_w(fdt, fdt_num_mem_rsv(fdt));
-	err = _fdt_splice_mem_rsv(fdt, re, 0, 1);
+	re = fdt_mem_rsv_w_(fdt, fdt_num_mem_rsv(fdt));
+	err = fdt_splice_mem_rsv_(fdt, re, 0, 1);
 	if (err)
 		return err;
 
@@ -190,17 +190,17 @@ int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size)
 
 int fdt_del_mem_rsv(void *fdt, int n)
 {
-	struct fdt_reserve_entry *re = _fdt_mem_rsv_w(fdt, n);
+	struct fdt_reserve_entry *re = fdt_mem_rsv_w_(fdt, n);
 
 	FDT_RW_CHECK_HEADER(fdt);
 
 	if (n >= fdt_num_mem_rsv(fdt))
 		return -FDT_ERR_NOTFOUND;
 
-	return _fdt_splice_mem_rsv(fdt, re, 1, 0);
+	return fdt_splice_mem_rsv_(fdt, re, 1, 0);
 }
 
-static int _fdt_resize_property(void *fdt, int nodeoffset, const char *name,
+static int fdt_resize_property_(void *fdt, int nodeoffset, const char *name,
 				int len, struct fdt_property **prop)
 {
 	int oldlen;
@@ -210,7 +210,7 @@ static int _fdt_resize_property(void *fdt, int nodeoffset, const char *name,
 	if (!*prop)
 		return oldlen;
 
-	if ((err = _fdt_splice_struct(fdt, (*prop)->data, FDT_TAGALIGN(oldlen),
+	if ((err = fdt_splice_struct_(fdt, (*prop)->data, FDT_TAGALIGN(oldlen),
 				      FDT_TAGALIGN(len))))
 		return err;
 
@@ -218,7 +218,7 @@ static int _fdt_resize_property(void *fdt, int nodeoffset, const char *name,
 	return 0;
 }
 
-static int _fdt_add_property(void *fdt, int nodeoffset, const char *name,
+static int fdt_add_property_(void *fdt, int nodeoffset, const char *name,
 			     int len, struct fdt_property **prop)
 {
 	int proplen;
@@ -226,17 +226,17 @@ static int _fdt_add_property(void *fdt, int nodeoffset, const char *name,
 	int namestroff;
 	int err;
 
-	if ((nextoffset = _fdt_check_node_offset(fdt, nodeoffset)) < 0)
+	if ((nextoffset = fdt_check_node_offset_(fdt, nodeoffset)) < 0)
 		return nextoffset;
 
-	namestroff = _fdt_find_add_string(fdt, name);
+	namestroff = fdt_find_add_string_(fdt, name);
 	if (namestroff < 0)
 		return namestroff;
 
-	*prop = _fdt_offset_ptr_w(fdt, nextoffset);
+	*prop = fdt_offset_ptr_w_(fdt, nextoffset);
 	proplen = sizeof(**prop) + FDT_TAGALIGN(len);
 
-	err = _fdt_splice_struct(fdt, *prop, 0, proplen);
+	err = fdt_splice_struct_(fdt, *prop, 0, proplen);
 	if (err)
 		return err;
 
@@ -260,7 +260,7 @@ int fdt_set_name(void *fdt, int nodeoffset, const char *name)
 
 	newlen = strlen(name);
 
-	err = _fdt_splice_struct(fdt, namep, FDT_TAGALIGN(oldlen+1),
+	err = fdt_splice_struct_(fdt, namep, FDT_TAGALIGN(oldlen+1),
 				 FDT_TAGALIGN(newlen+1));
 	if (err)
 		return err;
@@ -277,9 +277,9 @@ int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name,
 
 	FDT_RW_CHECK_HEADER(fdt);
 
-	err = _fdt_resize_property(fdt, nodeoffset, name, len, &prop);
+	err = fdt_resize_property_(fdt, nodeoffset, name, len, &prop);
 	if (err == -FDT_ERR_NOTFOUND)
-		err = _fdt_add_property(fdt, nodeoffset, name, len, &prop);
+		err = fdt_add_property_(fdt, nodeoffset, name, len, &prop);
 	if (err)
 		return err;
 
@@ -313,7 +313,7 @@ int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
 	prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
 	if (prop) {
 		newlen = len + oldlen;
-		err = _fdt_splice_struct(fdt, prop->data,
+		err = fdt_splice_struct_(fdt, prop->data,
 					 FDT_TAGALIGN(oldlen),
 					 FDT_TAGALIGN(newlen));
 		if (err)
@@ -321,7 +321,7 @@ int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
 		prop->len = cpu_to_fdt32(newlen);
 		memcpy(prop->data + oldlen, val, len);
 	} else {
-		err = _fdt_add_property(fdt, nodeoffset, name, len, &prop);
+		err = fdt_add_property_(fdt, nodeoffset, name, len, &prop);
 		if (err)
 			return err;
 		memcpy(prop->data, val, len);
@@ -341,7 +341,7 @@ int fdt_delprop(void *fdt, int nodeoffset, const char *name)
 		return len;
 
 	proplen = sizeof(*prop) + FDT_TAGALIGN(len);
-	return _fdt_splice_struct(fdt, prop, proplen, 0);
+	return fdt_splice_struct_(fdt, prop, proplen, 0);
 }
 
 int fdt_add_subnode_namelen(void *fdt, int parentoffset,
@@ -369,10 +369,10 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,
 		tag = fdt_next_tag(fdt, offset, &nextoffset);
 	} while ((tag == FDT_PROP) || (tag == FDT_NOP));
 
-	nh = _fdt_offset_ptr_w(fdt, offset);
+	nh = fdt_offset_ptr_w_(fdt, offset);
 	nodelen = sizeof(*nh) + FDT_TAGALIGN(namelen+1) + FDT_TAGSIZE;
 
-	err = _fdt_splice_struct(fdt, nh, 0, nodelen);
+	err = fdt_splice_struct_(fdt, nh, 0, nodelen);
 	if (err)
 		return err;
 
@@ -396,15 +396,15 @@ int fdt_del_node(void *fdt, int nodeoffset)
 
 	FDT_RW_CHECK_HEADER(fdt);
 
-	endoffset = _fdt_node_end_offset(fdt, nodeoffset);
+	endoffset = fdt_node_end_offset_(fdt, nodeoffset);
 	if (endoffset < 0)
 		return endoffset;
 
-	return _fdt_splice_struct(fdt, _fdt_offset_ptr_w(fdt, nodeoffset),
+	return fdt_splice_struct_(fdt, fdt_offset_ptr_w_(fdt, nodeoffset),
 				  endoffset - nodeoffset, 0);
 }
 
-static void _fdt_packblocks(const char *old, char *new,
+static void fdt_packblocks_(const char *old, char *new,
 			    int mem_rsv_size, int struct_size)
 {
 	int mem_rsv_off, struct_off, strings_off;
@@ -450,7 +450,7 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)
 			return struct_size;
 	}
 
-	if (!_fdt_blocks_misordered(fdt, mem_rsv_size, struct_size)) {
+	if (!fdt_blocks_misordered_(fdt, mem_rsv_size, struct_size)) {
 		/* no further work necessary */
 		err = fdt_move(fdt, buf, bufsize);
 		if (err)
@@ -478,7 +478,7 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)
 			return -FDT_ERR_NOSPACE;
 	}
 
-	_fdt_packblocks(fdt, tmp, mem_rsv_size, struct_size);
+	fdt_packblocks_(fdt, tmp, mem_rsv_size, struct_size);
 	memmove(buf, tmp, newsize);
 
 	fdt_set_magic(buf, FDT_MAGIC);
@@ -498,8 +498,8 @@ int fdt_pack(void *fdt)
 
 	mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
 		* sizeof(struct fdt_reserve_entry);
-	_fdt_packblocks(fdt, fdt, mem_rsv_size, fdt_size_dt_struct(fdt));
-	fdt_set_totalsize(fdt, _fdt_data_size(fdt));
+	fdt_packblocks_(fdt, fdt, mem_rsv_size, fdt_size_dt_struct(fdt));
+	fdt_set_totalsize(fdt, fdt_data_size_(fdt));
 
 	return 0;
 }
diff --git a/scripts/dtc/libfdt/fdt_sw.c b/scripts/dtc/libfdt/fdt_sw.c
index 2bd15e7aef87..6d33cc29d022 100644
--- a/scripts/dtc/libfdt/fdt_sw.c
+++ b/scripts/dtc/libfdt/fdt_sw.c
@@ -55,7 +55,7 @@
 
 #include "libfdt_internal.h"
 
-static int _fdt_sw_check_header(void *fdt)
+static int fdt_sw_check_header_(void *fdt)
 {
 	if (fdt_magic(fdt) != FDT_SW_MAGIC)
 		return -FDT_ERR_BADMAGIC;
@@ -66,11 +66,11 @@ static int _fdt_sw_check_header(void *fdt)
 #define FDT_SW_CHECK_HEADER(fdt) \
 	{ \
 		int err; \
-		if ((err = _fdt_sw_check_header(fdt)) != 0) \
+		if ((err = fdt_sw_check_header_(fdt)) != 0) \
 			return err; \
 	}
 
-static void *_fdt_grab_space(void *fdt, size_t len)
+static void *fdt_grab_space_(void *fdt, size_t len)
 {
 	int offset = fdt_size_dt_struct(fdt);
 	int spaceleft;
@@ -82,7 +82,7 @@ static void *_fdt_grab_space(void *fdt, size_t len)
 		return NULL;
 
 	fdt_set_size_dt_struct(fdt, offset + len);
-	return _fdt_offset_ptr_w(fdt, offset);
+	return fdt_offset_ptr_w_(fdt, offset);
 }
 
 int fdt_create(void *buf, int bufsize)
@@ -174,7 +174,7 @@ int fdt_begin_node(void *fdt, const char *name)
 
 	FDT_SW_CHECK_HEADER(fdt);
 
-	nh = _fdt_grab_space(fdt, sizeof(*nh) + FDT_TAGALIGN(namelen));
+	nh = fdt_grab_space_(fdt, sizeof(*nh) + FDT_TAGALIGN(namelen));
 	if (! nh)
 		return -FDT_ERR_NOSPACE;
 
@@ -189,7 +189,7 @@ int fdt_end_node(void *fdt)
 
 	FDT_SW_CHECK_HEADER(fdt);
 
-	en = _fdt_grab_space(fdt, FDT_TAGSIZE);
+	en = fdt_grab_space_(fdt, FDT_TAGSIZE);
 	if (! en)
 		return -FDT_ERR_NOSPACE;
 
@@ -197,7 +197,7 @@ int fdt_end_node(void *fdt)
 	return 0;
 }
 
-static int _fdt_find_add_string(void *fdt, const char *s)
+static int fdt_find_add_string_(void *fdt, const char *s)
 {
 	char *strtab = (char *)fdt + fdt_totalsize(fdt);
 	const char *p;
@@ -205,7 +205,7 @@ static int _fdt_find_add_string(void *fdt, const char *s)
 	int len = strlen(s) + 1;
 	int struct_top, offset;
 
-	p = _fdt_find_string(strtab - strtabsize, strtabsize, s);
+	p = fdt_find_string_(strtab - strtabsize, strtabsize, s);
 	if (p)
 		return p - strtab;
 
@@ -227,11 +227,11 @@ int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp)
 
 	FDT_SW_CHECK_HEADER(fdt);
 
-	nameoff = _fdt_find_add_string(fdt, name);
+	nameoff = fdt_find_add_string_(fdt, name);
 	if (nameoff == 0)
 		return -FDT_ERR_NOSPACE;
 
-	prop = _fdt_grab_space(fdt, sizeof(*prop) + FDT_TAGALIGN(len));
+	prop = fdt_grab_space_(fdt, sizeof(*prop) + FDT_TAGALIGN(len));
 	if (! prop)
 		return -FDT_ERR_NOSPACE;
 
@@ -265,7 +265,7 @@ int fdt_finish(void *fdt)
 	FDT_SW_CHECK_HEADER(fdt);
 
 	/* Add terminator */
-	end = _fdt_grab_space(fdt, sizeof(*end));
+	end = fdt_grab_space_(fdt, sizeof(*end));
 	if (! end)
 		return -FDT_ERR_NOSPACE;
 	*end = cpu_to_fdt32(FDT_END);
@@ -281,7 +281,7 @@ int fdt_finish(void *fdt)
 	while ((tag = fdt_next_tag(fdt, offset, &nextoffset)) != FDT_END) {
 		if (tag == FDT_PROP) {
 			struct fdt_property *prop =
-				_fdt_offset_ptr_w(fdt, offset);
+				fdt_offset_ptr_w_(fdt, offset);
 			int nameoff;
 
 			nameoff = fdt32_to_cpu(prop->nameoff);
diff --git a/scripts/dtc/libfdt/fdt_wip.c b/scripts/dtc/libfdt/fdt_wip.c
index 5e859198622b..534c1cbbb2f3 100644
--- a/scripts/dtc/libfdt/fdt_wip.c
+++ b/scripts/dtc/libfdt/fdt_wip.c
@@ -93,7 +93,7 @@ int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
 						   val, len);
 }
 
-static void _fdt_nop_region(void *start, int len)
+static void fdt_nop_region_(void *start, int len)
 {
 	fdt32_t *p;
 
@@ -110,12 +110,12 @@ int fdt_nop_property(void *fdt, int nodeoffset, const char *name)
 	if (!prop)
 		return len;
 
-	_fdt_nop_region(prop, len + sizeof(*prop));
+	fdt_nop_region_(prop, len + sizeof(*prop));
 
 	return 0;
 }
 
-int _fdt_node_end_offset(void *fdt, int offset)
+int fdt_node_end_offset_(void *fdt, int offset)
 {
 	int depth = 0;
 
@@ -129,11 +129,11 @@ int fdt_nop_node(void *fdt, int nodeoffset)
 {
 	int endoffset;
 
-	endoffset = _fdt_node_end_offset(fdt, nodeoffset);
+	endoffset = fdt_node_end_offset_(fdt, nodeoffset);
 	if (endoffset < 0)
 		return endoffset;
 
-	_fdt_nop_region(fdt_offset_ptr_w(fdt, nodeoffset, 0),
+	fdt_nop_region_(fdt_offset_ptr_w(fdt, nodeoffset, 0),
 			endoffset - nodeoffset);
 	return 0;
 }
diff --git a/scripts/dtc/libfdt/libfdt.h b/scripts/dtc/libfdt/libfdt.h
index 7f83023ee109..1e27780e1185 100644
--- a/scripts/dtc/libfdt/libfdt.h
+++ b/scripts/dtc/libfdt/libfdt.h
@@ -1,5 +1,5 @@
-#ifndef _LIBFDT_H
-#define _LIBFDT_H
+#ifndef LIBFDT_H
+#define LIBFDT_H
 /*
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
@@ -54,7 +54,7 @@
 #include "libfdt_env.h"
 #include "fdt.h"
 
-#define FDT_FIRST_SUPPORTED_VERSION	0x10
+#define FDT_FIRST_SUPPORTED_VERSION	0x02
 #define FDT_LAST_SUPPORTED_VERSION	0x11
 
 /* Error codes: informative error codes */
@@ -225,23 +225,23 @@ int fdt_next_subnode(const void *fdt, int offset);
 #define fdt_size_dt_strings(fdt)	(fdt_get_header(fdt, size_dt_strings))
 #define fdt_size_dt_struct(fdt)		(fdt_get_header(fdt, size_dt_struct))
 
-#define __fdt_set_hdr(name) \
+#define fdt_set_hdr_(name) \
 	static inline void fdt_set_##name(void *fdt, uint32_t val) \
 	{ \
 		struct fdt_header *fdth = (struct fdt_header *)fdt; \
 		fdth->name = cpu_to_fdt32(val); \
 	}
-__fdt_set_hdr(magic);
-__fdt_set_hdr(totalsize);
-__fdt_set_hdr(off_dt_struct);
-__fdt_set_hdr(off_dt_strings);
-__fdt_set_hdr(off_mem_rsvmap);
-__fdt_set_hdr(version);
-__fdt_set_hdr(last_comp_version);
-__fdt_set_hdr(boot_cpuid_phys);
-__fdt_set_hdr(size_dt_strings);
-__fdt_set_hdr(size_dt_struct);
-#undef __fdt_set_hdr
+fdt_set_hdr_(magic);
+fdt_set_hdr_(totalsize);
+fdt_set_hdr_(off_dt_struct);
+fdt_set_hdr_(off_dt_strings);
+fdt_set_hdr_(off_mem_rsvmap);
+fdt_set_hdr_(version);
+fdt_set_hdr_(last_comp_version);
+fdt_set_hdr_(boot_cpuid_phys);
+fdt_set_hdr_(size_dt_strings);
+fdt_set_hdr_(size_dt_struct);
+#undef fdt_set_hdr_
 
 /**
  * fdt_check_header - sanity check a device tree or possible device tree
@@ -527,6 +527,9 @@ int fdt_next_property_offset(const void *fdt, int offset);
  * offset.  If lenp is non-NULL, the length of the property value is
  * also returned, in the integer pointed to by lenp.
  *
+ * Note that this code only works on device tree versions >= 16. fdt_getprop()
+ * works on all versions.
+ *
  * returns:
  *	pointer to the structure representing the property
  *		if lenp is non-NULL, *lenp contains the length of the property
@@ -1449,7 +1452,7 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name,
 		const void *val, int len);
 
 /**
- * fdt_setprop _placeholder - allocate space for a property
+ * fdt_setprop_placeholder - allocate space for a property
  * @fdt: pointer to the device tree blob
  * @nodeoffset: offset of the node whose property to change
  * @name: name of the property to change
@@ -1896,4 +1899,4 @@ int fdt_overlay_apply(void *fdt, void *fdto);
 
 const char *fdt_strerror(int errval);
 
-#endif /* _LIBFDT_H */
+#endif /* LIBFDT_H */
diff --git a/scripts/dtc/libfdt/libfdt_env.h b/scripts/dtc/libfdt/libfdt_env.h
index 952056cddf09..bd2474628775 100644
--- a/scripts/dtc/libfdt/libfdt_env.h
+++ b/scripts/dtc/libfdt/libfdt_env.h
@@ -1,5 +1,5 @@
-#ifndef _LIBFDT_ENV_H
-#define _LIBFDT_ENV_H
+#ifndef LIBFDT_ENV_H
+#define LIBFDT_ENV_H
 /*
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
@@ -109,4 +109,31 @@ static inline fdt64_t cpu_to_fdt64(uint64_t x)
 #undef CPU_TO_FDT16
 #undef EXTRACT_BYTE
 
-#endif /* _LIBFDT_ENV_H */
+#ifdef __APPLE__
+#include <AvailabilityMacros.h>
+
+/* strnlen() is not available on Mac OS < 10.7 */
+# if !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < \
+                                         MAC_OS_X_VERSION_10_7)
+
+#define strnlen fdt_strnlen
+
+/*
+ * fdt_strnlen: returns the length of a string or max_count - which ever is
+ * smallest.
+ * Input 1 string: the string whose size is to be determined
+ * Input 2 max_count: the maximum value returned by this function
+ * Output: length of the string or max_count (the smallest of the two)
+ */
+static inline size_t fdt_strnlen(const char *string, size_t max_count)
+{
+    const char *p = memchr(string, 0, max_count);
+    return p ? p - string : max_count;
+}
+
+#endif /* !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED <
+          MAC_OS_X_VERSION_10_7) */
+
+#endif /* __APPLE__ */
+
+#endif /* LIBFDT_ENV_H */
diff --git a/scripts/dtc/libfdt/libfdt_internal.h b/scripts/dtc/libfdt/libfdt_internal.h
index 02cfa6fb612d..7681e192295b 100644
--- a/scripts/dtc/libfdt/libfdt_internal.h
+++ b/scripts/dtc/libfdt/libfdt_internal.h
@@ -1,5 +1,5 @@
-#ifndef _LIBFDT_INTERNAL_H
-#define _LIBFDT_INTERNAL_H
+#ifndef LIBFDT_INTERNAL_H
+#define LIBFDT_INTERNAL_H
 /*
  * libfdt - Flat Device Tree manipulation
  * Copyright (C) 2006 David Gibson, IBM Corporation.
@@ -57,27 +57,27 @@
 
 #define FDT_CHECK_HEADER(fdt) \
 	{ \
-		int __err; \
-		if ((__err = fdt_check_header(fdt)) != 0) \
-			return __err; \
+		int err_; \
+		if ((err_ = fdt_check_header(fdt)) != 0) \
+			return err_; \
 	}
 
-int _fdt_check_node_offset(const void *fdt, int offset);
-int _fdt_check_prop_offset(const void *fdt, int offset);
-const char *_fdt_find_string(const char *strtab, int tabsize, const char *s);
-int _fdt_node_end_offset(void *fdt, int nodeoffset);
+int fdt_check_node_offset_(const void *fdt, int offset);
+int fdt_check_prop_offset_(const void *fdt, int offset);
+const char *fdt_find_string_(const char *strtab, int tabsize, const char *s);
+int fdt_node_end_offset_(void *fdt, int nodeoffset);
 
-static inline const void *_fdt_offset_ptr(const void *fdt, int offset)
+static inline const void *fdt_offset_ptr_(const void *fdt, int offset)
 {
 	return (const char *)fdt + fdt_off_dt_struct(fdt) + offset;
 }
 
-static inline void *_fdt_offset_ptr_w(void *fdt, int offset)
+static inline void *fdt_offset_ptr_w_(void *fdt, int offset)
 {
-	return (void *)(uintptr_t)_fdt_offset_ptr(fdt, offset);
+	return (void *)(uintptr_t)fdt_offset_ptr_(fdt, offset);
 }
 
-static inline const struct fdt_reserve_entry *_fdt_mem_rsv(const void *fdt, int n)
+static inline const struct fdt_reserve_entry *fdt_mem_rsv_(const void *fdt, int n)
 {
 	const struct fdt_reserve_entry *rsv_table =
 		(const struct fdt_reserve_entry *)
@@ -85,11 +85,11 @@ static inline const struct fdt_reserve_entry *_fdt_mem_rsv(const void *fdt, int
 
 	return rsv_table + n;
 }
-static inline struct fdt_reserve_entry *_fdt_mem_rsv_w(void *fdt, int n)
+static inline struct fdt_reserve_entry *fdt_mem_rsv_w_(void *fdt, int n)
 {
-	return (void *)(uintptr_t)_fdt_mem_rsv(fdt, n);
+	return (void *)(uintptr_t)fdt_mem_rsv_(fdt, n);
 }
 
 #define FDT_SW_MAGIC		(~FDT_MAGIC)
 
-#endif /* _LIBFDT_INTERNAL_H */
+#endif /* LIBFDT_INTERNAL_H */
diff --git a/scripts/dtc/livetree.c b/scripts/dtc/livetree.c
index 6846ad2fd6d2..57b7db2ed153 100644
--- a/scripts/dtc/livetree.c
+++ b/scripts/dtc/livetree.c
@@ -216,7 +216,7 @@ struct node *merge_nodes(struct node *old_node, struct node *new_node)
 	return old_node;
 }
 
-void add_orphan_node(struct node *dt, struct node *new_node, char *ref)
+struct node * add_orphan_node(struct node *dt, struct node *new_node, char *ref)
 {
 	static unsigned int next_orphan_fragment = 0;
 	struct node *node;
@@ -236,6 +236,7 @@ void add_orphan_node(struct node *dt, struct node *new_node, char *ref)
 	name_node(node, name);
 
 	add_child(dt, node);
+	return dt;
 }
 
 struct node *chain_node(struct node *first, struct node *list)
@@ -507,7 +508,7 @@ struct node *get_node_by_path(struct node *tree, const char *path)
 
 	for_each_child(tree, child) {
 		if (p && (strlen(child->name) == p-path) &&
-				strneq(path, child->name, p-path))
+		    strprefixeq(path, p - path, child->name))
 			return get_node_by_path(child, p+1);
 		else if (!p && streq(path, child->name))
 			return child;
@@ -540,7 +541,10 @@ struct node *get_node_by_phandle(struct node *tree, cell_t phandle)
 {
 	struct node *child, *node;
 
-	assert((phandle != 0) && (phandle != -1));
+	if ((phandle == 0) || (phandle == -1)) {
+		assert(generate_fixups);
+		return NULL;
+	}
 
 	if (tree->phandle == phandle) {
 		if (tree->deleted)
diff --git a/scripts/dtc/srcpos.c b/scripts/dtc/srcpos.c
index 9d38459902f3..cb6ed0e3e5e4 100644
--- a/scripts/dtc/srcpos.c
+++ b/scripts/dtc/srcpos.c
@@ -209,8 +209,6 @@ struct srcpos srcpos_empty = {
 	.file = NULL,
 };
 
-#define TAB_SIZE      8
-
 void srcpos_update(struct srcpos *pos, const char *text, int len)
 {
 	int i;
@@ -224,9 +222,6 @@ void srcpos_update(struct srcpos *pos, const char *text, int len)
 		if (text[i] == '\n') {
 			current_srcfile->lineno++;
 			current_srcfile->colno = 1;
-		} else if (text[i] == '\t') {
-			current_srcfile->colno =
-				ALIGN(current_srcfile->colno, TAB_SIZE);
 		} else {
 			current_srcfile->colno++;
 		}
diff --git a/scripts/dtc/srcpos.h b/scripts/dtc/srcpos.h
index 7caca8257c6d..9ded12a3830a 100644
--- a/scripts/dtc/srcpos.h
+++ b/scripts/dtc/srcpos.h
@@ -17,8 +17,8 @@
  *                                                                   USA
  */
 
-#ifndef _SRCPOS_H_
-#define _SRCPOS_H_
+#ifndef SRCPOS_H
+#define SRCPOS_H
 
 #include <stdio.h>
 #include <stdbool.h>
@@ -114,4 +114,4 @@ extern void PRINTF(3, 4) srcpos_error(struct srcpos *pos, const char *prefix,
 
 extern void srcpos_set_line(char *f, int l);
 
-#endif /* _SRCPOS_H_ */
+#endif /* SRCPOS_H */
diff --git a/scripts/dtc/util.h b/scripts/dtc/util.h
index ad5f41199edb..66fba8ea709b 100644
--- a/scripts/dtc/util.h
+++ b/scripts/dtc/util.h
@@ -1,5 +1,5 @@
-#ifndef _UTIL_H
-#define _UTIL_H
+#ifndef UTIL_H
+#define UTIL_H
 
 #include <stdarg.h>
 #include <stdbool.h>
@@ -35,6 +35,9 @@
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
+#define stringify(s)	stringify_(s)
+#define stringify_(s)	#s
+
 static inline void NORETURN PRINTF(1, 2) die(const char *str, ...)
 {
 	va_list ap;
@@ -260,4 +263,4 @@ void NORETURN util_usage(const char *errmsg, const char *synopsis,
 	case 'V': util_version(); \
 	case '?': usage("unknown option");
 
-#endif /* _UTIL_H */
+#endif /* UTIL_H */
diff --git a/scripts/dtc/version_gen.h b/scripts/dtc/version_gen.h
index 6a4e84798966..ad87849e333b 100644
--- a/scripts/dtc/version_gen.h
+++ b/scripts/dtc/version_gen.h
@@ -1 +1 @@
-#define DTC_VERSION "DTC 1.4.5-gc1e55a55"
+#define DTC_VERSION "DTC 1.4.6-gaadd0b65"
diff --git a/tools/libfdt/fdt_rw.c b/tools/libfdt/fdt_rw.c
index e475084faeca..68fc7c8c887f 100644
--- a/tools/libfdt/fdt_rw.c
+++ b/tools/libfdt/fdt_rw.c
@@ -25,7 +25,7 @@ int fdt_remove_unused_strings(const void *old, void *new)
 		new_prop = (struct fdt_property *)(unsigned long)
 			fdt_get_property_by_offset(new, offset, NULL);
 		str = fdt_string(old, fdt32_to_cpu(old_prop->nameoff));
-		ret = _fdt_find_add_string(new, str);
+		ret = fdt_find_add_string_(new, str);
 		if (ret < 0)
 			return ret;
 		new_prop->nameoff = cpu_to_fdt32(ret);
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 5/6] scripts/dtc: Re-sync with Linux 4.17-rc4
  2018-05-12 17:13 [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4 Eugeniu Rosca
                   ` (2 preceding siblings ...)
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 4/6] scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987 Eugeniu Rosca
@ 2018-05-12 17:13 ` Eugeniu Rosca
  2018-05-15 14:06   ` Eugeniu Rosca
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 6/6] sandbox: dts: test: Fix wrong aliases property names Eugeniu Rosca
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-12 17:13 UTC (permalink / raw)
  To: u-boot

To achieve a DTC state (more or less) equivalent to Linux 4.17-rc4,
backport the DTC-specific part from below Linux commits:

b23d1a241f4eb4 ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
9a8dfb394c0467 ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
59889300274569 (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
e039139be8c251 ("scripts/dtc: generate lexer and parser during build instead of shipping")
b24413180f5600 ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license")

With this commit, the diff between Linux and U-boot common DTC files is:
$ git diff --stat --diff-filter=M v4.17-rc4 <this-commit> -- scripts/dtc
  scripts/dtc/.gitignore | 2 +-
  scripts/dtc/Makefile   | 3 +++

The delta is coming from U-boot commits:
* v2017.11 de163ecedb8a ("scripts: dtc: Add .gitignore")
* v2018.01 15b97f5c5e6d ("pylibfdt: move pylibfdt to scripts/dtc/pylibfdt and refactor makefile")

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
---

v1->v2:
* Newly pushed

 scripts/dtc/.gitignore               |    3 -
 scripts/dtc/Makefile                 |    4 +-
 scripts/dtc/dtc-lexer.lex.c_shipped  | 2259 -------------------------
 scripts/dtc/dtc-parser.tab.c_shipped | 2321 --------------------------
 scripts/dtc/dtc-parser.tab.h_shipped |  125 --
 scripts/dtc/update-dtc-source.sh     |    8 +-
 6 files changed, 3 insertions(+), 4717 deletions(-)
 delete mode 100644 scripts/dtc/dtc-lexer.lex.c_shipped
 delete mode 100644 scripts/dtc/dtc-parser.tab.c_shipped
 delete mode 100644 scripts/dtc/dtc-parser.tab.h_shipped

diff --git a/scripts/dtc/.gitignore b/scripts/dtc/.gitignore
index d807c081a250..689b9be0f935 100644
--- a/scripts/dtc/.gitignore
+++ b/scripts/dtc/.gitignore
@@ -1,4 +1 @@
 /dtc
-/dtc-lexer.lex.c
-/dtc-parser.tab.c
-/dtc-parser.tab.h
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index 90ef2db85c5f..e999be939831 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
 # scripts/dtc makefile
 
 hostprogs-y	:= dtc
@@ -27,8 +28,5 @@ HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)
 # dependencies on generated files need to be listed explicitly
 $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
 
-# generated files need to be cleaned explicitly
-clean-files	:= dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h
-
 # Added for U-Boot
 subdir-$(CONFIG_PYLIBFDT) += pylibfdt
diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped
deleted file mode 100644
index 011bb9632ff2..000000000000
--- a/scripts/dtc/dtc-lexer.lex.c_shipped
+++ /dev/null
@@ -1,2259 +0,0 @@
-#line 2 "dtc-lexer.lex.c"
-
-#line 4 "dtc-lexer.lex.c"
-
-#define  YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 1
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-/* First, we deal with  platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
- */
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
-#endif
-
-#include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN               (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN              (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN              (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX               (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX              (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX              (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX              (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX             (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX             (4294967295U)
-#endif
-
-#endif /* ! C99 */
-
-#endif /* ! FLEXINT_H */
-
-/* TODO: this is always defined, so inline it */
-#define yyconst const
-
-#if defined(__GNUC__) && __GNUC__ >= 3
-#define yynoreturn __attribute__((__noreturn__))
-#else
-#define yynoreturn
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN (yy_start) = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START (((yy_start) - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart(yyin  )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k.
- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
- * Ditto for the __ia64__ case accordingly.
- */
-#define YY_BUF_SIZE 32768
-#else
-#define YY_BUF_SIZE 16384
-#endif /* __ia64__ */
-#endif
-
-/* The state buf must be large enough to hold one state per character in the main buffer.
- */
-#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-extern int yyleng;
-
-extern FILE *yyin, *yyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-    #define YY_LESS_LINENO(n)
-    #define YY_LINENO_REWIND_TO(ptr)
-    
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-		*yy_cp = (yy_hold_char); \
-		YY_RESTORE_YY_MORE_OFFSET \
-		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
-		} \
-	while ( 0 )
-
-#define unput(c) yyunput( c, (yytext_ptr)  )
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
-	{
-	FILE *yy_input_file;
-
-	char *yy_ch_buf;		/* input buffer */
-	char *yy_buf_pos;		/* current position in input buffer */
-
-	/* Size of input buffer in bytes, not including room for EOB
-	 * characters.
-	 */
-	int yy_buf_size;
-
-	/* Number of characters read into yy_ch_buf, not including EOB
-	 * characters.
-	 */
-	int yy_n_chars;
-
-	/* Whether we "own" the buffer - i.e., we know we created it,
-	 * and can realloc() it to grow it, and should free() it to
-	 * delete it.
-	 */
-	int yy_is_our_buffer;
-
-	/* Whether this is an "interactive" input source; if so, and
-	 * if we're using stdio for input, then we want to use getc()
-	 * instead of fread(), to make sure we stop fetching input after
-	 * each newline.
-	 */
-	int yy_is_interactive;
-
-	/* Whether we're considered to be at the beginning of a line.
-	 * If so, '^' rules will be active on the next match, otherwise
-	 * not.
-	 */
-	int yy_at_bol;
-
-    int yy_bs_lineno; /**< The line count. */
-    int yy_bs_column; /**< The column count. */
-
-	/* Whether to try to fill the input buffer when we reach the
-	 * end of it.
-	 */
-	int yy_fill_buffer;
-
-	int yy_buffer_status;
-
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-	/* When an EOF's been seen but there's still some text to process
-	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-	 * shouldn't try reading from the input source any more.  We might
-	 * still have a bunch of tokens to match, though, because of
-	 * possible backing-up.
-	 *
-	 * When we actually see the EOF, we change the status to "new"
-	 * (via yyrestart()), so that the user can continue scanning by
-	 * just pointing yyin@a new input file.
-	 */
-#define YY_BUFFER_EOF_PENDING 2
-
-	};
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-/* Stack of input buffers. */
-static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
-static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- *
- * Returns the top of the stack, or NULL.
- */
-#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
-                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
-                          : NULL)
-
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-static int yy_n_chars;		/* number of characters read into yy_ch_buf */
-int yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = NULL;
-static int yy_init = 0;		/* whether we need to initialize */
-static int yy_start = 0;	/* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin.  A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void yyrestart (FILE *input_file  );
-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
-void yy_delete_buffer (YY_BUFFER_STATE b  );
-void yy_flush_buffer (YY_BUFFER_STATE b  );
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
-void yypop_buffer_state (void );
-
-static void yyensure_buffer_stack (void );
-static void yy_load_buffer_state (void );
-static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
-
-#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
-
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
-
-void *yyalloc (yy_size_t  );
-void *yyrealloc (void *,yy_size_t  );
-void yyfree (void *  );
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
-	{ \
-	if ( ! YY_CURRENT_BUFFER ){ \
-        yyensure_buffer_stack (); \
-		YY_CURRENT_BUFFER_LVALUE =    \
-            yy_create_buffer(yyin,YY_BUF_SIZE ); \
-	} \
-	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-	}
-
-#define yy_set_bol(at_bol) \
-	{ \
-	if ( ! YY_CURRENT_BUFFER ){\
-        yyensure_buffer_stack (); \
-		YY_CURRENT_BUFFER_LVALUE =    \
-            yy_create_buffer(yyin,YY_BUF_SIZE ); \
-	} \
-	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
-	}
-
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-
-/* Begin user sect3 */
-
-#define yywrap() (/*CONSTCOND*/1)
-#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
-
-FILE *yyin = NULL, *yyout = NULL;
-
-typedef int yy_state_type;
-
-extern int yylineno;
-
-int yylineno = 1;
-
-extern char *yytext;
-#ifdef yytext_ptr
-#undef yytext_ptr
-#endif
-#define yytext_ptr yytext
-
-static yy_state_type yy_get_previous_state (void );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
-static int yy_get_next_buffer (void );
-static void yynoreturn yy_fatal_error (yyconst char* msg  );
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
-	(yytext_ptr) = yy_bp; \
-	yyleng = (int) (yy_cp - yy_bp); \
-	(yy_hold_char) = *yy_cp; \
-	*yy_cp = '\0'; \
-	(yy_c_buf_p) = yy_cp;
-
-#define YY_NUM_RULES 31
-#define YY_END_OF_BUFFER 32
-/* This struct is not used in this scanner,
-   but its presence is necessary. */
-struct yy_trans_info
-	{
-	flex_int32_t yy_verify;
-	flex_int32_t yy_nxt;
-	};
-static yyconst flex_int16_t yy_accept[166] =
-    {   0,
-        0,    0,    0,    0,    0,    0,    0,    0,   32,   30,
-       19,   19,   30,   30,   30,   30,   30,   30,   30,   30,
-       30,   30,   30,   30,   30,   30,   16,   17,   17,   30,
-       17,   11,   11,   19,   27,    0,    3,    0,   28,   13,
-        0,    0,   12,    0,    0,    0,    0,    0,    0,    0,
-        0,   22,   24,   26,   25,   23,    0,   10,   29,    0,
-        0,    0,   15,   15,   17,   17,   17,   11,   11,   11,
-        0,   13,    0,   12,    0,    0,    0,   21,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,   17,   11,   11,
-       11,    0,   14,   20,    0,    0,    0,    0,    0,    0,
-
-        0,    0,    0,    0,   17,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,   17,    7,    0,    0,    0,
-        0,    0,    0,    0,    2,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    4,   18,    0,    0,    5,    2,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    1,    0,    0,    0,    0,    6,    9,    0,
-        0,    0,    0,    8,    0
-    } ;
-
-static yyconst YY_CHAR yy_ec[256] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
-        4,    4,    4,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2,    5,    6,    7,    1,    1,    8,    9,    1,
-        1,   10,   11,   11,   12,   11,   13,   14,   15,   16,
-       16,   16,   16,   16,   16,   16,   16,   17,    1,   18,
-       19,   20,   11,   11,   21,   21,   21,   21,   21,   21,
-       22,   22,   22,   22,   22,   23,   22,   22,   22,   22,
-       22,   22,   22,   22,   24,   22,   22,   25,   22,   22,
-        1,   26,   27,    1,   22,    1,   21,   28,   29,   30,
-
-       31,   21,   32,   22,   33,   22,   22,   34,   35,   36,
-       37,   38,   22,   39,   40,   41,   42,   43,   22,   25,
-       44,   22,   45,   46,   47,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1
-    } ;
-
-static yyconst YY_CHAR yy_meta[48] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    2,    3,    1,    2,
-        2,    2,    4,    5,    5,    5,    6,    1,    1,    1,
-        7,    8,    8,    8,    8,    1,    1,    7,    7,    7,
-        7,    8,    8,    8,    8,    8,    8,    8,    8,    8,
-        8,    8,    8,    8,    3,    1,    4
-    } ;
-
-static yyconst flex_uint16_t yy_base[180] =
-    {   0,
-        0,  393,   35,  392,   66,  391,   38,  107,  397,  401,
-       55,  113,  377,  112,  111,  111,  114,   42,  376,  106,
-      377,  347,  126,  120,    0,  147,  401,    0,  124,    0,
-      137,  158,  170,  163,  401,  153,  401,  389,  401,    0,
-      378,  120,  401,  131,  380,  386,  355,  139,  351,  355,
-      351,  401,  401,  401,  401,  401,  367,  401,  401,  185,
-      350,  346,  401,  364,    0,  185,  347,  189,  356,  355,
-        0,    0,  330,  180,  366,  141,  372,  361,  332,  338,
-      331,  341,  334,  326,  205,  331,  337,  329,  401,  341,
-      167,  316,  401,  349,  348,  320,  328,  346,  180,  318,
-
-      324,  209,  324,  320,  322,  342,  338,  309,  306,  315,
-      305,  315,  312,  192,  342,  341,  401,  293,  306,  282,
-      268,  252,  255,  203,  285,  282,  272,  268,  252,  233,
-      232,  239,  208,  107,  401,  401,  238,  211,  401,  211,
-      212,  208,  228,  203,  215,  207,  233,  222,  212,  211,
-      203,  227,  401,  237,  225,  204,  185,  401,  401,  149,
-      128,   88,   42,  401,  401,  253,  259,  267,  271,  275,
-      281,  288,  292,  300,  308,  312,  318,  326,  334
-    } ;
-
-static yyconst flex_int16_t yy_def[180] =
-    {   0,
-      165,    1,    1,    3,  165,    5,    1,    1,  165,  165,
-      165,  165,  165,  166,  167,  168,  165,  165,  165,  165,
-      169,  165,  165,  165,  170,  169,  165,  171,  172,  171,
-      171,  165,  165,  165,  165,  166,  165,  166,  165,  173,
-      165,  168,  165,  168,  174,  175,  165,  165,  165,  165,
-      165,  165,  165,  165,  165,  165,  169,  165,  165,  165,
-      165,  165,  165,  169,  171,  172,  171,  165,  165,  165,
-      176,  173,  177,  168,  174,  174,  175,  165,  165,  165,
-      165,  165,  165,  165,  165,  165,  165,  171,  165,  165,
-      176,  177,  165,  165,  165,  165,  165,  165,  165,  165,
-
-      165,  165,  165,  165,  171,  165,  165,  165,  165,  165,
-      165,  165,  165,  178,  165,  171,  165,  165,  165,  165,
-      165,  165,  165,  178,  165,  178,  165,  165,  165,  165,
-      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
-      165,  165,  165,  165,  165,  165,  165,  179,  165,  165,
-      165,  179,  165,  179,  165,  165,  165,  165,  165,  165,
-      165,  165,  165,  165,    0,  165,  165,  165,  165,  165,
-      165,  165,  165,  165,  165,  165,  165,  165,  165
-    } ;
-
-static yyconst flex_uint16_t yy_nxt[449] =
-    {   0,
-       10,   11,   12,   11,   13,   14,   10,   15,   16,   10,
-       10,   10,   17,   10,   10,   10,   10,   18,   19,   20,
-       21,   21,   21,   21,   21,   10,   10,   21,   21,   21,
-       21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
-       21,   21,   21,   21,   10,   22,   10,   24,   25,   25,
-       25,   32,   33,   33,  164,   26,   34,   34,   34,   52,
-       53,   27,   26,   26,   26,   26,   10,   11,   12,   11,
-       13,   14,   28,   15,   16,   28,   28,   28,   24,   28,
-       28,   28,   10,   18,   19,   20,   29,   29,   29,   29,
-       29,   30,   10,   29,   29,   29,   29,   29,   29,   29,
-
-       29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
-       10,   22,   10,   23,   34,   34,   34,   37,   39,   43,
-       32,   33,   33,   45,   55,   56,   46,   60,   43,   45,
-       65,  163,   46,   65,   65,   65,   44,   38,   60,   74,
-       58,   47,  141,   48,  142,   44,   49,   47,   50,   48,
-       76,   51,   62,   94,   50,   41,   44,   51,   37,   61,
-       64,   64,   64,   58,   34,   34,   34,   64,  162,   80,
-       67,   68,   68,   68,   64,   64,   64,   64,   38,   81,
-       69,   70,   71,   68,   68,   68,   60,  161,   43,   69,
-       70,   65,   69,   70,   65,   65,   65,  125,   85,   85,
-
-       85,   58,   68,   68,   68,   44,  102,  110,  125,  133,
-      102,   69,   70,  111,  114,  160,  159,  126,   85,   85,
-       85,  140,  140,  140,  140,  140,  140,  153,  126,  147,
-      147,  147,  153,  148,  147,  147,  147,  158,  148,  165,
-      157,  156,  155,  151,  150,  149,  146,  154,  145,  144,
-      143,  139,  154,   36,   36,   36,   36,   36,   36,   36,
-       36,   40,  138,  137,  136,   40,   40,   42,   42,   42,
-       42,   42,   42,   42,   42,   57,   57,   57,   57,   63,
-      135,   63,   65,  134,  165,   65,  133,   65,   65,   66,
-      132,  131,   66,   66,   66,   66,   72,  130,   72,   72,
-
-       75,   75,   75,   75,   75,   75,   75,   75,   77,   77,
-       77,   77,   77,   77,   77,   77,   91,  129,   91,   92,
-      128,   92,   92,  127,   92,   92,  124,  124,  124,  124,
-      124,  124,  124,  124,  152,  152,  152,  152,  152,  152,
-      152,  152,   60,   60,  123,  122,  121,  120,  119,  118,
-      117,   45,  116,  111,  115,  113,  112,  109,  108,  107,
-       46,  106,   93,   89,  105,  104,  103,  101,  100,   99,
-       98,   97,   96,   95,   78,   76,   93,   90,   89,   88,
-       58,   87,   86,   58,   84,   83,   82,   79,   78,   76,
-       73,  165,   59,   58,   54,   35,  165,   31,   23,   23,
-
-        9,  165,  165,  165,  165,  165,  165,  165,  165,  165,
-      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
-      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
-      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
-      165,  165,  165,  165,  165,  165,  165,  165
-    } ;
-
-static yyconst flex_int16_t yy_chk[449] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    3,    3,    3,
-        3,    7,    7,    7,  163,    3,   11,   11,   11,   18,
-       18,    3,    3,    3,    3,    3,    5,    5,    5,    5,
-        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
-        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
-        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
-
-        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
-        5,    5,    5,    8,   12,   12,   12,   14,   15,   16,
-        8,    8,    8,   17,   20,   20,   17,   23,   42,   24,
-       29,  162,   24,   29,   29,   29,   16,   14,   31,   44,
-       29,   17,  134,   17,  134,   42,   17,   24,   17,   24,
-       76,   17,   24,   76,   24,   15,   44,   24,   36,   23,
-       26,   26,   26,   26,   34,   34,   34,   26,  161,   48,
-       31,   32,   32,   32,   26,   26,   26,   26,   36,   48,
-       32,   32,   32,   33,   33,   33,   60,  160,   74,   91,
-       91,   66,   33,   33,   66,   66,   66,  114,   60,   60,
-
-       60,   66,   68,   68,   68,   74,   85,   99,  124,  133,
-      102,   68,   68,   99,  102,  157,  156,  114,   85,   85,
-       85,  133,  133,  133,  140,  140,  140,  148,  124,  143,
-      143,  143,  152,  143,  147,  147,  147,  155,  147,  154,
-      151,  150,  149,  146,  145,  144,  142,  148,  141,  138,
-      137,  132,  152,  166,  166,  166,  166,  166,  166,  166,
-      166,  167,  131,  130,  129,  167,  167,  168,  168,  168,
-      168,  168,  168,  168,  168,  169,  169,  169,  169,  170,
-      128,  170,  171,  127,  126,  171,  125,  171,  171,  172,
-      123,  122,  172,  172,  172,  172,  173,  121,  173,  173,
-
-      174,  174,  174,  174,  174,  174,  174,  174,  175,  175,
-      175,  175,  175,  175,  175,  175,  176,  120,  176,  177,
-      119,  177,  177,  118,  177,  177,  178,  178,  178,  178,
-      178,  178,  178,  178,  179,  179,  179,  179,  179,  179,
-      179,  179,  116,  115,  113,  112,  111,  110,  109,  108,
-      107,  106,  105,  104,  103,  101,  100,   98,   97,   96,
-       95,   94,   92,   90,   88,   87,   86,   84,   83,   82,
-       81,   80,   79,   78,   77,   75,   73,   70,   69,   67,
-       64,   62,   61,   57,   51,   50,   49,   47,   46,   45,
-       41,   38,   22,   21,   19,   13,    9,    6,    4,    2,
-
-      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
-      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
-      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
-      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
-      165,  165,  165,  165,  165,  165,  165,  165
-    } ;
-
-static yy_state_type yy_last_accepting_state;
-static char *yy_last_accepting_cpos;
-
-extern int yy_flex_debug;
-int yy_flex_debug = 0;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
-#line 1 "dtc-lexer.l"
-/*
- * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
- *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
- *                                                                   USA
- */
-#define YY_NO_INPUT 1
-
-
-
-#line 37 "dtc-lexer.l"
-#include "dtc.h"
-#include "srcpos.h"
-#include "dtc-parser.tab.h"
-
-YYLTYPE yylloc;
-extern bool treesource_error;
-
-/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
-#define	YY_USER_ACTION \
-	{ \
-		srcpos_update(&yylloc, yytext, yyleng); \
-	}
-
-/*#define LEXDEBUG	1*/
-
-#ifdef LEXDEBUG
-#define DPRINT(fmt, ...)	fprintf(stderr, fmt, ##__VA_ARGS__)
-#else
-#define DPRINT(fmt, ...)	do { } while (0)
-#endif
-
-static int dts_version = 1;
-
-#define BEGIN_DEFAULT()		DPRINT("<V1>\n"); \
-				BEGIN(V1); \
-
-static void push_input_file(const char *filename);
-static bool pop_input_file(void);
-static void PRINTF(1, 2) lexical_error(const char *fmt, ...);
-
-#line 661 "dtc-lexer.lex.c"
-
-#define INITIAL 0
-#define BYTESTRING 1
-#define PROPNODENAME 2
-#define V1 3
-
-#ifndef YY_NO_UNISTD_H
-/* Special case for "unistd.h", since it is non-ANSI. We include it way
- * down here because we want the user's section 1 to have been scanned first.
- * The user has a chance to override it with an option.
- */
-#include <unistd.h>
-#endif
-
-#ifndef YY_EXTRA_TYPE
-#define YY_EXTRA_TYPE void *
-#endif
-
-static int yy_init_globals (void );
-
-/* Accessor methods to globals.
-   These are made visible to non-reentrant scanners for convenience. */
-
-int yylex_destroy (void );
-
-int yyget_debug (void );
-
-void yyset_debug (int debug_flag  );
-
-YY_EXTRA_TYPE yyget_extra (void );
-
-void yyset_extra (YY_EXTRA_TYPE user_defined  );
-
-FILE *yyget_in (void );
-
-void yyset_in  (FILE * _in_str  );
-
-FILE *yyget_out (void );
-
-void yyset_out  (FILE * _out_str  );
-
-			int yyget_leng (void );
-
-char *yyget_text (void );
-
-int yyget_lineno (void );
-
-void yyset_lineno (int _line_number  );
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap (void );
-#else
-extern int yywrap (void );
-#endif
-#endif
-
-#ifndef YY_NO_UNPUT
-    
-#endif
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
-#endif
-
-#ifndef YY_NO_INPUT
-
-#ifdef __cplusplus
-static int yyinput (void );
-#else
-static int input (void );
-#endif
-
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k */
-#define YY_READ_BUF_SIZE 16384
-#else
-#define YY_READ_BUF_SIZE 8192
-#endif /* __ia64__ */
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
-		{ \
-		int c = '*'; \
-		size_t n; \
-		for ( n = 0; n < max_size && \
-			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
-			buf[n] = (char) c; \
-		if ( c == '\n' ) \
-			buf[n++] = (char) c; \
-		if ( c == EOF && ferror( yyin ) ) \
-			YY_FATAL_ERROR( "input in flex scanner failed" ); \
-		result = n; \
-		} \
-	else \
-		{ \
-		errno=0; \
-		while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
-			{ \
-			if( errno != EINTR) \
-				{ \
-				YY_FATAL_ERROR( "input in flex scanner failed" ); \
-				break; \
-				} \
-			errno=0; \
-			clearerr(yyin); \
-			} \
-		}\
-\
-
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* end tables serialization structures and prototypes */
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-
-extern int yylex (void);
-
-#define YY_DECL int yylex (void)
-#endif /* !YY_DECL */
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed@the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK /*LINTED*/break;
-#endif
-
-#define YY_RULE_SETUP \
-	if ( yyleng > 0 ) \
-		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
-				(yytext[yyleng - 1] == '\n'); \
-	YY_USER_ACTION
-
-/** The main scanner function which does all the work.
- */
-YY_DECL
-{
-	yy_state_type yy_current_state;
-	char *yy_cp, *yy_bp;
-	int yy_act;
-    
-	if ( !(yy_init) )
-		{
-		(yy_init) = 1;
-
-#ifdef YY_USER_INIT
-		YY_USER_INIT;
-#endif
-
-		if ( ! (yy_start) )
-			(yy_start) = 1;	/* first start state */
-
-		if ( ! yyin )
-			yyin = stdin;
-
-		if ( ! yyout )
-			yyout = stdout;
-
-		if ( ! YY_CURRENT_BUFFER ) {
-			yyensure_buffer_stack ();
-			YY_CURRENT_BUFFER_LVALUE =
-				yy_create_buffer(yyin,YY_BUF_SIZE );
-		}
-
-		yy_load_buffer_state( );
-		}
-
-	{
-#line 69 "dtc-lexer.l"
-
-#line 885 "dtc-lexer.lex.c"
-
-	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
-		{
-		yy_cp = (yy_c_buf_p);
-
-		/* Support of yytext. */
-		*yy_cp = (yy_hold_char);
-
-		/* yy_bp points to the position in yy_ch_buf of the start of
-		 * the current run.
-		 */
-		yy_bp = yy_cp;
-
-		yy_current_state = (yy_start);
-		yy_current_state += YY_AT_BOL();
-yy_match:
-		do
-			{
-			YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
-			if ( yy_accept[yy_current_state] )
-				{
-				(yy_last_accepting_state) = yy_current_state;
-				(yy_last_accepting_cpos) = yy_cp;
-				}
-			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-				{
-				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 166 )
-					yy_c = yy_meta[(unsigned int) yy_c];
-				}
-			yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
-			++yy_cp;
-			}
-		while ( yy_current_state != 165 );
-		yy_cp = (yy_last_accepting_cpos);
-		yy_current_state = (yy_last_accepting_state);
-
-yy_find_action:
-		yy_act = yy_accept[yy_current_state];
-
-		YY_DO_BEFORE_ACTION;
-
-do_action:	/* This label is used only to access EOF actions. */
-
-		switch ( yy_act )
-	{ /* beginning of action switch */
-			case 0: /* must back up */
-			/* undo the effects of YY_DO_BEFORE_ACTION */
-			*yy_cp = (yy_hold_char);
-			yy_cp = (yy_last_accepting_cpos);
-			yy_current_state = (yy_last_accepting_state);
-			goto yy_find_action;
-
-case 1:
-/* rule 1 can match eol */
-YY_RULE_SETUP
-#line 70 "dtc-lexer.l"
-{
-			char *name = strchr(yytext, '\"') + 1;
-			yytext[yyleng-1] = '\0';
-			push_input_file(name);
-		}
-	YY_BREAK
-case 2:
-/* rule 2 can match eol */
-YY_RULE_SETUP
-#line 76 "dtc-lexer.l"
-{
-			char *line, *fnstart, *fnend;
-			struct data fn;
-			/* skip text before line # */
-			line = yytext;
-			while (!isdigit((unsigned char)*line))
-				line++;
-
-			/* regexp ensures that first and list "
-			 * in the whole yytext are those at
-			 * beginning and end of the filename string */
-			fnstart = memchr(yytext, '"', yyleng);
-			for (fnend = yytext + yyleng - 1;
-			     *fnend != '"'; fnend--)
-				;
-			assert(fnstart && fnend && (fnend > fnstart));
-
-			fn = data_copy_escape_string(fnstart + 1,
-						     fnend - fnstart - 1);
-
-			/* Don't allow nuls in filenames */
-			if (memchr(fn.val, '\0', fn.len - 1))
-				lexical_error("nul in line number directive");
-
-			/* -1 since #line is the number of the next line */
-			srcpos_set_line(xstrdup(fn.val), atoi(line) - 1);
-			data_free(fn);
-		}
-	YY_BREAK
-case YY_STATE_EOF(INITIAL):
-case YY_STATE_EOF(BYTESTRING):
-case YY_STATE_EOF(PROPNODENAME):
-case YY_STATE_EOF(V1):
-#line 105 "dtc-lexer.l"
-{
-			if (!pop_input_file()) {
-				yyterminate();
-			}
-		}
-	YY_BREAK
-case 3:
-/* rule 3 can match eol */
-YY_RULE_SETUP
-#line 111 "dtc-lexer.l"
-{
-			DPRINT("String: %s\n", yytext);
-			yylval.data = data_copy_escape_string(yytext+1,
-					yyleng-2);
-			return DT_STRING;
-		}
-	YY_BREAK
-case 4:
-YY_RULE_SETUP
-#line 118 "dtc-lexer.l"
-{
-			DPRINT("Keyword: /dts-v1/\n");
-			dts_version = 1;
-			BEGIN_DEFAULT();
-			return DT_V1;
-		}
-	YY_BREAK
-case 5:
-YY_RULE_SETUP
-#line 125 "dtc-lexer.l"
-{
-			DPRINT("Keyword: /plugin/\n");
-			return DT_PLUGIN;
-		}
-	YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 130 "dtc-lexer.l"
-{
-			DPRINT("Keyword: /memreserve/\n");
-			BEGIN_DEFAULT();
-			return DT_MEMRESERVE;
-		}
-	YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 136 "dtc-lexer.l"
-{
-			DPRINT("Keyword: /bits/\n");
-			BEGIN_DEFAULT();
-			return DT_BITS;
-		}
-	YY_BREAK
-case 8:
-YY_RULE_SETUP
-#line 142 "dtc-lexer.l"
-{
-			DPRINT("Keyword: /delete-property/\n");
-			DPRINT("<PROPNODENAME>\n");
-			BEGIN(PROPNODENAME);
-			return DT_DEL_PROP;
-		}
-	YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 149 "dtc-lexer.l"
-{
-			DPRINT("Keyword: /delete-node/\n");
-			DPRINT("<PROPNODENAME>\n");
-			BEGIN(PROPNODENAME);
-			return DT_DEL_NODE;
-		}
-	YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 156 "dtc-lexer.l"
-{
-			DPRINT("Label: %s\n", yytext);
-			yylval.labelref = xstrdup(yytext);
-			yylval.labelref[yyleng-1] = '\0';
-			return DT_LABEL;
-		}
-	YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 163 "dtc-lexer.l"
-{
-			char *e;
-			DPRINT("Integer Literal: '%s'\n", yytext);
-
-			errno = 0;
-			yylval.integer = strtoull(yytext, &e, 0);
-
-			if (*e && e[strspn(e, "UL")]) {
-				lexical_error("Bad integer literal '%s'",
-					      yytext);
-			}
-
-			if (errno == ERANGE)
-				lexical_error("Integer literal '%s' out of range",
-					      yytext);
-			else
-				/* ERANGE is the only strtoull error triggerable
-				 *  by strings matching the pattern */
-				assert(errno == 0);
-			return DT_LITERAL;
-		}
-	YY_BREAK
-case 12:
-/* rule 12 can match eol */
-YY_RULE_SETUP
-#line 185 "dtc-lexer.l"
-{
-			struct data d;
-			DPRINT("Character literal: %s\n", yytext);
-
-			d = data_copy_escape_string(yytext+1, yyleng-2);
-			if (d.len == 1) {
-				lexical_error("Empty character literal");
-				yylval.integer = 0;
-			} else {
-				yylval.integer = (unsigned char)d.val[0];
-
-				if (d.len > 2)
-					lexical_error("Character literal has %d"
-						      " characters instead of 1",
-						      d.len - 1);
-			}
-
-			data_free(d);
-			return DT_CHAR_LITERAL;
-		}
-	YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 206 "dtc-lexer.l"
-{	/* label reference */
-			DPRINT("Ref: %s\n", yytext+1);
-			yylval.labelref = xstrdup(yytext+1);
-			return DT_REF;
-		}
-	YY_BREAK
-case 14:
-YY_RULE_SETUP
-#line 212 "dtc-lexer.l"
-{	/* new-style path reference */
-			yytext[yyleng-1] = '\0';
-			DPRINT("Ref: %s\n", yytext+2);
-			yylval.labelref = xstrdup(yytext+2);
-			return DT_REF;
-		}
-	YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 219 "dtc-lexer.l"
-{
-			yylval.byte = strtol(yytext, NULL, 16);
-			DPRINT("Byte: %02x\n", (int)yylval.byte);
-			return DT_BYTE;
-		}
-	YY_BREAK
-case 16:
-YY_RULE_SETUP
-#line 225 "dtc-lexer.l"
-{
-			DPRINT("/BYTESTRING\n");
-			BEGIN_DEFAULT();
-			return ']';
-		}
-	YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 231 "dtc-lexer.l"
-{
-			DPRINT("PropNodeName: %s\n", yytext);
-			yylval.propnodename = xstrdup((yytext[0] == '\\') ?
-							yytext + 1 : yytext);
-			BEGIN_DEFAULT();
-			return DT_PROPNODENAME;
-		}
-	YY_BREAK
-case 18:
-YY_RULE_SETUP
-#line 239 "dtc-lexer.l"
-{
-			DPRINT("Binary Include\n");
-			return DT_INCBIN;
-		}
-	YY_BREAK
-case 19:
-/* rule 19 can match eol */
-YY_RULE_SETUP
-#line 244 "dtc-lexer.l"
-/* eat whitespace */
-	YY_BREAK
-case 20:
-/* rule 20 can match eol */
-YY_RULE_SETUP
-#line 245 "dtc-lexer.l"
-/* eat C-style comments */
-	YY_BREAK
-case 21:
-/* rule 21 can match eol */
-YY_RULE_SETUP
-#line 246 "dtc-lexer.l"
-/* eat C++-style comments */
-	YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 248 "dtc-lexer.l"
-{ return DT_LSHIFT; };
-	YY_BREAK
-case 23:
-YY_RULE_SETUP
-#line 249 "dtc-lexer.l"
-{ return DT_RSHIFT; };
-	YY_BREAK
-case 24:
-YY_RULE_SETUP
-#line 250 "dtc-lexer.l"
-{ return DT_LE; };
-	YY_BREAK
-case 25:
-YY_RULE_SETUP
-#line 251 "dtc-lexer.l"
-{ return DT_GE; };
-	YY_BREAK
-case 26:
-YY_RULE_SETUP
-#line 252 "dtc-lexer.l"
-{ return DT_EQ; };
-	YY_BREAK
-case 27:
-YY_RULE_SETUP
-#line 253 "dtc-lexer.l"
-{ return DT_NE; };
-	YY_BREAK
-case 28:
-YY_RULE_SETUP
-#line 254 "dtc-lexer.l"
-{ return DT_AND; };
-	YY_BREAK
-case 29:
-YY_RULE_SETUP
-#line 255 "dtc-lexer.l"
-{ return DT_OR; };
-	YY_BREAK
-case 30:
-YY_RULE_SETUP
-#line 257 "dtc-lexer.l"
-{
-			DPRINT("Char: %c (\\x%02x)\n", yytext[0],
-				(unsigned)yytext[0]);
-			if (yytext[0] == '[') {
-				DPRINT("<BYTESTRING>\n");
-				BEGIN(BYTESTRING);
-			}
-			if ((yytext[0] == '{')
-			    || (yytext[0] == ';')) {
-				DPRINT("<PROPNODENAME>\n");
-				BEGIN(PROPNODENAME);
-			}
-			return yytext[0];
-		}
-	YY_BREAK
-case 31:
-YY_RULE_SETUP
-#line 272 "dtc-lexer.l"
-ECHO;
-	YY_BREAK
-#line 1257 "dtc-lexer.lex.c"
-
-	case YY_END_OF_BUFFER:
-		{
-		/* Amount of text matched not including the EOB char. */
-		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
-		/* Undo the effects of YY_DO_BEFORE_ACTION. */
-		*yy_cp = (yy_hold_char);
-		YY_RESTORE_YY_MORE_OFFSET
-
-		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-			{
-			/* We're scanning a new file or input source.  It's
-			 * possible that this happened because the user
-			 * just pointed yyin at a new source and called
-			 * yylex().  If so, then we have to assure
-			 * consistency between YY_CURRENT_BUFFER and our
-			 * globals.  Here is the right place to do so, because
-			 * this is the first action (other than possibly a
-			 * back-up) that will match for the new input source.
-			 */
-			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-			}
-
-		/* Note that here we test for yy_c_buf_p "<=" to the position
-		 * of the first EOB in the buffer, since yy_c_buf_p will
-		 * already have been incremented past the NUL character
-		 * (since all states make transitions on EOB to the
-		 * end-of-buffer state).  Contrast this with the test
-		 * in input().
-		 */
-		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-			{ /* This was really a NUL. */
-			yy_state_type yy_next_state;
-
-			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
-			yy_current_state = yy_get_previous_state(  );
-
-			/* Okay, we're now positioned to make the NUL
-			 * transition.  We couldn't have
-			 * yy_get_previous_state() go ahead and do it
-			 * for us because it doesn't know how to deal
-			 * with the possibility of jamming (and we don't
-			 * want to build jamming into it because then it
-			 * will run more slowly).
-			 */
-
-			yy_next_state = yy_try_NUL_trans( yy_current_state );
-
-			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
-			if ( yy_next_state )
-				{
-				/* Consume the NUL. */
-				yy_cp = ++(yy_c_buf_p);
-				yy_current_state = yy_next_state;
-				goto yy_match;
-				}
-
-			else
-				{
-				yy_cp = (yy_last_accepting_cpos);
-				yy_current_state = (yy_last_accepting_state);
-				goto yy_find_action;
-				}
-			}
-
-		else switch ( yy_get_next_buffer(  ) )
-			{
-			case EOB_ACT_END_OF_FILE:
-				{
-				(yy_did_buffer_switch_on_eof) = 0;
-
-				if ( yywrap( ) )
-					{
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF(YY_START);
-					goto do_action;
-					}
-
-				else
-					{
-					if ( ! (yy_did_buffer_switch_on_eof) )
-						YY_NEW_FILE;
-					}
-				break;
-				}
-
-			case EOB_ACT_CONTINUE_SCAN:
-				(yy_c_buf_p) =
-					(yytext_ptr) + yy_amount_of_matched_text;
-
-				yy_current_state = yy_get_previous_state(  );
-
-				yy_cp = (yy_c_buf_p);
-				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-				goto yy_match;
-
-			case EOB_ACT_LAST_MATCH:
-				(yy_c_buf_p) =
-				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
-				yy_current_state = yy_get_previous_state(  );
-
-				yy_cp = (yy_c_buf_p);
-				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-				goto yy_find_action;
-			}
-		break;
-		}
-
-	default:
-		YY_FATAL_ERROR(
-			"fatal flex scanner internal error--no action found" );
-	} /* end of action switch */
-		} /* end of scanning one token */
-	} /* end of user's declarations */
-} /* end of yylex */
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *	EOB_ACT_LAST_MATCH -
- *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *	EOB_ACT_END_OF_FILE - end of file
- */
-static int yy_get_next_buffer (void)
-{
-    	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-	char *source = (yytext_ptr);
-	int number_to_move, i;
-	int ret_val;
-
-	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
-		YY_FATAL_ERROR(
-		"fatal flex scanner internal error--end of buffer missed" );
-
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
-		{ /* Don't try to fill the buffer, so this is an EOF. */
-		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
-			{
-			/* We matched a single character, the EOB, so
-			 * treat this as a final EOF.
-			 */
-			return EOB_ACT_END_OF_FILE;
-			}
-
-		else
-			{
-			/* We matched some text prior to the EOB, first
-			 * process it.
-			 */
-			return EOB_ACT_LAST_MATCH;
-			}
-		}
-
-	/* Try to read more data. */
-
-	/* First move last chars to start of buffer. */
-	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
-
-	for ( i = 0; i < number_to_move; ++i )
-		*(dest++) = *(source++);
-
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-		/* don't do the read, it's not guaranteed to return an EOF,
-		 * just force an EOF
-		 */
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
-	else
-		{
-			int num_to_read =
-			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-		while ( num_to_read <= 0 )
-			{ /* Not enough room in the buffer - grow it. */
-
-			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
-
-			int yy_c_buf_p_offset =
-				(int) ((yy_c_buf_p) - b->yy_ch_buf);
-
-			if ( b->yy_is_our_buffer )
-				{
-				int new_size = b->yy_buf_size * 2;
-
-				if ( new_size <= 0 )
-					b->yy_buf_size += b->yy_buf_size / 8;
-				else
-					b->yy_buf_size *= 2;
-
-				b->yy_ch_buf = (char *)
-					/* Include room in for 2 EOB chars. */
-					yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
-				}
-			else
-				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = NULL;
-
-			if ( ! b->yy_ch_buf )
-				YY_FATAL_ERROR(
-				"fatal error - scanner input buffer overflow" );
-
-			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
-						number_to_move - 1;
-
-			}
-
-		if ( num_to_read > YY_READ_BUF_SIZE )
-			num_to_read = YY_READ_BUF_SIZE;
-
-		/* Read in more data. */
-		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			(yy_n_chars), num_to_read );
-
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-		}
-
-	if ( (yy_n_chars) == 0 )
-		{
-		if ( number_to_move == YY_MORE_ADJ )
-			{
-			ret_val = EOB_ACT_END_OF_FILE;
-			yyrestart(yyin  );
-			}
-
-		else
-			{
-			ret_val = EOB_ACT_LAST_MATCH;
-			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-				YY_BUFFER_EOF_PENDING;
-			}
-		}
-
-	else
-		ret_val = EOB_ACT_CONTINUE_SCAN;
-
-	if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-		/* Extend the array by 50%, plus the number we really need. */
-		int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
-		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
-		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-	}
-
-	(yy_n_chars) += number_to_move;
-	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
-	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
-	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
-	return ret_val;
-}
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-    static yy_state_type yy_get_previous_state (void)
-{
-	yy_state_type yy_current_state;
-	char *yy_cp;
-    
-	yy_current_state = (yy_start);
-	yy_current_state += YY_AT_BOL();
-
-	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
-		{
-		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-		if ( yy_accept[yy_current_state] )
-			{
-			(yy_last_accepting_state) = yy_current_state;
-			(yy_last_accepting_cpos) = yy_cp;
-			}
-		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-			{
-			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 166 )
-				yy_c = yy_meta[(unsigned int) yy_c];
-			}
-		yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
-		}
-
-	return yy_current_state;
-}
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *	next_state = yy_try_NUL_trans( current_state );
- */
-    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
-{
-	int yy_is_jam;
-    	char *yy_cp = (yy_c_buf_p);
-
-	YY_CHAR yy_c = 1;
-	if ( yy_accept[yy_current_state] )
-		{
-		(yy_last_accepting_state) = yy_current_state;
-		(yy_last_accepting_cpos) = yy_cp;
-		}
-	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-		{
-		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 166 )
-			yy_c = yy_meta[(unsigned int) yy_c];
-		}
-	yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
-	yy_is_jam = (yy_current_state == 165);
-
-		return yy_is_jam ? 0 : yy_current_state;
-}
-
-#ifndef YY_NO_UNPUT
-
-#endif
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-    static int yyinput (void)
-#else
-    static int input  (void)
-#endif
-
-{
-	int c;
-    
-	*(yy_c_buf_p) = (yy_hold_char);
-
-	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
-		{
-		/* yy_c_buf_p now points to the character we want to return.
-		 * If this occurs *before* the EOB characters, then it's a
-		 * valid NUL; if not, then we've hit the end of the buffer.
-		 */
-		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-			/* This was really a NUL. */
-			*(yy_c_buf_p) = '\0';
-
-		else
-			{ /* need more input */
-			int offset = (yy_c_buf_p) - (yytext_ptr);
-			++(yy_c_buf_p);
-
-			switch ( yy_get_next_buffer(  ) )
-				{
-				case EOB_ACT_LAST_MATCH:
-					/* This happens because yy_g_n_b()
-					 * sees that we've accumulated a
-					 * token and flags that we need to
-					 * try matching the token before
-					 * proceeding.  But for input(),
-					 * there's no matching to consider.
-					 * So convert the EOB_ACT_LAST_MATCH
-					 * to EOB_ACT_END_OF_FILE.
-					 */
-
-					/* Reset buffer status. */
-					yyrestart(yyin );
-
-					/*FALLTHROUGH*/
-
-				case EOB_ACT_END_OF_FILE:
-					{
-					if ( yywrap( ) )
-						return 0;
-
-					if ( ! (yy_did_buffer_switch_on_eof) )
-						YY_NEW_FILE;
-#ifdef __cplusplus
-					return yyinput();
-#else
-					return input();
-#endif
-					}
-
-				case EOB_ACT_CONTINUE_SCAN:
-					(yy_c_buf_p) = (yytext_ptr) + offset;
-					break;
-				}
-			}
-		}
-
-	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
-	*(yy_c_buf_p) = '\0';	/* preserve yytext */
-	(yy_hold_char) = *++(yy_c_buf_p);
-
-	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
-
-	return c;
-}
-#endif	/* ifndef YY_NO_INPUT */
-
-/** Immediately switch to a different input stream.
- * @param input_file A readable stream.
- * 
- * @note This function does not reset the start condition to @c INITIAL .
- */
-    void yyrestart  (FILE * input_file )
-{
-    
-	if ( ! YY_CURRENT_BUFFER ){
-        yyensure_buffer_stack ();
-		YY_CURRENT_BUFFER_LVALUE =
-            yy_create_buffer(yyin,YY_BUF_SIZE );
-	}
-
-	yy_init_buffer(YY_CURRENT_BUFFER,input_file );
-	yy_load_buffer_state( );
-}
-
-/** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
- * 
- */
-    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
-{
-    
-	/* TODO. We should be able to replace this entire function body
-	 * with
-	 *		yypop_buffer_state();
-	 *		yypush_buffer_state(new_buffer);
-     */
-	yyensure_buffer_stack ();
-	if ( YY_CURRENT_BUFFER == new_buffer )
-		return;
-
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*(yy_c_buf_p) = (yy_hold_char);
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-		}
-
-	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-	yy_load_buffer_state( );
-
-	/* We don't actually know whether we did this switch during
-	 * EOF (yywrap()) processing, but the only time this flag
-	 * is looked at is after yywrap() is called, so it's safe
-	 * to go ahead and always set it.
-	 */
-	(yy_did_buffer_switch_on_eof) = 1;
-}
-
-static void yy_load_buffer_state  (void)
-{
-    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-	(yy_hold_char) = *(yy_c_buf_p);
-}
-
-/** Allocate and initialize an input buffer state.
- * @param file A readable stream.
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * 
- * @return the allocated buffer state.
- */
-    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
-{
-	YY_BUFFER_STATE b;
-    
-	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-	b->yy_buf_size = (yy_size_t)size;
-
-	/* yy_ch_buf has to be 2 characters longer than the size given because
-	 * we need to put in 2 end-of-buffer characters.
-	 */
-	b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
-	if ( ! b->yy_ch_buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-	b->yy_is_our_buffer = 1;
-
-	yy_init_buffer(b,file );
-
-	return b;
-}
-
-/** Destroy the buffer.
- * @param b a buffer created with yy_create_buffer()
- * 
- */
-    void yy_delete_buffer (YY_BUFFER_STATE  b )
-{
-    
-	if ( ! b )
-		return;
-
-	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
-
-	if ( b->yy_is_our_buffer )
-		yyfree((void *) b->yy_ch_buf  );
-
-	yyfree((void *) b  );
-}
-
-/* Initializes or reinitializes a buffer.
- * This function is sometimes called more than once on the same buffer,
- * such as during a yyrestart() or at EOF.
- */
-    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
-
-{
-	int oerrno = errno;
-    
-	yy_flush_buffer(b );
-
-	b->yy_input_file = file;
-	b->yy_fill_buffer = 1;
-
-    /* If b is the current buffer, then yy_init_buffer was _probably_
-     * called from yyrestart() or through yy_get_next_buffer.
-     * In that case, we don't want to reset the lineno or column.
-     */
-    if (b != YY_CURRENT_BUFFER){
-        b->yy_bs_lineno = 1;
-        b->yy_bs_column = 0;
-    }
-
-        b->yy_is_interactive = 0;
-    
-	errno = oerrno;
-}
-
-/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * 
- */
-    void yy_flush_buffer (YY_BUFFER_STATE  b )
-{
-    	if ( ! b )
-		return;
-
-	b->yy_n_chars = 0;
-
-	/* We always need two end-of-buffer characters.  The first causes
-	 * a transition to the end-of-buffer state.  The second causes
-	 * a jam in that state.
-	 */
-	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-	b->yy_buf_pos = &b->yy_ch_buf[0];
-
-	b->yy_at_bol = 1;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	if ( b == YY_CURRENT_BUFFER )
-		yy_load_buffer_state( );
-}
-
-/** Pushes the new state onto the stack. The new state becomes
- *  the current state. This function will allocate the stack
- *  if necessary.
- *  @param new_buffer The new state.
- *  
- */
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
-{
-    	if (new_buffer == NULL)
-		return;
-
-	yyensure_buffer_stack();
-
-	/* This block is copied from yy_switch_to_buffer. */
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*(yy_c_buf_p) = (yy_hold_char);
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-		}
-
-	/* Only push if top exists. Otherwise, replace top. */
-	if (YY_CURRENT_BUFFER)
-		(yy_buffer_stack_top)++;
-	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
-	/* copied from yy_switch_to_buffer. */
-	yy_load_buffer_state( );
-	(yy_did_buffer_switch_on_eof) = 1;
-}
-
-/** Removes and deletes the top of the stack, if present.
- *  The next element becomes the new top.
- *  
- */
-void yypop_buffer_state (void)
-{
-    	if (!YY_CURRENT_BUFFER)
-		return;
-
-	yy_delete_buffer(YY_CURRENT_BUFFER );
-	YY_CURRENT_BUFFER_LVALUE = NULL;
-	if ((yy_buffer_stack_top) > 0)
-		--(yy_buffer_stack_top);
-
-	if (YY_CURRENT_BUFFER) {
-		yy_load_buffer_state( );
-		(yy_did_buffer_switch_on_eof) = 1;
-	}
-}
-
-/* Allocates the stack if it does not exist.
- *  Guarantees space for at least one push.
- */
-static void yyensure_buffer_stack (void)
-{
-	int num_to_alloc;
-    
-	if (!(yy_buffer_stack)) {
-
-		/* First allocation is just for 2 elements, since we don't know if this
-		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
-		 * immediate realloc on the next call.
-         */
-      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
-		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
-								(num_to_alloc * sizeof(struct yy_buffer_state*)
-								);
-		if ( ! (yy_buffer_stack) )
-			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
-		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
-		(yy_buffer_stack_max) = num_to_alloc;
-		(yy_buffer_stack_top) = 0;
-		return;
-	}
-
-	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
-		/* Increase the buffer to prepare for a possible push. */
-		yy_size_t grow_size = 8 /* arbitrary grow size */;
-
-		num_to_alloc = (yy_buffer_stack_max) + grow_size;
-		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
-								((yy_buffer_stack),
-								num_to_alloc * sizeof(struct yy_buffer_state*)
-								);
-		if ( ! (yy_buffer_stack) )
-			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
-		/* zero only the new slots.*/
-		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
-		(yy_buffer_stack_max) = num_to_alloc;
-	}
-}
-
-/** Setup the input buffer state to scan directly from a user-specified character buffer.
- * @param base the character buffer
- * @param size the size in bytes of the character buffer
- * 
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
-{
-	YY_BUFFER_STATE b;
-    
-	if ( size < 2 ||
-	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
-	     base[size-1] != YY_END_OF_BUFFER_CHAR )
-		/* They forgot to leave room for the EOB's. */
-		return NULL;
-
-	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
-	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
-	b->yy_buf_pos = b->yy_ch_buf = base;
-	b->yy_is_our_buffer = 0;
-	b->yy_input_file = NULL;
-	b->yy_n_chars = b->yy_buf_size;
-	b->yy_is_interactive = 0;
-	b->yy_at_bol = 1;
-	b->yy_fill_buffer = 0;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	yy_switch_to_buffer(b  );
-
-	return b;
-}
-
-/** Setup the input buffer state to scan a string. The next call to yylex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
- * 
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- *       yy_scan_bytes() instead.
- */
-YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
-{
-    
-	return yy_scan_bytes(yystr,(int) strlen(yystr) );
-}
-
-/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
- * scan from a @e copy of @a bytes.
- * @param yybytes the byte buffer to scan
- * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
- * 
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
-{
-	YY_BUFFER_STATE b;
-	char *buf;
-	yy_size_t n;
-	int i;
-    
-	/* Get memory for full buffer, including space for trailing EOB's. */
-	n = (yy_size_t) (_yybytes_len + 2);
-	buf = (char *) yyalloc(n  );
-	if ( ! buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
-	for ( i = 0; i < _yybytes_len; ++i )
-		buf[i] = yybytes[i];
-
-	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
-
-	b = yy_scan_buffer(buf,n );
-	if ( ! b )
-		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
-	/* It's okay to grow etc. this buffer, and we should throw it
-	 * away when we're done.
-	 */
-	b->yy_is_our_buffer = 1;
-
-	return b;
-}
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-static void yynoreturn yy_fatal_error (yyconst char* msg )
-{
-			(void) fprintf( stderr, "%s\n", msg );
-	exit( YY_EXIT_FAILURE );
-}
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-		yytext[yyleng] = (yy_hold_char); \
-		(yy_c_buf_p) = yytext + yyless_macro_arg; \
-		(yy_hold_char) = *(yy_c_buf_p); \
-		*(yy_c_buf_p) = '\0'; \
-		yyleng = yyless_macro_arg; \
-		} \
-	while ( 0 )
-
-/* Accessor  methods (get/set functions) to struct members. */
-
-/** Get the current line number.
- * 
- */
-int yyget_lineno  (void)
-{
-    
-    return yylineno;
-}
-
-/** Get the input stream.
- * 
- */
-FILE *yyget_in  (void)
-{
-        return yyin;
-}
-
-/** Get the output stream.
- * 
- */
-FILE *yyget_out  (void)
-{
-        return yyout;
-}
-
-/** Get the length of the current token.
- * 
- */
-int yyget_leng  (void)
-{
-        return yyleng;
-}
-
-/** Get the current token.
- * 
- */
-
-char *yyget_text  (void)
-{
-        return yytext;
-}
-
-/** Set the current line number.
- * @param _line_number line number
- * 
- */
-void yyset_lineno (int  _line_number )
-{
-    
-    yylineno = _line_number;
-}
-
-/** Set the input stream. This does not discard the current
- * input buffer.
- * @param _in_str A readable stream.
- * 
- * @see yy_switch_to_buffer
- */
-void yyset_in (FILE *  _in_str )
-{
-        yyin = _in_str ;
-}
-
-void yyset_out (FILE *  _out_str )
-{
-        yyout = _out_str ;
-}
-
-int yyget_debug  (void)
-{
-        return yy_flex_debug;
-}
-
-void yyset_debug (int  _bdebug )
-{
-        yy_flex_debug = _bdebug ;
-}
-
-static int yy_init_globals (void)
-{
-        /* Initialization is the same as for the non-reentrant scanner.
-     * This function is called from yylex_destroy(), so don't allocate here.
-     */
-
-    (yy_buffer_stack) = NULL;
-    (yy_buffer_stack_top) = 0;
-    (yy_buffer_stack_max) = 0;
-    (yy_c_buf_p) = NULL;
-    (yy_init) = 0;
-    (yy_start) = 0;
-
-/* Defined in main.c */
-#ifdef YY_STDINIT
-    yyin = stdin;
-    yyout = stdout;
-#else
-    yyin = NULL;
-    yyout = NULL;
-#endif
-
-    /* For future reference: Set errno on error, since we are called by
-     * yylex_init()
-     */
-    return 0;
-}
-
-/* yylex_destroy is for both reentrant and non-reentrant scanners. */
-int yylex_destroy  (void)
-{
-    
-    /* Pop the buffer stack, destroying each element. */
-	while(YY_CURRENT_BUFFER){
-		yy_delete_buffer(YY_CURRENT_BUFFER  );
-		YY_CURRENT_BUFFER_LVALUE = NULL;
-		yypop_buffer_state();
-	}
-
-	/* Destroy the stack itself. */
-	yyfree((yy_buffer_stack) );
-	(yy_buffer_stack) = NULL;
-
-    /* Reset the globals. This is important in a non-reentrant scanner so the next time
-     * yylex() is called, initialization will occur. */
-    yy_init_globals( );
-
-    return 0;
-}
-
-/*
- * Internal utility routines.
- */
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
-{
-		
-	int i;
-	for ( i = 0; i < n; ++i )
-		s1[i] = s2[i];
-}
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s )
-{
-	int n;
-	for ( n = 0; s[n]; ++n )
-		;
-
-	return n;
-}
-#endif
-
-void *yyalloc (yy_size_t  size )
-{
-			return malloc(size);
-}
-
-void *yyrealloc  (void * ptr, yy_size_t  size )
-{
-		
-	/* The cast to (char *) in the following accommodates both
-	 * implementations that use char* generic pointers, and those
-	 * that use void* generic pointers.  It works with the latter
-	 * because both ANSI C and C++ allow castless assignment from
-	 * any pointer type to void*, and deal with argument conversions
-	 * as though doing an assignment.
-	 */
-	return realloc(ptr, size);
-}
-
-void yyfree (void * ptr )
-{
-			free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
-}
-
-#define YYTABLES_NAME "yytables"
-
-#line 272 "dtc-lexer.l"
-
-
-
-static void push_input_file(const char *filename)
-{
-	assert(filename);
-
-	srcfile_push(filename);
-
-	yyin = current_srcfile->f;
-
-	yypush_buffer_state(yy_create_buffer(yyin,YY_BUF_SIZE));
-}
-
-
-static bool pop_input_file(void)
-{
-	if (srcfile_pop() == 0)
-		return false;
-
-	yypop_buffer_state();
-	yyin = current_srcfile->f;
-
-	return true;
-}
-
-static void lexical_error(const char *fmt, ...)
-{
-	va_list ap;
-
-	va_start(ap, fmt);
-	srcpos_verror(&yylloc, "Lexical error", fmt, ap);
-	va_end(ap);
-
-	treesource_error = true;
-}
-
diff --git a/scripts/dtc/dtc-parser.tab.c_shipped b/scripts/dtc/dtc-parser.tab.c_shipped
deleted file mode 100644
index aea514fa6928..000000000000
--- a/scripts/dtc/dtc-parser.tab.c_shipped
+++ /dev/null
@@ -1,2321 +0,0 @@
-/* A Bison parser, made by GNU Bison 3.0.4.  */
-
-/* Bison implementation for Yacc-like parsers in C
-
-   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-/* C LALR(1) parser skeleton written by Richard Stallman, by
-   simplifying the original so-called "semantic" parser.  */
-
-/* All symbols defined below should begin with yy or YY, to avoid
-   infringing on user name space.  This should be done even for local
-   variables, as they might otherwise be expanded by user macros.
-   There are some unavoidable exceptions within include files to
-   define necessary library symbols; they are noted "INFRINGES ON
-   USER NAME SPACE" below.  */
-
-/* Identify Bison output.  */
-#define YYBISON 1
-
-/* Bison version.  */
-#define YYBISON_VERSION "3.0.4"
-
-/* Skeleton name.  */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers.  */
-#define YYPURE 0
-
-/* Push parsers.  */
-#define YYPUSH 0
-
-/* Pull parsers.  */
-#define YYPULL 1
-
-
-
-
-/* Copy the first part of user declarations.  */
-#line 20 "dtc-parser.y" /* yacc.c:339  */
-
-#include <stdio.h>
-#include <inttypes.h>
-
-#include "dtc.h"
-#include "srcpos.h"
-
-extern int yylex(void);
-extern void yyerror(char const *s);
-#define ERROR(loc, ...) \
-	do { \
-		srcpos_error((loc), "Error", __VA_ARGS__); \
-		treesource_error = true; \
-	} while (0)
-
-extern struct dt_info *parser_output;
-extern bool treesource_error;
-
-#line 85 "dtc-parser.tab.c" /* yacc.c:339  */
-
-# ifndef YY_NULLPTR
-#  if defined __cplusplus && 201103L <= __cplusplus
-#   define YY_NULLPTR nullptr
-#  else
-#   define YY_NULLPTR 0
-#  endif
-# endif
-
-/* Enabling verbose error messages.  */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* In a future release of Bison, this section will be replaced
-   by #include "dtc-parser.tab.h".  */
-#ifndef YY_YY_DTC_PARSER_TAB_H_INCLUDED
-# define YY_YY_DTC_PARSER_TAB_H_INCLUDED
-/* Debug traces.  */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-#if YYDEBUG
-extern int yydebug;
-#endif
-
-/* Token type.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-  enum yytokentype
-  {
-    DT_V1 = 258,
-    DT_PLUGIN = 259,
-    DT_MEMRESERVE = 260,
-    DT_LSHIFT = 261,
-    DT_RSHIFT = 262,
-    DT_LE = 263,
-    DT_GE = 264,
-    DT_EQ = 265,
-    DT_NE = 266,
-    DT_AND = 267,
-    DT_OR = 268,
-    DT_BITS = 269,
-    DT_DEL_PROP = 270,
-    DT_DEL_NODE = 271,
-    DT_PROPNODENAME = 272,
-    DT_LITERAL = 273,
-    DT_CHAR_LITERAL = 274,
-    DT_BYTE = 275,
-    DT_STRING = 276,
-    DT_LABEL = 277,
-    DT_REF = 278,
-    DT_INCBIN = 279
-  };
-#endif
-
-/* Value type.  */
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
-union YYSTYPE
-{
-#line 39 "dtc-parser.y" /* yacc.c:355  */
-
-	char *propnodename;
-	char *labelref;
-	uint8_t byte;
-	struct data data;
-
-	struct {
-		struct data	data;
-		int		bits;
-	} array;
-
-	struct property *prop;
-	struct property *proplist;
-	struct node *node;
-	struct node *nodelist;
-	struct reserve_info *re;
-	uint64_t integer;
-	unsigned int flags;
-
-#line 170 "dtc-parser.tab.c" /* yacc.c:355  */
-};
-
-typedef union YYSTYPE YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-/* Location type.  */
-#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
-typedef struct YYLTYPE YYLTYPE;
-struct YYLTYPE
-{
-  int first_line;
-  int first_column;
-  int last_line;
-  int last_column;
-};
-# define YYLTYPE_IS_DECLARED 1
-# define YYLTYPE_IS_TRIVIAL 1
-#endif
-
-
-extern YYSTYPE yylval;
-extern YYLTYPE yylloc;
-int yyparse (void);
-
-#endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED  */
-
-/* Copy the second part of user declarations.  */
-
-#line 201 "dtc-parser.tab.c" /* yacc.c:358  */
-
-#ifdef short
-# undef short
-#endif
-
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
-#endif
-
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#else
-typedef signed char yytype_int8;
-#endif
-
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
-#else
-typedef unsigned short int yytype_uint16;
-#endif
-
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
-#else
-typedef short int yytype_int16;
-#endif
-
-#ifndef YYSIZE_T
-# ifdef __SIZE_TYPE__
-#  define YYSIZE_T __SIZE_TYPE__
-# elif defined size_t
-#  define YYSIZE_T size_t
-# elif ! defined YYSIZE_T
-#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYSIZE_T size_t
-# else
-#  define YYSIZE_T unsigned int
-# endif
-#endif
-
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-
-#ifndef YY_
-# if defined YYENABLE_NLS && YYENABLE_NLS
-#  if ENABLE_NLS
-#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
-#  endif
-# endif
-# ifndef YY_
-#  define YY_(Msgid) Msgid
-# endif
-#endif
-
-#ifndef YY_ATTRIBUTE
-# if (defined __GNUC__                                               \
-      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
-     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
-#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
-# else
-#  define YY_ATTRIBUTE(Spec) /* empty */
-# endif
-#endif
-
-#ifndef YY_ATTRIBUTE_PURE
-# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
-#endif
-
-#ifndef YY_ATTRIBUTE_UNUSED
-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
-#endif
-
-#if !defined _Noreturn \
-     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-# if defined _MSC_VER && 1200 <= _MSC_VER
-#  define _Noreturn __declspec (noreturn)
-# else
-#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
-# endif
-#endif
-
-/* Suppress unused-variable warnings by "using" E.  */
-#if ! defined lint || defined __GNUC__
-# define YYUSE(E) ((void) (E))
-#else
-# define YYUSE(E) /* empty */
-#endif
-
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
-/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
-    _Pragma ("GCC diagnostic push") \
-    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
-    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
-    _Pragma ("GCC diagnostic pop")
-#else
-# define YY_INITIAL_VALUE(Value) Value
-#endif
-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END
-#endif
-#ifndef YY_INITIAL_VALUE
-# define YY_INITIAL_VALUE(Value) /* Nothing. */
-#endif
-
-
-#if ! defined yyoverflow || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols.  */
-
-# ifdef YYSTACK_USE_ALLOCA
-#  if YYSTACK_USE_ALLOCA
-#   ifdef __GNUC__
-#    define YYSTACK_ALLOC __builtin_alloca
-#   elif defined __BUILTIN_VA_ARG_INCR
-#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
-#   elif defined _AIX
-#    define YYSTACK_ALLOC __alloca
-#   elif defined _MSC_VER
-#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
-#    define alloca _alloca
-#   else
-#    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
-#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
-#     ifndef EXIT_SUCCESS
-#      define EXIT_SUCCESS 0
-#     endif
-#    endif
-#   endif
-#  endif
-# endif
-
-# ifdef YYSTACK_ALLOC
-   /* Pacify GCC's 'empty if-body' warning.  */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-#  ifndef YYSTACK_ALLOC_MAXIMUM
-    /* The OS might guarantee only one guard page at the bottom of the stack,
-       and a page size can be as small as 4096 bytes.  So we cannot safely
-       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
-       to allow for a few compiler-allocated temporary stack slots.  */
-#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
-#  endif
-# else
-#  define YYSTACK_ALLOC YYMALLOC
-#  define YYSTACK_FREE YYFREE
-#  ifndef YYSTACK_ALLOC_MAXIMUM
-#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
-#  endif
-#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
-       && ! ((defined YYMALLOC || defined malloc) \
-             && (defined YYFREE || defined free)))
-#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#   ifndef EXIT_SUCCESS
-#    define EXIT_SUCCESS 0
-#   endif
-#  endif
-#  ifndef YYMALLOC
-#   define YYMALLOC malloc
-#   if ! defined malloc && ! defined EXIT_SUCCESS
-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-#   endif
-#  endif
-#  ifndef YYFREE
-#   define YYFREE free
-#   if ! defined free && ! defined EXIT_SUCCESS
-void free (void *); /* INFRINGES ON USER NAME SPACE */
-#   endif
-#  endif
-# endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
-
-#if (! defined yyoverflow \
-     && (! defined __cplusplus \
-         || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
-             && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member.  */
-union yyalloc
-{
-  yytype_int16 yyss_alloc;
-  YYSTYPE yyvs_alloc;
-  YYLTYPE yyls_alloc;
-};
-
-/* The size of the maximum gap between one aligned stack and the next.  */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
-   N elements.  */
-# define YYSTACK_BYTES(N) \
-     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
-      + 2 * YYSTACK_GAP_MAXIMUM)
-
-# define YYCOPY_NEEDED 1
-
-/* Relocate STACK from its old location to the new one.  The
-   local variables YYSIZE and YYSTACKSIZE give the old and new number of
-   elements in the stack, and YYPTR gives the new location of the
-   stack.  Advance YYPTR to a properly aligned location for the next
-   stack.  */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
-    do                                                                  \
-      {                                                                 \
-        YYSIZE_T yynewbytes;                                            \
-        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
-        Stack = &yyptr->Stack_alloc;                                    \
-        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-        yyptr += yynewbytes / sizeof (*yyptr);                          \
-      }                                                                 \
-    while (0)
-
-#endif
-
-#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
-/* Copy COUNT objects from SRC to DST.  The source and destination do
-   not overlap.  */
-# ifndef YYCOPY
-#  if defined __GNUC__ && 1 < __GNUC__
-#   define YYCOPY(Dst, Src, Count) \
-      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
-#  else
-#   define YYCOPY(Dst, Src, Count)              \
-      do                                        \
-        {                                       \
-          YYSIZE_T yyi;                         \
-          for (yyi = 0; yyi < (Count); yyi++)   \
-            (Dst)[yyi] = (Src)[yyi];            \
-        }                                       \
-      while (0)
-#  endif
-# endif
-#endif /* !YYCOPY_NEEDED */
-
-/* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  6
-/* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   138
-
-/* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  48
-/* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  30
-/* YYNRULES -- Number of rules.  */
-#define YYNRULES  85
-/* YYNSTATES -- Number of states.  */
-#define YYNSTATES  149
-
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
-   by yylex, with out-of-bounds checking.  */
-#define YYUNDEFTOK  2
-#define YYMAXUTOK   279
-
-#define YYTRANSLATE(YYX)                                                \
-  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
-   as returned by yylex, without out-of-bounds checking.  */
-static const yytype_uint8 yytranslate[] =
-{
-       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,    47,     2,     2,     2,    45,    41,     2,
-      33,    35,    44,    42,    34,    43,     2,    26,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,    38,    25,
-      36,    29,    30,    37,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,    31,     2,    32,    40,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,    27,    39,    28,    46,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
-       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
-      15,    16,    17,    18,    19,    20,    21,    22,    23,    24
-};
-
-#if YYDEBUG
-  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
-static const yytype_uint16 yyrline[] =
-{
-       0,   109,   109,   117,   121,   128,   129,   139,   142,   149,
-     153,   161,   165,   170,   181,   200,   213,   220,   228,   231,
-     238,   242,   246,   250,   258,   262,   266,   270,   274,   290,
-     300,   308,   311,   315,   322,   338,   343,   362,   376,   383,
-     384,   385,   392,   396,   397,   401,   402,   406,   407,   411,
-     412,   416,   417,   421,   422,   426,   427,   428,   432,   433,
-     434,   435,   436,   440,   441,   442,   446,   447,   448,   452,
-     453,   462,   471,   475,   476,   477,   478,   483,   486,   490,
-     498,   501,   505,   513,   517,   521
-};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE || 0
-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting@YYNTOKENS, nonterminals.  */
-static const char *const yytname[] =
-{
-  "$end", "error", "$undefined", "DT_V1", "DT_PLUGIN", "DT_MEMRESERVE",
-  "DT_LSHIFT", "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND",
-  "DT_OR", "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME",
-  "DT_LITERAL", "DT_CHAR_LITERAL", "DT_BYTE", "DT_STRING", "DT_LABEL",
-  "DT_REF", "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['",
-  "']'", "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'",
-  "'+'", "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
-  "header", "headers", "memreserves", "memreserve", "devicetree",
-  "nodedef", "proplist", "propdef", "propdata", "propdataprefix",
-  "arrayprefix", "integer_prim", "integer_expr", "integer_trinary",
-  "integer_or", "integer_and", "integer_bitor", "integer_bitxor",
-  "integer_bitand", "integer_eq", "integer_rela", "integer_shift",
-  "integer_add", "integer_mul", "integer_unary", "bytestring", "subnodes",
-  "subnode", YY_NULLPTR
-};
-#endif
-
-# ifdef YYPRINT
-/* YYTOKNUM[NUM] -- (External) token number corresponding to the
-   (internal) symbol number NUM (which must be that of a token).  */
-static const yytype_uint16 yytoknum[] =
-{
-       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
-     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
-     275,   276,   277,   278,   279,    59,    47,   123,   125,    61,
-      62,    91,    93,    40,    44,    41,    60,    63,    58,   124,
-      94,    38,    43,    45,    42,    37,   126,    33
-};
-# endif
-
-#define YYPACT_NINF -44
-
-#define yypact_value_is_default(Yystate) \
-  (!!((Yystate) == (-44)))
-
-#define YYTABLE_NINF -1
-
-#define yytable_value_is_error(Yytable_value) \
-  0
-
-  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-     STATE-NUM.  */
-static const yytype_int8 yypact[] =
-{
-      14,    27,    61,    14,     8,    18,   -44,   -44,    37,     8,
-      40,     8,    64,   -44,   -44,   -12,    37,   -44,    50,    52,
-     -44,   -44,   -12,   -12,   -12,   -44,    51,   -44,    -4,    78,
-      53,    54,    55,    17,     2,    30,    38,    -3,   -44,    66,
-     -44,   -44,    70,    72,    50,    50,   -44,   -44,   -44,   -44,
-     -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,
-     -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -44,
-       3,    73,    50,   -44,   -44,    78,    59,    53,    54,    55,
-      17,     2,     2,    30,    30,    30,    30,    38,    38,    -3,
-      -3,   -44,   -44,   -44,    82,    83,    44,     3,   -44,    74,
-       3,   -44,   -44,   -12,    76,    79,   -44,   -44,   -44,   -44,
-     -44,    80,   -44,   -44,   -44,   -44,   -44,   -10,    36,   -44,
-     -44,   -44,   -44,    85,   -44,   -44,   -44,    75,   -44,   -44,
-      21,    71,    88,    -6,   -44,   -44,   -44,   -44,   -44,    11,
-     -44,   -44,   -44,    37,   -44,    77,    37,    81,   -44
-};
-
-  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
-     Performed when YYTABLE does not specify something else to do.  Zero
-     means the default is an error.  */
-static const yytype_uint8 yydefact[] =
-{
-       0,     0,     0,     5,     7,     3,     1,     6,     0,     0,
-      16,     7,     0,    39,    40,     0,     0,    10,     0,     2,
-       8,     4,     0,     0,     0,    73,     0,    42,    43,    45,
-      47,    49,    51,    53,    55,    58,    65,    68,    72,     0,
-      18,    11,     0,     0,     0,     0,    74,    75,    76,    41,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,     9,
-      80,     0,     0,    14,    12,    46,     0,    48,    50,    52,
-      54,    56,    57,    61,    62,    60,    59,    63,    64,    66,
-      67,    70,    69,    71,     0,     0,     0,     0,    19,     0,
-      80,    15,    13,     0,     0,     0,    21,    31,    83,    23,
-      85,     0,    82,    81,    44,    22,    84,     0,     0,    17,
-      30,    20,    32,     0,    24,    33,    27,     0,    77,    35,
-       0,     0,     0,     0,    38,    37,    25,    36,    34,     0,
-      78,    79,    26,     0,    29,     0,     0,     0,    28
-};
-
-  /* YYPGOTO[NTERM-NUM].  */
-static const yytype_int8 yypgoto[] =
-{
-     -44,   -44,   -44,   103,    99,   104,   -44,   -43,   -44,   -21,
-     -44,   -44,   -44,    -8,    63,     9,   -44,    65,    67,    68,
-      69,    62,    26,     4,    22,    23,   -19,   -44,    20,    28
-};
-
-  /* YYDEFGOTO[NTERM-NUM].  */
-static const yytype_int16 yydefgoto[] =
-{
-      -1,     2,     3,     4,    10,    11,    19,    41,    70,    98,
-     117,   118,   130,    25,    26,    27,    28,    29,    30,    31,
-      32,    33,    34,    35,    36,    37,    38,   133,    99,   100
-};
-
-  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
-     positive, shift that token.  If negative, reduce the rule whose
-     number is the opposite.  If YYTABLE_NINF, syntax error.  */
-static const yytype_uint8 yytable[] =
-{
-      16,    73,    74,    46,    47,    48,    13,    14,    39,    50,
-      58,    59,   120,     8,   140,   121,   141,     1,    94,    95,
-      96,    15,    12,    66,   122,    97,   142,    56,    57,   102,
-       9,    22,    60,    51,    23,    24,    62,    63,    61,    13,
-      14,    67,    68,   134,   135,   143,   144,    91,    92,    93,
-     123,   136,     5,   108,    15,    13,    14,   124,   125,   126,
-     127,     6,    83,    84,    85,    86,    18,   128,    42,   106,
-      15,    40,   129,   107,    43,    44,   109,    40,    45,   112,
-      64,    65,    81,    82,    87,    88,    49,    89,    90,    21,
-      52,    69,    53,    71,    54,    72,    55,   103,   101,   104,
-     105,   115,   111,   131,   116,   119,     7,   138,   132,   139,
-      20,   146,   114,    17,    76,    75,   148,    80,     0,    77,
-     113,    78,   137,    79,     0,   110,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,   145,     0,     0,   147
-};
-
-static const yytype_int16 yycheck[] =
-{
-       8,    44,    45,    22,    23,    24,    18,    19,    16,    13,
-       8,     9,    22,     5,    20,    25,    22,     3,    15,    16,
-      17,    33,     4,    26,    34,    22,    32,    10,    11,    72,
-      22,    43,    30,    37,    46,    47,     6,     7,    36,    18,
-      19,    44,    45,    22,    23,    34,    35,    66,    67,    68,
-      14,    30,    25,    96,    33,    18,    19,    21,    22,    23,
-      24,     0,    58,    59,    60,    61,    26,    31,    16,    25,
-      33,    27,    36,    29,    22,    23,    97,    27,    26,   100,
-      42,    43,    56,    57,    62,    63,    35,    64,    65,    25,
-      12,    25,    39,    23,    40,    23,    41,    38,    25,    17,
-      17,    25,    28,    18,    25,    25,     3,    36,    33,    21,
-      11,    34,   103,     9,    51,    50,    35,    55,    -1,    52,
-     100,    53,   130,    54,    -1,    97,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,   143,    -1,    -1,   146
-};
-
-  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-     symbol of state STATE-NUM.  */
-static const yytype_uint8 yystos[] =
-{
-       0,     3,    49,    50,    51,    25,     0,    51,     5,    22,
-      52,    53,     4,    18,    19,    33,    61,    53,    26,    54,
-      52,    25,    43,    46,    47,    61,    62,    63,    64,    65,
-      66,    67,    68,    69,    70,    71,    72,    73,    74,    61,
-      27,    55,    16,    22,    23,    26,    74,    74,    74,    35,
-      13,    37,    12,    39,    40,    41,    10,    11,     8,     9,
-      30,    36,     6,     7,    42,    43,    26,    44,    45,    25,
-      56,    23,    23,    55,    55,    65,    62,    66,    67,    68,
-      69,    70,    70,    71,    71,    71,    71,    72,    72,    73,
-      73,    74,    74,    74,    15,    16,    17,    22,    57,    76,
-      77,    25,    55,    38,    17,    17,    25,    29,    55,    57,
-      77,    28,    57,    76,    63,    25,    25,    58,    59,    25,
-      22,    25,    34,    14,    21,    22,    23,    24,    31,    36,
-      60,    18,    33,    75,    22,    23,    30,    61,    36,    21,
-      20,    22,    32,    34,    35,    61,    34,    61,    35
-};
-
-  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const yytype_uint8 yyr1[] =
-{
-       0,    48,    49,    50,    50,    51,    51,    52,    52,    53,
-      53,    54,    54,    54,    54,    54,    54,    55,    56,    56,
-      57,    57,    57,    57,    58,    58,    58,    58,    58,    58,
-      58,    59,    59,    59,    60,    60,    60,    60,    60,    61,
-      61,    61,    62,    63,    63,    64,    64,    65,    65,    66,
-      66,    67,    67,    68,    68,    69,    69,    69,    70,    70,
-      70,    70,    70,    71,    71,    71,    72,    72,    72,    73,
-      73,    73,    73,    74,    74,    74,    74,    75,    75,    75,
-      76,    76,    76,    77,    77,    77
-};
-
-  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
-static const yytype_uint8 yyr2[] =
-{
-       0,     2,     3,     2,     4,     1,     2,     0,     2,     4,
-       2,     2,     3,     4,     3,     4,     0,     5,     0,     2,
-       4,     2,     3,     2,     2,     3,     4,     2,     9,     5,
-       2,     0,     2,     2,     3,     1,     2,     2,     2,     1,
-       1,     3,     1,     1,     5,     1,     3,     1,     3,     1,
-       3,     1,     3,     1,     3,     1,     3,     3,     1,     3,
-       3,     3,     3,     3,     3,     1,     3,     3,     1,     3,
-       3,     3,     1,     1,     2,     2,     2,     0,     2,     2,
-       0,     2,     2,     2,     3,     2
-};
-
-
-#define yyerrok         (yyerrstatus = 0)
-#define yyclearin       (yychar = YYEMPTY)
-#define YYEMPTY         (-2)
-#define YYEOF           0
-
-#define YYACCEPT        goto yyacceptlab
-#define YYABORT         goto yyabortlab
-#define YYERROR         goto yyerrorlab
-
-
-#define YYRECOVERING()  (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value)                                  \
-do                                                              \
-  if (yychar == YYEMPTY)                                        \
-    {                                                           \
-      yychar = (Token);                                         \
-      yylval = (Value);                                         \
-      YYPOPSTACK (yylen);                                       \
-      yystate = *yyssp;                                         \
-      goto yybackup;                                            \
-    }                                                           \
-  else                                                          \
-    {                                                           \
-      yyerror (YY_("syntax error: cannot back up")); \
-      YYERROR;                                                  \
-    }                                                           \
-while (0)
-
-/* Error token number */
-#define YYTERROR        1
-#define YYERRCODE       256
-
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
-   If N is 0, then set CURRENT to the empty location which ends
-   the previous symbol: RHS[0] (always defined).  */
-
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
-    do                                                                  \
-      if (N)                                                            \
-        {                                                               \
-          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
-          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
-          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
-          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
-        }                                                               \
-      else                                                              \
-        {                                                               \
-          (Current).first_line   = (Current).last_line   =              \
-            YYRHSLOC (Rhs, 0).last_line;                                \
-          (Current).first_column = (Current).last_column =              \
-            YYRHSLOC (Rhs, 0).last_column;                              \
-        }                                                               \
-    while (0)
-#endif
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-
-
-/* Enable debugging if requested.  */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args)                        \
-do {                                            \
-  if (yydebug)                                  \
-    YYFPRINTF Args;                             \
-} while (0)
-
-
-/* YY_LOCATION_PRINT -- Print the location on the stream.
-   This macro was not mandated originally: define only if we know
-   we won't break user code: when these are the locations we know.  */
-
-#ifndef YY_LOCATION_PRINT
-# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
-
-/* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
-
-YY_ATTRIBUTE_UNUSED
-static unsigned
-yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
-{
-  unsigned res = 0;
-  int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
-  if (0 <= yylocp->first_line)
-    {
-      res += YYFPRINTF (yyo, "%d", yylocp->first_line);
-      if (0 <= yylocp->first_column)
-        res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
-    }
-  if (0 <= yylocp->last_line)
-    {
-      if (yylocp->first_line < yylocp->last_line)
-        {
-          res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
-          if (0 <= end_col)
-            res += YYFPRINTF (yyo, ".%d", end_col);
-        }
-      else if (0 <= end_col && yylocp->first_column < end_col)
-        res += YYFPRINTF (yyo, "-%d", end_col);
-    }
-  return res;
- }
-
-#  define YY_LOCATION_PRINT(File, Loc)          \
-  yy_location_print_ (File, &(Loc))
-
-# else
-#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
-#endif
-
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
-do {                                                                      \
-  if (yydebug)                                                            \
-    {                                                                     \
-      YYFPRINTF (stderr, "%s ", Title);                                   \
-      yy_symbol_print (stderr,                                            \
-                  Type, Value, Location); \
-      YYFPRINTF (stderr, "\n");                                           \
-    }                                                                     \
-} while (0)
-
-
-/*----------------------------------------.
-| Print this symbol's value on YYOUTPUT.  |
-`----------------------------------------*/
-
-static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
-{
-  FILE *yyo = yyoutput;
-  YYUSE (yyo);
-  YYUSE (yylocationp);
-  if (!yyvaluep)
-    return;
-# ifdef YYPRINT
-  if (yytype < YYNTOKENS)
-    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
-  YYUSE (yytype);
-}
-
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
-{
-  YYFPRINTF (yyoutput, "%s %s (",
-             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
-
-  YY_LOCATION_PRINT (yyoutput, *yylocationp);
-  YYFPRINTF (yyoutput, ": ");
-  yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
-  YYFPRINTF (yyoutput, ")");
-}
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included).                                                   |
-`------------------------------------------------------------------*/
-
-static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
-{
-  YYFPRINTF (stderr, "Stack now");
-  for (; yybottom <= yytop; yybottom++)
-    {
-      int yybot = *yybottom;
-      YYFPRINTF (stderr, " %d", yybot);
-    }
-  YYFPRINTF (stderr, "\n");
-}
-
-# define YY_STACK_PRINT(Bottom, Top)                            \
-do {                                                            \
-  if (yydebug)                                                  \
-    yy_stack_print ((Bottom), (Top));                           \
-} while (0)
-
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced.  |
-`------------------------------------------------*/
-
-static void
-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
-{
-  unsigned long int yylno = yyrline[yyrule];
-  int yynrhs = yyr2[yyrule];
-  int yyi;
-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
-             yyrule - 1, yylno);
-  /* The symbols being reduced.  */
-  for (yyi = 0; yyi < yynrhs; yyi++)
-    {
-      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
-      yy_symbol_print (stderr,
-                       yystos[yyssp[yyi + 1 - yynrhs]],
-                       &(yyvsp[(yyi + 1) - (yynrhs)])
-                       , &(yylsp[(yyi + 1) - (yynrhs)])                       );
-      YYFPRINTF (stderr, "\n");
-    }
-}
-
-# define YY_REDUCE_PRINT(Rule)          \
-do {                                    \
-  if (yydebug)                          \
-    yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
-} while (0)
-
-/* Nonzero means print parse trace.  It is left uninitialized so that
-   multiple parsers can coexist.  */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-
-/* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
-   if the built-in stack extension method is used).
-
-   Do not make this value too large; the results are undefined if
-   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
-   evaluated with infinite-precision integer arithmetic.  */
-
-#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
-#endif
-
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-#  if defined __GLIBC__ && defined _STRING_H
-#   define yystrlen strlen
-#  else
-/* Return the length of YYSTR.  */
-static YYSIZE_T
-yystrlen (const char *yystr)
-{
-  YYSIZE_T yylen;
-  for (yylen = 0; yystr[yylen]; yylen++)
-    continue;
-  return yylen;
-}
-#  endif
-# endif
-
-# ifndef yystpcpy
-#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-#   define yystpcpy stpcpy
-#  else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
-   YYDEST.  */
-static char *
-yystpcpy (char *yydest, const char *yysrc)
-{
-  char *yyd = yydest;
-  const char *yys = yysrc;
-
-  while ((*yyd++ = *yys++) != '\0')
-    continue;
-
-  return yyd - 1;
-}
-#  endif
-# endif
-
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
-   quotes and backslashes, so that it's suitable for yyerror.  The
-   heuristic is that double-quoting is unnecessary unless the string
-   contains an apostrophe, a comma, or backslash (other than
-   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
-   null, do not copy; instead, return the length of what the result
-   would have been.  */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
-  if (*yystr == '"')
-    {
-      YYSIZE_T yyn = 0;
-      char const *yyp = yystr;
-
-      for (;;)
-        switch (*++yyp)
-          {
-          case '\'':
-          case ',':
-            goto do_not_strip_quotes;
-
-          case '\\':
-            if (*++yyp != '\\')
-              goto do_not_strip_quotes;
-            /* Fall through.  */
-          default:
-            if (yyres)
-              yyres[yyn] = *yyp;
-            yyn++;
-            break;
-
-          case '"':
-            if (yyres)
-              yyres[yyn] = '\0';
-            return yyn;
-          }
-    do_not_strip_quotes: ;
-    }
-
-  if (! yyres)
-    return yystrlen (yystr);
-
-  return yystpcpy (yyres, yystr) - yyres;
-}
-# endif
-
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
-   about the unexpected token YYTOKEN for the state stack whose top is
-   YYSSP.
-
-   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
-   not large enough to hold the message.  In that case, also set
-   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
-   required number of bytes is too large to store.  */
-static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
-                yytype_int16 *yyssp, int yytoken)
-{
-  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
-  YYSIZE_T yysize = yysize0;
-  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
-  /* Internationalized format string. */
-  const char *yyformat = YY_NULLPTR;
-  /* Arguments of yyformat. */
-  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-  /* Number of reported tokens (one for the "unexpected", one per
-     "expected"). */
-  int yycount = 0;
-
-  /* There are many possibilities here to consider:
-     - If this state is a consistent state with a default action, then
-       the only way this function was invoked is if the default action
-       is an error action.  In that case, don't check for expected
-       tokens because there are none.
-     - The only way there can be no lookahead present (in yychar) is if
-       this state is a consistent state with a default action.  Thus,
-       detecting the absence of a lookahead is sufficient to determine
-       that there is no unexpected or expected token to report.  In that
-       case, just report a simple "syntax error".
-     - Don't assume there isn't a lookahead just because this state is a
-       consistent state with a default action.  There might have been a
-       previous inconsistent state, consistent state with a non-default
-       action, or user semantic action that manipulated yychar.
-     - Of course, the expected token list depends on states to have
-       correct lookahead information, and it depends on the parser not
-       to perform extra reductions after fetching a lookahead from the
-       scanner and before detecting a syntax error.  Thus, state merging
-       (from LALR or IELR) and default reductions corrupt the expected
-       token list.  However, the list is correct for canonical LR with
-       one exception: it will still contain any token that will not be
-       accepted due to an error action in a later state.
-  */
-  if (yytoken != YYEMPTY)
-    {
-      int yyn = yypact[*yyssp];
-      yyarg[yycount++] = yytname[yytoken];
-      if (!yypact_value_is_default (yyn))
-        {
-          /* Start YYX@-YYN if negative to avoid negative indexes in
-             YYCHECK.  In other words, skip the first -YYN actions for
-             this state because they are default actions.  */
-          int yyxbegin = yyn < 0 ? -yyn : 0;
-          /* Stay within bounds of both yycheck and yytname.  */
-          int yychecklim = YYLAST - yyn + 1;
-          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-          int yyx;
-
-          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
-                && !yytable_value_is_error (yytable[yyx + yyn]))
-              {
-                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-                  {
-                    yycount = 1;
-                    yysize = yysize0;
-                    break;
-                  }
-                yyarg[yycount++] = yytname[yyx];
-                {
-                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
-                  if (! (yysize <= yysize1
-                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-                    return 2;
-                  yysize = yysize1;
-                }
-              }
-        }
-    }
-
-  switch (yycount)
-    {
-# define YYCASE_(N, S)                      \
-      case N:                               \
-        yyformat = S;                       \
-      break
-      YYCASE_(0, YY_("syntax error"));
-      YYCASE_(1, YY_("syntax error, unexpected %s"));
-      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
-      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
-      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
-      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-# undef YYCASE_
-    }
-
-  {
-    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
-    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-      return 2;
-    yysize = yysize1;
-  }
-
-  if (*yymsg_alloc < yysize)
-    {
-      *yymsg_alloc = 2 * yysize;
-      if (! (yysize <= *yymsg_alloc
-             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
-        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
-      return 1;
-    }
-
-  /* Avoid sprintf, as that infringes on the user's name space.
-     Don't have undefined behavior even if the translation
-     produced a string with the wrong number of "%s"s.  */
-  {
-    char *yyp = *yymsg;
-    int yyi = 0;
-    while ((*yyp = *yyformat) != '\0')
-      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
-        {
-          yyp += yytnamerr (yyp, yyarg[yyi++]);
-          yyformat += 2;
-        }
-      else
-        {
-          yyp++;
-          yyformat++;
-        }
-  }
-  return 0;
-}
-#endif /* YYERROR_VERBOSE */
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol.  |
-`-----------------------------------------------*/
-
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
-{
-  YYUSE (yyvaluep);
-  YYUSE (yylocationp);
-  if (!yymsg)
-    yymsg = "Deleting";
-  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
-  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-  YYUSE (yytype);
-  YY_IGNORE_MAYBE_UNINITIALIZED_END
-}
-
-
-
-
-/* The lookahead symbol.  */
-int yychar;
-
-/* The semantic value of the lookahead symbol.  */
-YYSTYPE yylval;
-/* Location data for the lookahead symbol.  */
-YYLTYPE yylloc
-# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
-  = { 1, 1, 1, 1 }
-# endif
-;
-/* Number of syntax errors so far.  */
-int yynerrs;
-
-
-/*----------.
-| yyparse.  |
-`----------*/
-
-int
-yyparse (void)
-{
-    int yystate;
-    /* Number of tokens to shift before error messages enabled.  */
-    int yyerrstatus;
-
-    /* The stacks and their tools:
-       'yyss': related to states.
-       'yyvs': related to semantic values.
-       'yyls': related to locations.
-
-       Refer to the stacks through separate pointers, to allow yyoverflow
-       to reallocate them elsewhere.  */
-
-    /* The state stack.  */
-    yytype_int16 yyssa[YYINITDEPTH];
-    yytype_int16 *yyss;
-    yytype_int16 *yyssp;
-
-    /* The semantic value stack.  */
-    YYSTYPE yyvsa[YYINITDEPTH];
-    YYSTYPE *yyvs;
-    YYSTYPE *yyvsp;
-
-    /* The location stack.  */
-    YYLTYPE yylsa[YYINITDEPTH];
-    YYLTYPE *yyls;
-    YYLTYPE *yylsp;
-
-    /* The locations where the error started and ended.  */
-    YYLTYPE yyerror_range[3];
-
-    YYSIZE_T yystacksize;
-
-  int yyn;
-  int yyresult;
-  /* Lookahead token as an internal (translated) token number.  */
-  int yytoken = 0;
-  /* The variables used to return semantic value and location from the
-     action routines.  */
-  YYSTYPE yyval;
-  YYLTYPE yyloc;
-
-#if YYERROR_VERBOSE
-  /* Buffer for error messages, and its allocated size.  */
-  char yymsgbuf[128];
-  char *yymsg = yymsgbuf;
-  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
-#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
-
-  /* The number of symbols on the RHS of the reduced rule.
-     Keep to zero when no symbol should be popped.  */
-  int yylen = 0;
-
-  yyssp = yyss = yyssa;
-  yyvsp = yyvs = yyvsa;
-  yylsp = yyls = yylsa;
-  yystacksize = YYINITDEPTH;
-
-  YYDPRINTF ((stderr, "Starting parse\n"));
-
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY; /* Cause a token to be read.  */
-  yylsp[0] = yylloc;
-  goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate.  |
-`------------------------------------------------------------*/
- yynewstate:
-  /* In all cases, when you get here, the value and location stacks
-     have just been pushed.  So pushing a state here evens the stacks.  */
-  yyssp++;
-
- yysetstate:
-  *yyssp = yystate;
-
-  if (yyss + yystacksize - 1 <= yyssp)
-    {
-      /* Get the current used size of the three stacks, in elements.  */
-      YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-      {
-        /* Give user a chance to reallocate the stack.  Use copies of
-           these so that the &'s don't force the real ones into
-           memory.  */
-        YYSTYPE *yyvs1 = yyvs;
-        yytype_int16 *yyss1 = yyss;
-        YYLTYPE *yyls1 = yyls;
-
-        /* Each stack pointer address is followed by the size of the
-           data in use in that stack, in bytes.  This used to be a
-           conditional around just the two extra args, but that might
-           be undefined if yyoverflow is a macro.  */
-        yyoverflow (YY_("memory exhausted"),
-                    &yyss1, yysize * sizeof (*yyssp),
-                    &yyvs1, yysize * sizeof (*yyvsp),
-                    &yyls1, yysize * sizeof (*yylsp),
-                    &yystacksize);
-
-        yyls = yyls1;
-        yyss = yyss1;
-        yyvs = yyvs1;
-      }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
-      goto yyexhaustedlab;
-# else
-      /* Extend the stack our own way.  */
-      if (YYMAXDEPTH <= yystacksize)
-        goto yyexhaustedlab;
-      yystacksize *= 2;
-      if (YYMAXDEPTH < yystacksize)
-        yystacksize = YYMAXDEPTH;
-
-      {
-        yytype_int16 *yyss1 = yyss;
-        union yyalloc *yyptr =
-          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
-        if (! yyptr)
-          goto yyexhaustedlab;
-        YYSTACK_RELOCATE (yyss_alloc, yyss);
-        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
-        YYSTACK_RELOCATE (yyls_alloc, yyls);
-#  undef YYSTACK_RELOCATE
-        if (yyss1 != yyssa)
-          YYSTACK_FREE (yyss1);
-      }
-# endif
-#endif /* no yyoverflow */
-
-      yyssp = yyss + yysize - 1;
-      yyvsp = yyvs + yysize - 1;
-      yylsp = yyls + yysize - 1;
-
-      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-                  (unsigned long int) yystacksize));
-
-      if (yyss + yystacksize - 1 <= yyssp)
-        YYABORT;
-    }
-
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
-  if (yystate == YYFINAL)
-    YYACCEPT;
-
-  goto yybackup;
-
-/*-----------.
-| yybackup.  |
-`-----------*/
-yybackup:
-
-  /* Do appropriate processing given the current state.  Read a
-     lookahead token if we need one and don't already have one.  */
-
-  /* First try to decide what to do without reference to lookahead token.  */
-  yyn = yypact[yystate];
-  if (yypact_value_is_default (yyn))
-    goto yydefault;
-
-  /* Not known => get a lookahead token if don't already have one.  */
-
-  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
-  if (yychar == YYEMPTY)
-    {
-      YYDPRINTF ((stderr, "Reading a token: "));
-      yychar = yylex ();
-    }
-
-  if (yychar <= YYEOF)
-    {
-      yychar = yytoken = YYEOF;
-      YYDPRINTF ((stderr, "Now@end of input.\n"));
-    }
-  else
-    {
-      yytoken = YYTRANSLATE (yychar);
-      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
-    }
-
-  /* If the proper action on seeing token YYTOKEN is to reduce or to
-     detect an error, take that action.  */
-  yyn += yytoken;
-  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
-    goto yydefault;
-  yyn = yytable[yyn];
-  if (yyn <= 0)
-    {
-      if (yytable_value_is_error (yyn))
-        goto yyerrlab;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-
-  /* Count tokens shifted since error; after three, turn off error
-     status.  */
-  if (yyerrstatus)
-    yyerrstatus--;
-
-  /* Shift the lookahead token.  */
-  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
-  /* Discard the shifted token.  */
-  yychar = YYEMPTY;
-
-  yystate = yyn;
-  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-  *++yyvsp = yylval;
-  YY_IGNORE_MAYBE_UNINITIALIZED_END
-  *++yylsp = yylloc;
-  goto yynewstate;
-
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state.  |
-`-----------------------------------------------------------*/
-yydefault:
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-  goto yyreduce;
-
-
-/*-----------------------------.
-| yyreduce -- Do a reduction.  |
-`-----------------------------*/
-yyreduce:
-  /* yyn is the number of a rule to reduce with.  */
-  yylen = yyr2[yyn];
-
-  /* If YYLEN is nonzero, implement the default value of the action:
-     '$$ = $1'.
-
-     Otherwise, the following line sets YYVAL to garbage.
-     This behavior is undocumented and Bison
-     users should not rely upon it.  Assigning to YYVAL
-     unconditionally makes the parser a bit smaller, and it avoids a
-     GCC warning that YYVAL may be used uninitialized.  */
-  yyval = yyvsp[1-yylen];
-
-  /* Default location.  */
-  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
-  YY_REDUCE_PRINT (yyn);
-  switch (yyn)
-    {
-        case 2:
-#line 110 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			parser_output = build_dt_info((yyvsp[-2].flags), (yyvsp[-1].re), (yyvsp[0].node),
-			                              guess_boot_cpuid((yyvsp[0].node)));
-		}
-#line 1478 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 3:
-#line 118 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.flags) = DTSF_V1;
-		}
-#line 1486 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 4:
-#line 122 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.flags) = DTSF_V1 | DTSF_PLUGIN;
-		}
-#line 1494 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 6:
-#line 130 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			if ((yyvsp[0].flags) != (yyvsp[-1].flags))
-				ERROR(&(yylsp[0]), "Header flags don't match earlier ones");
-			(yyval.flags) = (yyvsp[-1].flags);
-		}
-#line 1504 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 7:
-#line 139 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.re) = NULL;
-		}
-#line 1512 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 8:
-#line 143 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
-		}
-#line 1520 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 9:
-#line 150 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
-		}
-#line 1528 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 10:
-#line 154 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			add_label(&(yyvsp[0].re)->labels, (yyvsp[-1].labelref));
-			(yyval.re) = (yyvsp[0].re);
-		}
-#line 1537 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 11:
-#line 162 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.node) = name_node((yyvsp[0].node), "");
-		}
-#line 1545 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 12:
-#line 166 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.node) = merge_nodes((yyvsp[-2].node), (yyvsp[0].node));
-		}
-#line 1553 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 13:
-#line 171 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
-
-			if (target) {
-				add_label(&target->labels, (yyvsp[-2].labelref));
-				merge_nodes(target, (yyvsp[0].node));
-			} else
-				ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
-			(yyval.node) = (yyvsp[-3].node);
-		}
-#line 1568 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 14:
-#line 182 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			struct node *target = get_node_by_ref((yyvsp[-2].node), (yyvsp[-1].labelref));
-
-			if (target) {
-				merge_nodes(target, (yyvsp[0].node));
-			} else {
-				/*
-				 * We rely on the rule being always:
-				 *   versioninfo plugindecl memreserves devicetree
-				 * so $-1 is what we want (plugindecl)
-				 */
-				if ((yyvsp[(-1) - (3)].flags) & DTSF_PLUGIN)
-					add_orphan_node((yyvsp[-2].node), (yyvsp[0].node), (yyvsp[-1].labelref));
-				else
-					ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
-			}
-			(yyval.node) = (yyvsp[-2].node);
-		}
-#line 1591 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 15:
-#line 201 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
-
-			if (target)
-				delete_node(target);
-			else
-				ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
-
-
-			(yyval.node) = (yyvsp[-3].node);
-		}
-#line 1607 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 16:
-#line 213 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			/* build empty node */
-			(yyval.node) = name_node(build_node(NULL, NULL), "");
-		}
-#line 1616 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 17:
-#line 221 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.node) = build_node((yyvsp[-3].proplist), (yyvsp[-2].nodelist));
-		}
-#line 1624 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 18:
-#line 228 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.proplist) = NULL;
-		}
-#line 1632 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 19:
-#line 232 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.proplist) = chain_property((yyvsp[0].prop), (yyvsp[-1].proplist));
-		}
-#line 1640 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 20:
-#line 239 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.prop) = build_property((yyvsp[-3].propnodename), (yyvsp[-1].data));
-		}
-#line 1648 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 21:
-#line 243 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.prop) = build_property((yyvsp[-1].propnodename), empty_data);
-		}
-#line 1656 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 22:
-#line 247 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.prop) = build_property_delete((yyvsp[-1].propnodename));
-		}
-#line 1664 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 23:
-#line 251 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			add_label(&(yyvsp[0].prop)->labels, (yyvsp[-1].labelref));
-			(yyval.prop) = (yyvsp[0].prop);
-		}
-#line 1673 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 24:
-#line 259 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.data) = data_merge((yyvsp[-1].data), (yyvsp[0].data));
-		}
-#line 1681 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 25:
-#line 263 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.data) = data_merge((yyvsp[-2].data), (yyvsp[-1].array).data);
-		}
-#line 1689 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 26:
-#line 267 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.data) = data_merge((yyvsp[-3].data), (yyvsp[-1].data));
-		}
-#line 1697 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 27:
-#line 271 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.data) = data_add_marker((yyvsp[-1].data), REF_PATH, (yyvsp[0].labelref));
-		}
-#line 1705 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 28:
-#line 275 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			FILE *f = srcfile_relative_open((yyvsp[-5].data).val, NULL);
-			struct data d;
-
-			if ((yyvsp[-3].integer) != 0)
-				if (fseek(f, (yyvsp[-3].integer), SEEK_SET) != 0)
-					die("Couldn't seek to offset %llu in \"%s\": %s",
-					    (unsigned long long)(yyvsp[-3].integer), (yyvsp[-5].data).val,
-					    strerror(errno));
-
-			d = data_copy_file(f, (yyvsp[-1].integer));
-
-			(yyval.data) = data_merge((yyvsp[-8].data), d);
-			fclose(f);
-		}
-#line 1725 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 29:
-#line 291 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			FILE *f = srcfile_relative_open((yyvsp[-1].data).val, NULL);
-			struct data d = empty_data;
-
-			d = data_copy_file(f, -1);
-
-			(yyval.data) = data_merge((yyvsp[-4].data), d);
-			fclose(f);
-		}
-#line 1739 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 30:
-#line 301 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
-		}
-#line 1747 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 31:
-#line 308 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.data) = empty_data;
-		}
-#line 1755 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 32:
-#line 312 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.data) = (yyvsp[-1].data);
-		}
-#line 1763 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 33:
-#line 316 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
-		}
-#line 1771 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 34:
-#line 323 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			unsigned long long bits;
-
-			bits = (yyvsp[-1].integer);
-
-			if ((bits !=  8) && (bits != 16) &&
-			    (bits != 32) && (bits != 64)) {
-				ERROR(&(yylsp[-1]), "Array elements must be"
-				      " 8, 16, 32 or 64-bits");
-				bits = 32;
-			}
-
-			(yyval.array).data = empty_data;
-			(yyval.array).bits = bits;
-		}
-#line 1791 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 35:
-#line 339 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.array).data = empty_data;
-			(yyval.array).bits = 32;
-		}
-#line 1800 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 36:
-#line 344 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			if ((yyvsp[-1].array).bits < 64) {
-				uint64_t mask = (1ULL << (yyvsp[-1].array).bits) - 1;
-				/*
-				 * Bits above mask must either be all zero
-				 * (positive within range of mask) or all one
-				 * (negative and sign-extended). The second
-				 * condition is true if when we set all bits
-				 * within the mask to one (i.e. | in the
-				 * mask), all bits are one.
-				 */
-				if (((yyvsp[0].integer) > mask) && (((yyvsp[0].integer) | mask) != -1ULL))
-					ERROR(&(yylsp[0]), "Value out of range for"
-					      " %d-bit array element", (yyvsp[-1].array).bits);
-			}
-
-			(yyval.array).data = data_append_integer((yyvsp[-1].array).data, (yyvsp[0].integer), (yyvsp[-1].array).bits);
-		}
-#line 1823 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 37:
-#line 363 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			uint64_t val = ~0ULL >> (64 - (yyvsp[-1].array).bits);
-
-			if ((yyvsp[-1].array).bits == 32)
-				(yyvsp[-1].array).data = data_add_marker((yyvsp[-1].array).data,
-							  REF_PHANDLE,
-							  (yyvsp[0].labelref));
-			else
-				ERROR(&(yylsp[0]), "References are only allowed in "
-					    "arrays with 32-bit elements.");
-
-			(yyval.array).data = data_append_integer((yyvsp[-1].array).data, val, (yyvsp[-1].array).bits);
-		}
-#line 1841 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 38:
-#line 377 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.array).data = data_add_marker((yyvsp[-1].array).data, LABEL, (yyvsp[0].labelref));
-		}
-#line 1849 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 41:
-#line 386 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.integer) = (yyvsp[-1].integer);
-		}
-#line 1857 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 44:
-#line 397 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-4].integer) ? (yyvsp[-2].integer) : (yyvsp[0].integer); }
-#line 1863 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 46:
-#line 402 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) || (yyvsp[0].integer); }
-#line 1869 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 48:
-#line 407 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) && (yyvsp[0].integer); }
-#line 1875 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 50:
-#line 412 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) | (yyvsp[0].integer); }
-#line 1881 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 52:
-#line 417 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) ^ (yyvsp[0].integer); }
-#line 1887 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 54:
-#line 422 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) & (yyvsp[0].integer); }
-#line 1893 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 56:
-#line 427 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) == (yyvsp[0].integer); }
-#line 1899 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 57:
-#line 428 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) != (yyvsp[0].integer); }
-#line 1905 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 59:
-#line 433 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) < (yyvsp[0].integer); }
-#line 1911 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 60:
-#line 434 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) > (yyvsp[0].integer); }
-#line 1917 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 61:
-#line 435 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) <= (yyvsp[0].integer); }
-#line 1923 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 62:
-#line 436 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) >= (yyvsp[0].integer); }
-#line 1929 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 63:
-#line 440 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) << (yyvsp[0].integer); }
-#line 1935 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 64:
-#line 441 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) >> (yyvsp[0].integer); }
-#line 1941 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 66:
-#line 446 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) + (yyvsp[0].integer); }
-#line 1947 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 67:
-#line 447 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) - (yyvsp[0].integer); }
-#line 1953 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 69:
-#line 452 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = (yyvsp[-2].integer) * (yyvsp[0].integer); }
-#line 1959 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 70:
-#line 454 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			if ((yyvsp[0].integer) != 0) {
-				(yyval.integer) = (yyvsp[-2].integer) / (yyvsp[0].integer);
-			} else {
-				ERROR(&(yyloc), "Division by zero");
-				(yyval.integer) = 0;
-			}
-		}
-#line 1972 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 71:
-#line 463 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			if ((yyvsp[0].integer) != 0) {
-				(yyval.integer) = (yyvsp[-2].integer) % (yyvsp[0].integer);
-			} else {
-				ERROR(&(yyloc), "Division by zero");
-				(yyval.integer) = 0;
-			}
-		}
-#line 1985 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 74:
-#line 476 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = -(yyvsp[0].integer); }
-#line 1991 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 75:
-#line 477 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = ~(yyvsp[0].integer); }
-#line 1997 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 76:
-#line 478 "dtc-parser.y" /* yacc.c:1646  */
-    { (yyval.integer) = !(yyvsp[0].integer); }
-#line 2003 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 77:
-#line 483 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.data) = empty_data;
-		}
-#line 2011 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 78:
-#line 487 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.data) = data_append_byte((yyvsp[-1].data), (yyvsp[0].byte));
-		}
-#line 2019 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 79:
-#line 491 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
-		}
-#line 2027 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 80:
-#line 498 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.nodelist) = NULL;
-		}
-#line 2035 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 81:
-#line 502 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.nodelist) = chain_node((yyvsp[-1].node), (yyvsp[0].nodelist));
-		}
-#line 2043 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 82:
-#line 506 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			ERROR(&(yylsp[0]), "Properties must precede subnodes");
-			YYERROR;
-		}
-#line 2052 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 83:
-#line 514 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.node) = name_node((yyvsp[0].node), (yyvsp[-1].propnodename));
-		}
-#line 2060 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 84:
-#line 518 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			(yyval.node) = name_node(build_node_delete(), (yyvsp[-1].propnodename));
-		}
-#line 2068 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-  case 85:
-#line 522 "dtc-parser.y" /* yacc.c:1646  */
-    {
-			add_label(&(yyvsp[0].node)->labels, (yyvsp[-1].labelref));
-			(yyval.node) = (yyvsp[0].node);
-		}
-#line 2077 "dtc-parser.tab.c" /* yacc.c:1646  */
-    break;
-
-
-#line 2081 "dtc-parser.tab.c" /* yacc.c:1646  */
-      default: break;
-    }
-  /* User semantic actions sometimes alter yychar, and that requires
-     that yytoken be updated with the new translation.  We take the
-     approach of translating immediately before every use of yytoken.
-     One alternative is translating here after every semantic action,
-     but that translation would be missed if the semantic action invokes
-     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
-     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
-     incorrect destructor might then be invoked immediately.  In the
-     case of YYERROR or YYBACKUP, subsequent parser actions might lead
-     to an incorrect destructor call or verbose syntax error message
-     before the lookahead is translated.  */
-  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-
-  YYPOPSTACK (yylen);
-  yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
-
-  *++yyvsp = yyval;
-  *++yylsp = yyloc;
-
-  /* Now 'shift' the result of the reduction.  Determine what state
-     that goes to, based on the state we popped back to and the rule
-     number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
-  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTOKENS];
-
-  goto yynewstate;
-
-
-/*--------------------------------------.
-| yyerrlab -- here on detecting error.  |
-`--------------------------------------*/
-yyerrlab:
-  /* Make sure we have latest lookahead translation.  See comments at
-     user semantic actions for why this is necessary.  */
-  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
-
-  /* If not already recovering from an error, report this error.  */
-  if (!yyerrstatus)
-    {
-      ++yynerrs;
-#if ! YYERROR_VERBOSE
-      yyerror (YY_("syntax error"));
-#else
-# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
-                                        yyssp, yytoken)
-      {
-        char const *yymsgp = YY_("syntax error");
-        int yysyntax_error_status;
-        yysyntax_error_status = YYSYNTAX_ERROR;
-        if (yysyntax_error_status == 0)
-          yymsgp = yymsg;
-        else if (yysyntax_error_status == 1)
-          {
-            if (yymsg != yymsgbuf)
-              YYSTACK_FREE (yymsg);
-            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
-            if (!yymsg)
-              {
-                yymsg = yymsgbuf;
-                yymsg_alloc = sizeof yymsgbuf;
-                yysyntax_error_status = 2;
-              }
-            else
-              {
-                yysyntax_error_status = YYSYNTAX_ERROR;
-                yymsgp = yymsg;
-              }
-          }
-        yyerror (yymsgp);
-        if (yysyntax_error_status == 2)
-          goto yyexhaustedlab;
-      }
-# undef YYSYNTAX_ERROR
-#endif
-    }
-
-  yyerror_range[1] = yylloc;
-
-  if (yyerrstatus == 3)
-    {
-      /* If just tried and failed to reuse lookahead token after an
-         error, discard it.  */
-
-      if (yychar <= YYEOF)
-        {
-          /* Return failure if@end of input.  */
-          if (yychar == YYEOF)
-            YYABORT;
-        }
-      else
-        {
-          yydestruct ("Error: discarding",
-                      yytoken, &yylval, &yylloc);
-          yychar = YYEMPTY;
-        }
-    }
-
-  /* Else will try to reuse lookahead token after shifting the error
-     token.  */
-  goto yyerrlab1;
-
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR.  |
-`---------------------------------------------------*/
-yyerrorlab:
-
-  /* Pacify compilers like GCC when the user code never invokes
-     YYERROR and the label yyerrorlab therefore never appears in user
-     code.  */
-  if (/*CONSTCOND*/ 0)
-     goto yyerrorlab;
-
-  yyerror_range[1] = yylsp[1-yylen];
-  /* Do not reclaim the symbols of the rule whose action triggered
-     this YYERROR.  */
-  YYPOPSTACK (yylen);
-  yylen = 0;
-  YY_STACK_PRINT (yyss, yyssp);
-  yystate = *yyssp;
-  goto yyerrlab1;
-
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR.  |
-`-------------------------------------------------------------*/
-yyerrlab1:
-  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
-
-  for (;;)
-    {
-      yyn = yypact[yystate];
-      if (!yypact_value_is_default (yyn))
-        {
-          yyn += YYTERROR;
-          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-            {
-              yyn = yytable[yyn];
-              if (0 < yyn)
-                break;
-            }
-        }
-
-      /* Pop the current state because it cannot handle the error token.  */
-      if (yyssp == yyss)
-        YYABORT;
-
-      yyerror_range[1] = *yylsp;
-      yydestruct ("Error: popping",
-                  yystos[yystate], yyvsp, yylsp);
-      YYPOPSTACK (1);
-      yystate = *yyssp;
-      YY_STACK_PRINT (yyss, yyssp);
-    }
-
-  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-  *++yyvsp = yylval;
-  YY_IGNORE_MAYBE_UNINITIALIZED_END
-
-  yyerror_range[2] = yylloc;
-  /* Using YYLLOC is tempting, but would change the location of
-     the lookahead.  YYLOC is available though.  */
-  YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
-  *++yylsp = yyloc;
-
-  /* Shift the error token.  */
-  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
-
-  yystate = yyn;
-  goto yynewstate;
-
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here.  |
-`-------------------------------------*/
-yyacceptlab:
-  yyresult = 0;
-  goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here.  |
-`-----------------------------------*/
-yyabortlab:
-  yyresult = 1;
-  goto yyreturn;
-
-#if !defined yyoverflow || YYERROR_VERBOSE
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here.  |
-`-------------------------------------------------*/
-yyexhaustedlab:
-  yyerror (YY_("memory exhausted"));
-  yyresult = 2;
-  /* Fall through.  */
-#endif
-
-yyreturn:
-  if (yychar != YYEMPTY)
-    {
-      /* Make sure we have latest lookahead translation.  See comments at
-         user semantic actions for why this is necessary.  */
-      yytoken = YYTRANSLATE (yychar);
-      yydestruct ("Cleanup: discarding lookahead",
-                  yytoken, &yylval, &yylloc);
-    }
-  /* Do not reclaim the symbols of the rule whose action triggered
-     this YYABORT or YYACCEPT.  */
-  YYPOPSTACK (yylen);
-  YY_STACK_PRINT (yyss, yyssp);
-  while (yyssp != yyss)
-    {
-      yydestruct ("Cleanup: popping",
-                  yystos[*yyssp], yyvsp, yylsp);
-      YYPOPSTACK (1);
-    }
-#ifndef yyoverflow
-  if (yyss != yyssa)
-    YYSTACK_FREE (yyss);
-#endif
-#if YYERROR_VERBOSE
-  if (yymsg != yymsgbuf)
-    YYSTACK_FREE (yymsg);
-#endif
-  return yyresult;
-}
-#line 528 "dtc-parser.y" /* yacc.c:1906  */
-
-
-void yyerror(char const *s)
-{
-	ERROR(&yylloc, "%s", s);
-}
diff --git a/scripts/dtc/dtc-parser.tab.h_shipped b/scripts/dtc/dtc-parser.tab.h_shipped
deleted file mode 100644
index 6aa512c1b337..000000000000
--- a/scripts/dtc/dtc-parser.tab.h_shipped
+++ /dev/null
@@ -1,125 +0,0 @@
-/* A Bison parser, made by GNU Bison 3.0.4.  */
-
-/* Bison interface for Yacc-like parsers in C
-
-   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-#ifndef YY_YY_DTC_PARSER_TAB_H_INCLUDED
-# define YY_YY_DTC_PARSER_TAB_H_INCLUDED
-/* Debug traces.  */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-#if YYDEBUG
-extern int yydebug;
-#endif
-
-/* Token type.  */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
-  enum yytokentype
-  {
-    DT_V1 = 258,
-    DT_PLUGIN = 259,
-    DT_MEMRESERVE = 260,
-    DT_LSHIFT = 261,
-    DT_RSHIFT = 262,
-    DT_LE = 263,
-    DT_GE = 264,
-    DT_EQ = 265,
-    DT_NE = 266,
-    DT_AND = 267,
-    DT_OR = 268,
-    DT_BITS = 269,
-    DT_DEL_PROP = 270,
-    DT_DEL_NODE = 271,
-    DT_PROPNODENAME = 272,
-    DT_LITERAL = 273,
-    DT_CHAR_LITERAL = 274,
-    DT_BYTE = 275,
-    DT_STRING = 276,
-    DT_LABEL = 277,
-    DT_REF = 278,
-    DT_INCBIN = 279
-  };
-#endif
-
-/* Value type.  */
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
-union YYSTYPE
-{
-#line 39 "dtc-parser.y" /* yacc.c:1909  */
-
-	char *propnodename;
-	char *labelref;
-	uint8_t byte;
-	struct data data;
-
-	struct {
-		struct data	data;
-		int		bits;
-	} array;
-
-	struct property *prop;
-	struct property *proplist;
-	struct node *node;
-	struct node *nodelist;
-	struct reserve_info *re;
-	uint64_t integer;
-	unsigned int flags;
-
-#line 99 "dtc-parser.tab.h" /* yacc.c:1909  */
-};
-
-typedef union YYSTYPE YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
-# define YYSTYPE_IS_DECLARED 1
-#endif
-
-/* Location type.  */
-#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
-typedef struct YYLTYPE YYLTYPE;
-struct YYLTYPE
-{
-  int first_line;
-  int first_column;
-  int last_line;
-  int last_column;
-};
-# define YYLTYPE_IS_DECLARED 1
-# define YYLTYPE_IS_TRIVIAL 1
-#endif
-
-
-extern YYSTYPE yylval;
-extern YYLTYPE yylloc;
-int yyparse (void);
-
-#endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED  */
diff --git a/scripts/dtc/update-dtc-source.sh b/scripts/dtc/update-dtc-source.sh
index f3e5c596050a..1a009fd195d0 100755
--- a/scripts/dtc/update-dtc-source.sh
+++ b/scripts/dtc/update-dtc-source.sh
@@ -1,9 +1,10 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
 # Simple script to update the version of DTC carried by the Linux kernel
 #
 # This script assumes that the dtc and the linux git trees are in the
 # same directory. After building dtc in the dtc directory, it copies the
-# source files and generated source files into the scripts/dtc directory
+# source files and generated source file(s) into the scripts/dtc directory
 # in the kernel and creates a git commit updating them to the new
 # version.
 #
@@ -33,7 +34,6 @@ DTC_LINUX_PATH=`pwd`/scripts/dtc
 DTC_SOURCE="checks.c data.c dtc.c dtc.h flattree.c fstree.c livetree.c srcpos.c \
 		srcpos.h treesource.c util.c util.h version_gen.h Makefile.dtc \
 		dtc-lexer.l dtc-parser.y"
-DTC_GENERATED="dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h"
 LIBFDT_SOURCE="Makefile.libfdt fdt.c fdt.h fdt_addresses.c fdt_empty_tree.c \
 		fdt_overlay.c fdt_ro.c fdt_rw.c fdt_strerror.c fdt_sw.c \
 		fdt_wip.c libfdt.h libfdt_env.h libfdt_internal.h"
@@ -58,10 +58,6 @@ for f in $DTC_SOURCE; do
 	cp ${DTC_UPSTREAM_PATH}/${f} ${f}
 	git add ${f}
 done
-for f in $DTC_GENERATED; do
-	cp ${DTC_UPSTREAM_PATH}/$f ${f}_shipped
-	git add ${f}_shipped
-done
 for f in $LIBFDT_SOURCE; do
        cp ${DTC_UPSTREAM_PATH}/libfdt/${f} libfdt/${f}
        git add libfdt/${f}
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 6/6] sandbox: dts: test: Fix wrong aliases property names
  2018-05-12 17:13 [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4 Eugeniu Rosca
                   ` (3 preceding siblings ...)
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 5/6] scripts/dtc: Re-sync with Linux 4.17-rc4 Eugeniu Rosca
@ 2018-05-12 17:13 ` Eugeniu Rosca
  2018-05-13 22:00   ` Simon Glass
  2018-05-12 18:25 ` [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4 Petr Vorel
  2018-05-16  1:59 ` Masahiro Yamada
  6 siblings, 1 reply; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-12 17:13 UTC (permalink / raw)
  To: u-boot

After importing v4.17-rc1 Linux commit 9130ba884640 ("scripts/dtc:
Update to upstream version v1.4.6-9-gaadd0b65c987"), sandbox build
reports below warnings:

arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'

Silent them.

Fixes: e8d5291824e2 ("core: ofnode: Fix translation for #size-cells == 0")
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
---

v1->v2:
* Newly pushed

 arch/sandbox/dts/test.dts | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 683b1970e0af..3e87c5c0f3fd 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -27,10 +27,10 @@
 		testfdt3 = "/b-test";
 		testfdt5 = "/some-bus/c-test at 5";
 		testfdt8 = "/a-test";
-		fdt_dummy0 = "/translation-test at 8000/dev at 0,0";
-		fdt_dummy1 = "/translation-test at 8000/dev at 1,100";
-		fdt_dummy2 = "/translation-test at 8000/dev at 2,200";
-		fdt_dummy3 = "/translation-test at 8000/noxlatebus at 3,300/dev at 42";
+		fdt-dummy0 = "/translation-test at 8000/dev at 0,0";
+		fdt-dummy1 = "/translation-test at 8000/dev at 1,100";
+		fdt-dummy2 = "/translation-test at 8000/dev at 2,200";
+		fdt-dummy3 = "/translation-test at 8000/noxlatebus at 3,300/dev at 42";
 		usb0 = &usb_0;
 		usb1 = &usb_1;
 		usb2 = &usb_2;
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4
  2018-05-12 17:13 [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4 Eugeniu Rosca
                   ` (4 preceding siblings ...)
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 6/6] sandbox: dts: test: Fix wrong aliases property names Eugeniu Rosca
@ 2018-05-12 18:25 ` Petr Vorel
  2018-05-12 19:17   ` Eugeniu Rosca
  2018-05-16  1:59 ` Masahiro Yamada
  6 siblings, 1 reply; 31+ messages in thread
From: Petr Vorel @ 2018-05-12 18:25 UTC (permalink / raw)
  To: u-boot

Hi Eugeniu,

> My testing was limited to:
> - make defconfig all
> - make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- r8a7795_ulcb_defconfig all
> - comparing .config before and after the re-sync
> - running the newly imported Kconfig unit tests as seen below:

I tested whole patch-set with the other options:
make config
make defconfig
make menuconfig
make xconfig
make gconfig
make oldconfig

> Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Tested-by: Petr Vorel <petr.vorel@gmail.com>

> $ make testconfig

> ============================= test session starts =============================
> scripts/kconfig/tests/auto_submenu/__init__.py::test PASSED             [  7%]
> scripts/kconfig/tests/choice/__init__.py::test_oldask0 PASSED           [ 14%]
> scripts/kconfig/tests/choice/__init__.py::test_oldask1 PASSED           [ 21%]
> scripts/kconfig/tests/choice/__init__.py::test_allyes PASSED            [ 28%]
> scripts/kconfig/tests/choice/__init__.py::test_allmod PASSED            [ 35%]
> scripts/kconfig/tests/choice/__init__.py::test_allno PASSED             [ 42%]
> scripts/kconfig/tests/choice/__init__.py::test_alldef PASSED            [ 50%]
> scripts/kconfig/tests/choice_value_with_m_dep/__init__.py::test PASSED  [ 57%]
> scripts/kconfig/tests/err_recursive_inc/__init__.py::test PASSED        [ 64%]
> scripts/kconfig/tests/inter_choice/__init__.py::test PASSED             [ 71%]
> scripts/kconfig/tests/new_choice_with_dep/__init__.py::test PASSED      [ 78%]
> scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py::test PASSED    [ 85%]
> scripts/kconfig/tests/rand_nested_choice/__init__.py::test PASSED       [ 92%]
> scripts/kconfig/tests/warn_recursive_dep/__init__.py::test PASSED       [100%]
> ========================== 14 passed in 0.34 seconds ==========================

When applied all 6 patches, I got several errors (see bellow).
I tested in on 2 distros (Debian unstable and openSUSE Tumbleweed).
The code I applied is here, did I make error when applying patches?
https://github.com/pevik/u-boot/tree/eugeniu/kconfig.v2


Kind regards,
Petr

$ make testconfig
python3 -B -m pytest ./scripts/kconfig/tests \
-o cache_dir=/home/pevik/install/src/u-boot.git/scripts/kconfig/tests/.cache \

============================= test session starts ==============================
platform linux -- Python 3.6.5, pytest-3.3.2, py-1.5.3, pluggy-0.6.0 -- /usr/bin/python3
cachedir: scripts/kconfig/tests/.cache
rootdir: /home/pevik/install/src/u-boot.git/scripts/kconfig/tests, inifile: pytest.ini
collecting ... collected 14 items

scripts/kconfig/tests/auto_submenu/__init__.py::test FAILED              [  7%]
scripts/kconfig/tests/choice/__init__.py::test_oldask0 FAILED            [ 14%]
scripts/kconfig/tests/choice/__init__.py::test_oldask1 FAILED            [ 21%]
scripts/kconfig/tests/choice/__init__.py::test_allyes PASSED             [ 28%]
scripts/kconfig/tests/choice/__init__.py::test_allmod PASSED             [ 35%]
scripts/kconfig/tests/choice/__init__.py::test_allno PASSED              [ 42%]
scripts/kconfig/tests/choice/__init__.py::test_alldef PASSED             [ 50%]
scripts/kconfig/tests/choice_value_with_m_dep/__init__.py::test PASSED   [ 57%]
scripts/kconfig/tests/err_recursive_inc/__init__.py::test PASSED         [ 64%]
scripts/kconfig/tests/inter_choice/__init__.py::test PASSED              [ 71%]
scripts/kconfig/tests/new_choice_with_dep/__init__.py::test FAILED       [ 78%]
scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py::test PASSED     [ 85%]
scripts/kconfig/tests/rand_nested_choice/__init__.py::test PASSED        [ 92%]
scripts/kconfig/tests/warn_recursive_dep/__init__.py::test PASSED        [100%]

=================================== FAILURES ===================================
_____________________________________ test _____________________________________

conf = <conftest.Conf object@0x7f7eeeaa6d30>

    def test(conf):
        assert conf.oldaskconfig() == 0
>       assert conf.stdout_contains('expected_stdout')
E       AssertionError

scripts/kconfig/tests/auto_submenu/__init__.py:12: AssertionError
----------------------------- Captured stdout call -----------------------------
[command]
/home/pevik/install/src/u-boot.git/scripts/kconfig/conf --oldaskconfig Kconfig

[retcode]
0

[stdout]
*
* Linux Kernel Configuration
*
A (A) [Y/n/?] (NEW) 
  A0 (A0) [Y/n/?] (NEW) 
    A1_0 (A0_0) [N/y/?] (NEW) 
  A1 (A1) [Y/n/?] (NEW) 
    choice
    > 1. A1_0 (A1_0) (NEW)
      2. A1_1 (A1_1) (NEW)
    choice[1-2?]: 
B (B) [N/y/?] (NEW) 
C (C) [N/y/?] (NEW) 
#
# configuration written to .config
#

[stderr]

[output for '.config']
#
# Automatically generated file; DO NOT EDIT.
# Linux Kernel Configuration
#
CONFIG_A=y
CONFIG_A0=y
# CONFIG_A0_0 is not set
CONFIG_A1=y
CONFIG_A1_0=y
# CONFIG_A1_1 is not set
# CONFIG_B is not set
# CONFIG_C is not set

_________________________________ test_oldask0 _________________________________

conf = <conftest.Conf object@0x7f7ef0e167b8>

    def test_oldask0(conf):
        assert conf.oldaskconfig() == 0
>       assert conf.stdout_contains('oldask0_expected_stdout')
E       AssertionError

scripts/kconfig/tests/choice/__init__.py:15: AssertionError
----------------------------- Captured stdout call -----------------------------
[command]
/home/pevik/install/src/u-boot.git/scripts/kconfig/conf --oldaskconfig Kconfig

[retcode]
0

[stdout]
*
* Linux Kernel Configuration
*
Enable loadable module support (MODULES) [Y/n/?] (NEW) 
boolean choice
  1. choice 0 (BOOL_CHOICE0) (NEW)
> 2. choice 1 (BOOL_CHOICE1) (NEW)
choice[1-2?]: 
optional boolean choice [N/y/?] (NEW) 
tristate choice [M/y/?] (NEW) 
  choice 0 (TRI_CHOICE0) [N/m/?] (NEW) 
  choice 1 (TRI_CHOICE1) [N/m/?] (NEW) 
optional tristate choice [N/m/y/?] (NEW) 
#
# configuration written to .config
#

[stderr]

[output for '.config']
#
# Automatically generated file; DO NOT EDIT.
# Linux Kernel Configuration
#
CONFIG_MODULES=y
# CONFIG_BOOL_CHOICE0 is not set
CONFIG_BOOL_CHOICE1=y
# CONFIG_TRI_CHOICE0 is not set
# CONFIG_TRI_CHOICE1 is not set

_________________________________ test_oldask1 _________________________________

conf = <conftest.Conf object@0x7f7ef0e167b8>

    def test_oldask1(conf):
        assert conf.oldaskconfig('oldask1_config') == 0
>       assert conf.stdout_contains('oldask1_expected_stdout')
E       AssertionError

scripts/kconfig/tests/choice/__init__.py:20: AssertionError
----------------------------- Captured stdout call -----------------------------
[command]
/home/pevik/install/src/u-boot.git/scripts/kconfig/conf --oldaskconfig Kconfig

[retcode]
0

[stdout]
*
* Linux Kernel Configuration
*
Enable loadable module support (MODULES) [N/y/?] 
boolean choice
  1. choice 0 (BOOL_CHOICE0) (NEW)
> 2. choice 1 (BOOL_CHOICE1) (NEW)
choice[1-2?]: 
optional boolean choice [Y/n/?] (NEW) 
optional boolean choice
> 1. choice 0 (OPT_BOOL_CHOICE0)
  2. choice 1 (OPT_BOOL_CHOICE1) (NEW)
choice[1-2?]: 
tristate choice
  1. choice 0 (TRI_CHOICE0) (NEW)
> 2. choice 1 (TRI_CHOICE1) (NEW)
choice[1-2?]: 
optional tristate choice [N/y/?] 
#
# configuration written to .config
#

[stderr]

[output for '.config']
#
# Automatically generated file; DO NOT EDIT.
# Linux Kernel Configuration
#
# CONFIG_MODULES is not set
# CONFIG_BOOL_CHOICE0 is not set
CONFIG_BOOL_CHOICE1=y
CONFIG_OPT_BOOL_CHOICE0=y
# CONFIG_OPT_BOOL_CHOICE1 is not set
# CONFIG_TRI_CHOICE0 is not set
CONFIG_TRI_CHOICE1=y

_____________________________________ test _____________________________________

conf = <conftest.Conf object@0x7f7eee858400>

    def test(conf):
        assert conf.oldconfig('config', 'y') == 0
>       assert conf.stdout_contains('expected_stdout')
E       AssertionError

scripts/kconfig/tests/new_choice_with_dep/__init__.py:14: AssertionError
----------------------------- Captured stdout call -----------------------------
[command]
/home/pevik/install/src/u-boot.git/scripts/kconfig/conf --oldconfig Kconfig

[retcode]
0

[stdout]
*
* Restart config...
*
*
* Linux Kernel Configuration
*
A (A) [N/y/?] (NEW) y
  Choice ?
  > 1. Choice B (CHOICE_B)
    2. Choice C (CHOICE_C) (NEW)
  choice[1-2?]: 
Choice2 ?
  1. Choice D (CHOICE_D)
> 2. Choice E (CHOICE_E)
  3. Choice F (CHOICE_F) (NEW)
choice[1-3?]: 
#
# configuration written to .config
#

[stderr]

[output for '.config']
#
# Automatically generated file; DO NOT EDIT.
# Linux Kernel Configuration
#
CONFIG_A=y
CONFIG_CHOICE_B=y
# CONFIG_CHOICE_C is not set
# CONFIG_CHOICE_D is not set
CONFIG_CHOICE_E=y
# CONFIG_CHOICE_F is not set

===================== 4 failed, 10 passed in 0.21 seconds ======================
make[1]: *** [scripts/kconfig/Makefile:156: testconfig] Error 1
make: *** [Makefile:482: testconfig] Error 2

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4
  2018-05-12 18:25 ` [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4 Petr Vorel
@ 2018-05-12 19:17   ` Eugeniu Rosca
  2018-05-12 19:31     ` Petr Vorel
  2018-05-13 13:52     ` Masahiro Yamada
  0 siblings, 2 replies; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-12 19:17 UTC (permalink / raw)
  To: u-boot


Hello Petr,

On Sat, May 12, 2018 at 08:25:56PM +0200, Petr Vorel wrote:
> Hi Eugeniu,
> 
> > My testing was limited to:
> > - make defconfig all
> > - make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- r8a7795_ulcb_defconfig all
> > - comparing .config before and after the re-sync
> > - running the newly imported Kconfig unit tests as seen below:
> 
> I tested whole patch-set with the other options:
> make config
> make defconfig
> make menuconfig
> make xconfig
> make gconfig
> make oldconfig
> 
> > Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> Tested-by: Petr Vorel <petr.vorel@gmail.com>

Many thanks for testing!

> 
> > $ make testconfig
> 
> > ============================= test session starts =============================
> > scripts/kconfig/tests/auto_submenu/__init__.py::test PASSED             [  7%]
> > scripts/kconfig/tests/choice/__init__.py::test_oldask0 PASSED           [ 14%]
> > scripts/kconfig/tests/choice/__init__.py::test_oldask1 PASSED           [ 21%]
> > scripts/kconfig/tests/choice/__init__.py::test_allyes PASSED            [ 28%]
> > scripts/kconfig/tests/choice/__init__.py::test_allmod PASSED            [ 35%]
> > scripts/kconfig/tests/choice/__init__.py::test_allno PASSED             [ 42%]
> > scripts/kconfig/tests/choice/__init__.py::test_alldef PASSED            [ 50%]
> > scripts/kconfig/tests/choice_value_with_m_dep/__init__.py::test PASSED  [ 57%]
> > scripts/kconfig/tests/err_recursive_inc/__init__.py::test PASSED        [ 64%]
> > scripts/kconfig/tests/inter_choice/__init__.py::test PASSED             [ 71%]
> > scripts/kconfig/tests/new_choice_with_dep/__init__.py::test PASSED      [ 78%]
> > scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py::test PASSED    [ 85%]
> > scripts/kconfig/tests/rand_nested_choice/__init__.py::test PASSED       [ 92%]
> > scripts/kconfig/tests/warn_recursive_dep/__init__.py::test PASSED       [100%]
> > ========================== 14 passed in 0.34 seconds ==========================
> 
> When applied all 6 patches, I got several errors (see bellow).
> I tested in on 2 distros (Debian unstable and openSUSE Tumbleweed).
> The code I applied is here, did I make error when applying patches?
> https://github.com/pevik/u-boot/tree/eugeniu/kconfig.v2

I checked your branch and got some interesting conclusions.
Here is the diff between my and your version of commit ("kconfig:
re-sync with Linux 4.17-rc4"):

$ git diff <eugeniu> <petr>
 scripts/kconfig/tests/auto_submenu/expected_stdout        | 14 +++++++-------
 scripts/kconfig/tests/choice/oldask0_expected_stdout      | 14 +++++++-------
 scripts/kconfig/tests/choice/oldask1_expected_stdout      | 12 ++++++------
 scripts/kconfig/tests/new_choice_with_dep/expected_stdout |  4 ++--
 4 files changed, 22 insertions(+), 22 deletions(-)

Here is the same diff ignoring whitespace:

$ git diff -w <eugeniu> <petr>
 scripts/kconfig/tests/auto_submenu/expected_stdout        | 0
 scripts/kconfig/tests/choice/oldask0_expected_stdout      | 0
 scripts/kconfig/tests/choice/oldask1_expected_stdout      | 0
 scripts/kconfig/tests/new_choice_with_dep/expected_stdout | 0
 4 files changed, 0 insertions(+), 0 deletions(-)

So, it seems like all the trailing white-space from above files
disappeared on your branch, after applying the patches from the
email client (who did this?...).

I didn't expect that trailing white-space to be of any value for the
test results, but it turns out it is! With the whitespace removed, I can
also reproduce the failures of "make testconfig".

I am not familiar with pytest, but, based on what we see here, it looks
like every single character stored in *xpected_stdout files (including
whitespace at the end of lines) matters for the test to pass.

I wonder if Kconfig could avoid printing whitespace in command line
user dialogs. Then maybe those space characters could be removed from
the "*xpected_stdout" files.

Masahiro?

Thanks again!

Best regards,
Eugeniu.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4
  2018-05-12 19:17   ` Eugeniu Rosca
@ 2018-05-12 19:31     ` Petr Vorel
  2018-05-12 21:17       ` Eugeniu Rosca
  2018-05-13 13:52     ` Masahiro Yamada
  1 sibling, 1 reply; 31+ messages in thread
From: Petr Vorel @ 2018-05-12 19:31 UTC (permalink / raw)
  To: u-boot

Hi Eugeniu,

> Hello Petr,

> On Sat, May 12, 2018 at 08:25:56PM +0200, Petr Vorel wrote:

> > When applied all 6 patches, I got several errors (see bellow).
> > I tested in on 2 distros (Debian unstable and openSUSE Tumbleweed).
> > The code I applied is here, did I make error when applying patches?
> > https://github.com/pevik/u-boot/tree/eugeniu/kconfig.v2

> I checked your branch and got some interesting conclusions.
> Here is the diff between my and your version of commit ("kconfig:
> re-sync with Linux 4.17-rc4"):

> $ git diff <eugeniu> <petr>
>  scripts/kconfig/tests/auto_submenu/expected_stdout        | 14 +++++++-------
>  scripts/kconfig/tests/choice/oldask0_expected_stdout      | 14 +++++++-------
>  scripts/kconfig/tests/choice/oldask1_expected_stdout      | 12 ++++++------
>  scripts/kconfig/tests/new_choice_with_dep/expected_stdout |  4 ++--
>  4 files changed, 22 insertions(+), 22 deletions(-)

> Here is the same diff ignoring whitespace:

> $ git diff -w <eugeniu> <petr>
>  scripts/kconfig/tests/auto_submenu/expected_stdout        | 0
>  scripts/kconfig/tests/choice/oldask0_expected_stdout      | 0
>  scripts/kconfig/tests/choice/oldask1_expected_stdout      | 0
>  scripts/kconfig/tests/new_choice_with_dep/expected_stdout | 0
>  4 files changed, 0 insertions(+), 0 deletions(-)

> So, it seems like all the trailing white-space from above files
> disappeared on your branch, after applying the patches from the
> email client (who did this?...).
OK, my fault, I'm sorry. Applying first patch as 'git am --whitespace=warn 1.mbox' fixes
that => make testconfig works.

Yes I applied patches with mutt (I usually use pwclient, but somehow I didn't find your v2
in patchwork [1], nor even in ML [2]. Have I overlook something.

[1] https://patchwork.ozlabs.org/project/uboot/list/
[2] https://lists.denx.de/pipermail/u-boot/2018-May/date.html


Kind regards,
Petr

> I didn't expect that trailing white-space to be of any value for the
> test results, but it turns out it is! With the whitespace removed, I can
> also reproduce the failures of "make testconfig".

> I am not familiar with pytest, but, based on what we see here, it looks
> like every single character stored in *xpected_stdout files (including
> whitespace at the end of lines) matters for the test to pass.

> I wonder if Kconfig could avoid printing whitespace in command line
> user dialogs. Then maybe those space characters could be removed from
> the "*xpected_stdout" files.

> Masahiro?

> Thanks again!

> Best regards,
> Eugeniu.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4
  2018-05-12 19:31     ` Petr Vorel
@ 2018-05-12 21:17       ` Eugeniu Rosca
  0 siblings, 0 replies; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-12 21:17 UTC (permalink / raw)
  To: u-boot

Hi Petr,

On Sat, May 12, 2018 at 09:31:48PM +0200, Petr Vorel wrote:
> Hi Eugeniu,
> 
> > Hello Petr,
> 
> > On Sat, May 12, 2018 at 08:25:56PM +0200, Petr Vorel wrote:
> 
> > > When applied all 6 patches, I got several errors (see bellow).
> > > I tested in on 2 distros (Debian unstable and openSUSE Tumbleweed).
> > > The code I applied is here, did I make error when applying patches?
> > > https://github.com/pevik/u-boot/tree/eugeniu/kconfig.v2
> 
> > I checked your branch and got some interesting conclusions.
> > Here is the diff between my and your version of commit ("kconfig:
> > re-sync with Linux 4.17-rc4"):
> 
> > $ git diff <eugeniu> <petr>
> >  scripts/kconfig/tests/auto_submenu/expected_stdout        | 14 +++++++-------
> >  scripts/kconfig/tests/choice/oldask0_expected_stdout      | 14 +++++++-------
> >  scripts/kconfig/tests/choice/oldask1_expected_stdout      | 12 ++++++------
> >  scripts/kconfig/tests/new_choice_with_dep/expected_stdout |  4 ++--
> >  4 files changed, 22 insertions(+), 22 deletions(-)
> 
> > Here is the same diff ignoring whitespace:
> 
> > $ git diff -w <eugeniu> <petr>
> >  scripts/kconfig/tests/auto_submenu/expected_stdout        | 0
> >  scripts/kconfig/tests/choice/oldask0_expected_stdout      | 0
> >  scripts/kconfig/tests/choice/oldask1_expected_stdout      | 0
> >  scripts/kconfig/tests/new_choice_with_dep/expected_stdout | 0
> >  4 files changed, 0 insertions(+), 0 deletions(-)
> 
> > So, it seems like all the trailing white-space from above files
> > disappeared on your branch, after applying the patches from the
> > email client (who did this?...).

I hope I wasn't too harsh here. By "who" I meant the exact component or
script in your workflow which dropped the trailing spaces. By knowing
it, we could also improve our own workflows, which is a positive of
going through this issue IMHO.

> OK, my fault, I'm sorry. Applying first patch as 'git am --whitespace=warn 1.mbox' fixes
> that => make testconfig works.

No worries.

> Yes I applied patches with mutt (I usually use pwclient, but somehow I didn't find your v2
> in patchwork [1], nor even in ML [2]. Have I overlook something.
> 
> [1] https://patchwork.ozlabs.org/project/uboot/list/
> [2] https://lists.denx.de/pipermail/u-boot/2018-May/date.html

I think I'm subscribed to U-boot mailing list with only one of my email
addresses. The messages arriving from another one are delayed a bit
since they have to be approved by moderators.

Thanks,
Eugeniu.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4
  2018-05-12 19:17   ` Eugeniu Rosca
  2018-05-12 19:31     ` Petr Vorel
@ 2018-05-13 13:52     ` Masahiro Yamada
  2018-05-13 20:43       ` Eugeniu Rosca
  2018-05-14 19:35       ` Petr Vorel
  1 sibling, 2 replies; 31+ messages in thread
From: Masahiro Yamada @ 2018-05-13 13:52 UTC (permalink / raw)
  To: u-boot

2018-05-13 4:17 GMT+09:00 Eugeniu Rosca <roscaeugeniu@gmail.com>:
>
> Hello Petr,
>
> On Sat, May 12, 2018 at 08:25:56PM +0200, Petr Vorel wrote:
>> Hi Eugeniu,
>>
>> > My testing was limited to:
>> > - make defconfig all
>> > - make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- r8a7795_ulcb_defconfig all
>> > - comparing .config before and after the re-sync
>> > - running the newly imported Kconfig unit tests as seen below:
>>
>> I tested whole patch-set with the other options:
>> make config
>> make defconfig
>> make menuconfig
>> make xconfig
>> make gconfig
>> make oldconfig
>>
>> > Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> > Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
>> Tested-by: Petr Vorel <petr.vorel@gmail.com>
>
> Many thanks for testing!
>
>>
>> > $ make testconfig
>>
>> > ============================= test session starts =============================
>> > scripts/kconfig/tests/auto_submenu/__init__.py::test PASSED             [  7%]
>> > scripts/kconfig/tests/choice/__init__.py::test_oldask0 PASSED           [ 14%]
>> > scripts/kconfig/tests/choice/__init__.py::test_oldask1 PASSED           [ 21%]
>> > scripts/kconfig/tests/choice/__init__.py::test_allyes PASSED            [ 28%]
>> > scripts/kconfig/tests/choice/__init__.py::test_allmod PASSED            [ 35%]
>> > scripts/kconfig/tests/choice/__init__.py::test_allno PASSED             [ 42%]
>> > scripts/kconfig/tests/choice/__init__.py::test_alldef PASSED            [ 50%]
>> > scripts/kconfig/tests/choice_value_with_m_dep/__init__.py::test PASSED  [ 57%]
>> > scripts/kconfig/tests/err_recursive_inc/__init__.py::test PASSED        [ 64%]
>> > scripts/kconfig/tests/inter_choice/__init__.py::test PASSED             [ 71%]
>> > scripts/kconfig/tests/new_choice_with_dep/__init__.py::test PASSED      [ 78%]
>> > scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py::test PASSED    [ 85%]
>> > scripts/kconfig/tests/rand_nested_choice/__init__.py::test PASSED       [ 92%]
>> > scripts/kconfig/tests/warn_recursive_dep/__init__.py::test PASSED       [100%]
>> > ========================== 14 passed in 0.34 seconds ==========================
>>
>> When applied all 6 patches, I got several errors (see bellow).
>> I tested in on 2 distros (Debian unstable and openSUSE Tumbleweed).
>> The code I applied is here, did I make error when applying patches?
>> https://github.com/pevik/u-boot/tree/eugeniu/kconfig.v2
>
> I checked your branch and got some interesting conclusions.
> Here is the diff between my and your version of commit ("kconfig:
> re-sync with Linux 4.17-rc4"):
>
> $ git diff <eugeniu> <petr>
>  scripts/kconfig/tests/auto_submenu/expected_stdout        | 14 +++++++-------
>  scripts/kconfig/tests/choice/oldask0_expected_stdout      | 14 +++++++-------
>  scripts/kconfig/tests/choice/oldask1_expected_stdout      | 12 ++++++------
>  scripts/kconfig/tests/new_choice_with_dep/expected_stdout |  4 ++--
>  4 files changed, 22 insertions(+), 22 deletions(-)
>
> Here is the same diff ignoring whitespace:
>
> $ git diff -w <eugeniu> <petr>
>  scripts/kconfig/tests/auto_submenu/expected_stdout        | 0
>  scripts/kconfig/tests/choice/oldask0_expected_stdout      | 0
>  scripts/kconfig/tests/choice/oldask1_expected_stdout      | 0
>  scripts/kconfig/tests/new_choice_with_dep/expected_stdout | 0
>  4 files changed, 0 insertions(+), 0 deletions(-)
>
> So, it seems like all the trailing white-space from above files
> disappeared on your branch, after applying the patches from the
> email client (who did this?...).
>
> I didn't expect that trailing white-space to be of any value for the
> test results, but it turns out it is! With the whitespace removed, I can
> also reproduce the failures of "make testconfig".

Right.
Whitespaces are precious in the expected_stdout files.
Do not rip them off.



> I am not familiar with pytest, but, based on what we see here, it looks
> like every single character stored in *xpected_stdout files (including
> whitespace at the end of lines) matters for the test to pass.
>
> I wonder if Kconfig could avoid printing whitespace in command line
> user dialogs. Then maybe those space characters could be removed from
> the "*xpected_stdout" files.


'make config' display a space at the end of line
when prompting user input.

This makes the input readable, like follows:

*
* Linux/x86 4.17.0-rc4 Kernel Configuration
*
64-bit kernel (64BIT) [Y/n/?] y
*
* General setup
*
Cross-compiler tool prefix (CROSS_COMPILE) []
Compile also drivers which will not load (COMPILE_TEST) [N/y/?] y



I think you are suggesting to remove a space, like follows:

*
* Linux/x86 4.17.0-rc4 Kernel Configuration
*
64-bit kernel (64BIT) [Y/n/?]y
*
* General setup
*
Cross-compiler tool prefix (CROSS_COMPILE) []
Compile also drivers which will not load (COMPILE_TEST) [N/y/?]y




I believe we should not do this
just for unit-testing.





> Masahiro?
>
> Thanks again!
>
> Best regards,
> Eugeniu.
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4
  2018-05-13 13:52     ` Masahiro Yamada
@ 2018-05-13 20:43       ` Eugeniu Rosca
  2018-05-14 19:35       ` Petr Vorel
  1 sibling, 0 replies; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-13 20:43 UTC (permalink / raw)
  To: u-boot

On Sun, May 13, 2018 at 10:52:07PM +0900, Masahiro Yamada wrote:
> 2018-05-13 4:17 GMT+09:00 Eugeniu Rosca <roscaeugeniu@gmail.com>:
> > I wonder if Kconfig could avoid printing whitespace in command line
> > user dialogs. Then maybe those space characters could be removed from
> > the "*xpected_stdout" files.
> 
> 
> 'make config' display a space at the end of line
> when prompting user input.
> 
> This makes the input readable, like follows:
> 
> *
> * Linux/x86 4.17.0-rc4 Kernel Configuration
> *
> 64-bit kernel (64BIT) [Y/n/?] y
> *
> * General setup
> *
> Cross-compiler tool prefix (CROSS_COMPILE) []
> Compile also drivers which will not load (COMPILE_TEST) [N/y/?] y
> 
> 
> 
> I think you are suggesting to remove a space, like follows:
> 
> *
> * Linux/x86 4.17.0-rc4 Kernel Configuration
> *
> 64-bit kernel (64BIT) [Y/n/?]y
> *
> * General setup
> *
> Cross-compiler tool prefix (CROSS_COMPILE) []
> Compile also drivers which will not load (COMPILE_TEST) [N/y/?]y
> 
> 
> I believe we should not do this
> just for unit-testing.

Chopped output will hurt user experience, so I agree it's not a solution
to eliminate trailing whitespace in predefined stdout files for pytest.

Thank you,
Eugeniu.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 3/6] scripts/dtc: Update to upstream version v1.4.5-6-gc1e55a5513e9
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 3/6] scripts/dtc: Update to upstream version v1.4.5-6-gc1e55a5513e9 Eugeniu Rosca
@ 2018-05-13 22:00   ` Simon Glass
  2018-05-16  1:54   ` Masahiro Yamada
  1 sibling, 0 replies; 31+ messages in thread
From: Simon Glass @ 2018-05-13 22:00 UTC (permalink / raw)
  To: u-boot

On 13 May 2018 at 03:13, Eugeniu Rosca <roscaeugeniu@gmail.com> wrote:
> From: Rob Herring <robh@kernel.org>
>
> Pickup the fix for handling unresolved phandles in overlays.
>
> This adds the following commits from upstream:
>
> c1e55a5513e9 checks: fix handling of unresolved phandles for dts plugins
> f8872e29ce06 tests: Avoid 64-bit arithmetic in assembler
> 48c91c08bcfa libfdt: add stringlist functions to linker script
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> [ Linux commit: e45fe7f788dd1395befe5639149ad8dacfbd94ab ]
> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> ---
>
> v1->v2:
> * Newly pushed
>
>  scripts/dtc/checks.c      | 9 +++++++++
>  scripts/dtc/version_gen.h | 2 +-
>  2 files changed, 10 insertions(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 4/6] scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 4/6] scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987 Eugeniu Rosca
@ 2018-05-13 22:00   ` Simon Glass
  2018-05-13 22:45     ` Eugeniu Rosca
  2018-05-16  1:49   ` Masahiro Yamada
  1 sibling, 1 reply; 31+ messages in thread
From: Simon Glass @ 2018-05-13 22:00 UTC (permalink / raw)
  To: u-boot

Hi,

On 13 May 2018 at 03:13, Eugeniu Rosca <roscaeugeniu@gmail.com> wrote:
> From: Rob Herring <robh@kernel.org>
>
> This adds the following commits from upstream:
>
> aadd0b65c987 checks: centralize printing of property names in failure messages
> 88960e398907 checks: centralize printing of node path in check_msg
> f1879e1a50eb Add limited read-only support for older (V2 and V3) device tree to libfdt.
> 37dea76e9700 srcpos: drop special handling of tab
> 65893da4aee0 libfdt: overlay: Add missing license
> 962a45ca034d Avoid installing pylibfdt when dependencies are missing
> cd6ea1b2bea6 Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT}
> 51b3a16338df Makefile.tests: Add LIBDL make(1) variable for portability sake
> 333d533a8f4d Attempt to auto-detect stat(1) being used if not given proper invocation
> e54388015af1 dtc: Bump version to v1.4.6
> a1fe86f380cb fdtoverlay: Switch from using alloca to malloc
> c8d5472de3ff tests: Improve compatibility with other platforms
> c81d389a10cc checks: add chosen node checks
> e671852042a7 checks: add aliases node checks
> d0c44ebe3f42 checks: check for #{size,address}-cells without child nodes
> 18a3d84bb802 checks: add string list check for *-names properties
> 8fe94fd6f19f checks: add string list check
> 6c5730819604 checks: add a string check for 'label' property
> a384191eba09 checks: fix sound-dai phandle with arg property check
> b260c4f610c0 Fix ambiguous grammar for devicetree rule
> fe667e382bac tests: Add some basic tests for the pci_bridge checks
> 7975f6422260 Fix widespread incorrect use of strneq(), replace with new strprefixeq()
> fca296445eab Add strstarts() helper function
> cc392f089007 tests: Check non-matching cases for fdt_node_check_compatible()
> bba26a5291c8 livetree: avoid assertion of orphan phandles with overlays
> c8f8194d76cc implement strnlen for systems that need it
> c8b38f65fdec libfdt: Remove leading underscores from identifiers
> 3b62fdaebfe5 Remove leading underscores from identifiers
> 2d45d1c5c65e Replace FDT_VERSION() with stringify()
> 2e6fe5a107b5 Fix some errors in comments
> b0ae9e4b0ceb tests: Correct warning in sw_tree1.c
>
> Commit c8b38f65fdec upstream ("libfdt: Remove leading underscores from
> identifiers") changed the multiple inclusion define protection, so the
> kernel's libfdt_env.h needs the corresponding update.
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> [ Linux commit: 9130ba884640328bb78aaa4840e5ddf06ccafb1c ]
> [erosca: - Fixup conflicts in include/linux/libfdt_env.h caused by v2018.03-rc4
>            commit b08c8c487083 ("libfdt: move headers to <linux/libfdt.h>
>            and <linux/libfdt_env.h>")
>          - Fix build errors in lib/libfdt/fdt_ro.c, tools/libfdt/fdt_rw.c by:
>            - s/_fdt_mem_rsv/fdt_mem_rsv_/
>            - s/_fdt_offset_ptr/fdt_offset_ptr_/
>            - s/_fdt_check_node_offset/fdt_check_node_offset_/
>            - s/_fdt_check_prop_offset/fdt_check_prop_offset_/
>            - s/_fdt_find_add_string/fdt_find_add_string_/]
> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> ---
>
> v1-v2:
> * Newly pushed
>
>  include/linux/libfdt_env.h           |   6 +-
>  lib/libfdt/fdt_ro.c                  |  18 +-
>  scripts/dtc/checks.c                 | 439 ++++++++++++++++++---------
>  scripts/dtc/dtc-parser.y             |  17 +-
>  scripts/dtc/dtc.c                    |   7 +-
>  scripts/dtc/dtc.h                    |  11 +-
>  scripts/dtc/flattree.c               |   2 +-
>  scripts/dtc/libfdt/fdt.c             |  13 +-
>  scripts/dtc/libfdt/fdt.h             |   6 +-
>  scripts/dtc/libfdt/fdt_overlay.c     |  51 ++++
>  scripts/dtc/libfdt/fdt_ro.c          | 132 ++++++--
>  scripts/dtc/libfdt/fdt_rw.c          |  90 +++---
>  scripts/dtc/libfdt/fdt_sw.c          |  24 +-
>  scripts/dtc/libfdt/fdt_wip.c         |  10 +-
>  scripts/dtc/libfdt/libfdt.h          |  37 +--
>  scripts/dtc/libfdt/libfdt_env.h      |  33 +-
>  scripts/dtc/libfdt/libfdt_internal.h |  32 +-
>  scripts/dtc/livetree.c               |  10 +-
>  scripts/dtc/srcpos.c                 |   5 -
>  scripts/dtc/srcpos.h                 |   6 +-
>  scripts/dtc/util.h                   |   9 +-
>  scripts/dtc/version_gen.h            |   2 +-
>  tools/libfdt/fdt_rw.c                |   2 +-
>  23 files changed, 632 insertions(+), 330 deletions(-)

Can you please check that this does not adversely impact code size?

Regards,
Simon

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 6/6] sandbox: dts: test: Fix wrong aliases property names
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 6/6] sandbox: dts: test: Fix wrong aliases property names Eugeniu Rosca
@ 2018-05-13 22:00   ` Simon Glass
  0 siblings, 0 replies; 31+ messages in thread
From: Simon Glass @ 2018-05-13 22:00 UTC (permalink / raw)
  To: u-boot

On 13 May 2018 at 03:13, Eugeniu Rosca <roscaeugeniu@gmail.com> wrote:
> After importing v4.17-rc1 Linux commit 9130ba884640 ("scripts/dtc:
> Update to upstream version v1.4.6-9-gaadd0b65c987"), sandbox build
> reports below warnings:
>
> arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
> arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
> arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
> arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
>
> Silent them.
>
> Fixes: e8d5291824e2 ("core: ofnode: Fix translation for #size-cells == 0")
> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> ---
>
> v1->v2:
> * Newly pushed
>
>  arch/sandbox/dts/test.dts | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 4/6] scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987
  2018-05-13 22:00   ` Simon Glass
@ 2018-05-13 22:45     ` Eugeniu Rosca
  2018-05-14 19:52       ` Simon Glass
  0 siblings, 1 reply; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-13 22:45 UTC (permalink / raw)
  To: u-boot

Hi Simon,

On Mon, May 14, 2018 at 08:00:40AM +1000, Simon Glass wrote:
> Hi,
> 
> On 13 May 2018 at 03:13, Eugeniu Rosca <roscaeugeniu@gmail.com> wrote:
> > From: Rob Herring <robh@kernel.org>
> >
> > This adds the following commits from upstream:
> >
> > aadd0b65c987 checks: centralize printing of property names in failure messages
> > 88960e398907 checks: centralize printing of node path in check_msg
> > f1879e1a50eb Add limited read-only support for older (V2 and V3) device tree to libfdt.
> > 37dea76e9700 srcpos: drop special handling of tab
> > 65893da4aee0 libfdt: overlay: Add missing license
> > 962a45ca034d Avoid installing pylibfdt when dependencies are missing
> > cd6ea1b2bea6 Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT}
> > 51b3a16338df Makefile.tests: Add LIBDL make(1) variable for portability sake
> > 333d533a8f4d Attempt to auto-detect stat(1) being used if not given proper invocation
> > e54388015af1 dtc: Bump version to v1.4.6
> > a1fe86f380cb fdtoverlay: Switch from using alloca to malloc
> > c8d5472de3ff tests: Improve compatibility with other platforms
> > c81d389a10cc checks: add chosen node checks
> > e671852042a7 checks: add aliases node checks
> > d0c44ebe3f42 checks: check for #{size,address}-cells without child nodes
> > 18a3d84bb802 checks: add string list check for *-names properties
> > 8fe94fd6f19f checks: add string list check
> > 6c5730819604 checks: add a string check for 'label' property
> > a384191eba09 checks: fix sound-dai phandle with arg property check
> > b260c4f610c0 Fix ambiguous grammar for devicetree rule
> > fe667e382bac tests: Add some basic tests for the pci_bridge checks
> > 7975f6422260 Fix widespread incorrect use of strneq(), replace with new strprefixeq()
> > fca296445eab Add strstarts() helper function
> > cc392f089007 tests: Check non-matching cases for fdt_node_check_compatible()
> > bba26a5291c8 livetree: avoid assertion of orphan phandles with overlays
> > c8f8194d76cc implement strnlen for systems that need it
> > c8b38f65fdec libfdt: Remove leading underscores from identifiers
> > 3b62fdaebfe5 Remove leading underscores from identifiers
> > 2d45d1c5c65e Replace FDT_VERSION() with stringify()
> > 2e6fe5a107b5 Fix some errors in comments
> > b0ae9e4b0ceb tests: Correct warning in sw_tree1.c
> >
> > Commit c8b38f65fdec upstream ("libfdt: Remove leading underscores from
> > identifiers") changed the multiple inclusion define protection, so the
> > kernel's libfdt_env.h needs the corresponding update.
> >
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > [ Linux commit: 9130ba884640328bb78aaa4840e5ddf06ccafb1c ]
> > [erosca: - Fixup conflicts in include/linux/libfdt_env.h caused by v2018.03-rc4
> >            commit b08c8c487083 ("libfdt: move headers to <linux/libfdt.h>
> >            and <linux/libfdt_env.h>")
> >          - Fix build errors in lib/libfdt/fdt_ro.c, tools/libfdt/fdt_rw.c by:
> >            - s/_fdt_mem_rsv/fdt_mem_rsv_/
> >            - s/_fdt_offset_ptr/fdt_offset_ptr_/
> >            - s/_fdt_check_node_offset/fdt_check_node_offset_/
> >            - s/_fdt_check_prop_offset/fdt_check_prop_offset_/
> >            - s/_fdt_find_add_string/fdt_find_add_string_/]
> > Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> > ---
> >
> > v1-v2:
> > * Newly pushed
> >
> >  include/linux/libfdt_env.h           |   6 +-
> >  lib/libfdt/fdt_ro.c                  |  18 +-
> >  scripts/dtc/checks.c                 | 439 ++++++++++++++++++---------
> >  scripts/dtc/dtc-parser.y             |  17 +-
> >  scripts/dtc/dtc.c                    |   7 +-
> >  scripts/dtc/dtc.h                    |  11 +-
> >  scripts/dtc/flattree.c               |   2 +-
> >  scripts/dtc/libfdt/fdt.c             |  13 +-
> >  scripts/dtc/libfdt/fdt.h             |   6 +-
> >  scripts/dtc/libfdt/fdt_overlay.c     |  51 ++++
> >  scripts/dtc/libfdt/fdt_ro.c          | 132 ++++++--
> >  scripts/dtc/libfdt/fdt_rw.c          |  90 +++---
> >  scripts/dtc/libfdt/fdt_sw.c          |  24 +-
> >  scripts/dtc/libfdt/fdt_wip.c         |  10 +-
> >  scripts/dtc/libfdt/libfdt.h          |  37 +--
> >  scripts/dtc/libfdt/libfdt_env.h      |  33 +-
> >  scripts/dtc/libfdt/libfdt_internal.h |  32 +-
> >  scripts/dtc/livetree.c               |  10 +-
> >  scripts/dtc/srcpos.c                 |   5 -
> >  scripts/dtc/srcpos.h                 |   6 +-
> >  scripts/dtc/util.h                   |   9 +-
> >  scripts/dtc/version_gen.h            |   2 +-
> >  tools/libfdt/fdt_rw.c                |   2 +-
> >  23 files changed, 632 insertions(+), 330 deletions(-)
> 
> Can you please check that this does not adversely impact code size?

Sure. Here are the sizes before and after this patch (sandbox):

1. ELF size comparison shows 96 bytes increase
$ du -b u-boot.before u-boot.after
  8055864	u-boot.before
  8055960	u-boot.after

2. BIN size comparison shows no change
$ du -b u-boot.bin.before u-boot.bin.after
  3377256	u-boot.bin.before
  3377256	u-boot.bin.after

3. "size" tool gives more details about ELF file size increase:
$ size u-boot.before u-boot.after
   text	   data	    bss	    dec	    hex	filename
   1199720	  76952	 291760	1568432	 17eeb0	u-boot.before
   1199736	  76952	 291760	1568448	 17eec0	u-boot.after

4. "bloaty" (diff mode) gives even more details (confirming the above)
$ bloaty -d compileunits u-boot.after -- u-boot.before
     VM SIZE                                FILE SIZE
 --------------                          --------------
  +2.5%     +30 lib/libfdt/fdt.c             +96  +1.5%
  [ = ]       0 lib/libfdt/fdt_sw.c          +21  +0.1%
  +2.6%     +16 [LOAD [RX]]                  +16  +2.6%
  [ = ]       0 lib/libfdt/fdt_overlay.c     +16  +0.1%
  [ = ]       0 [section .debug_str]          +2  +0.0%
  [ = ]       0 fs/ext4/ext4_common.c         -5  -0.0%
  [ = ]       0 common/fdt_support.c         -11  -0.0%
  -3.3%     -14 [section .text]              -14  -3.3%
  [ = ]       0 [Unmapped]                   -25  -0.7%
  +0.0%     +32 TOTAL                        +96  +0.0%

> Regards,
> Simon

Best regards,
Eugeniu.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4
  2018-05-13 13:52     ` Masahiro Yamada
  2018-05-13 20:43       ` Eugeniu Rosca
@ 2018-05-14 19:35       ` Petr Vorel
  1 sibling, 0 replies; 31+ messages in thread
From: Petr Vorel @ 2018-05-14 19:35 UTC (permalink / raw)
  To: u-boot

Hi Eugeniu, Masahiro,

> > So, it seems like all the trailing white-space from above files
> > disappeared on your branch, after applying the patches from the
> > email client (who did this?...).

> > I didn't expect that trailing white-space to be of any value for the
> > test results, but it turns out it is! With the whitespace removed, I can
> > also reproduce the failures of "make testconfig".

> Right.
> Whitespaces are precious in the expected_stdout files.
> Do not rip them off.



> > I am not familiar with pytest, but, based on what we see here, it looks
> > like every single character stored in *xpected_stdout files (including
> > whitespace at the end of lines) matters for the test to pass.

> > I wonder if Kconfig could avoid printing whitespace in command line
> > user dialogs. Then maybe those space characters could be removed from
> > the "*xpected_stdout" files.

BTW this topic is more for linux-kbuild, than u-boot.


> 'make config' display a space at the end of line
> when prompting user input.

> This makes the input readable, like follows:

> *
> * Linux/x86 4.17.0-rc4 Kernel Configuration
> *
> 64-bit kernel (64BIT) [Y/n/?] y
> *
> * General setup
> *
> Cross-compiler tool prefix (CROSS_COMPILE) []
> Compile also drivers which will not load (COMPILE_TEST) [N/y/?] y



> I think you are suggesting to remove a space, like follows:

> *
> * Linux/x86 4.17.0-rc4 Kernel Configuration
> *
> 64-bit kernel (64BIT) [Y/n/?]y
> *
> * General setup
> *
> Cross-compiler tool prefix (CROSS_COMPILE) []
> Compile also drivers which will not load (COMPILE_TEST) [N/y/?]y




> I believe we should not do this
> just for unit-testing.
Yes, that wouldn't make sense.
I just have to be careful when applying patches :)

> > Masahiro?

> > Thanks again!

> > Best regards,
> > Eugeniu.


Kind regards,
Petr

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 4/6] scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987
  2018-05-13 22:45     ` Eugeniu Rosca
@ 2018-05-14 19:52       ` Simon Glass
  2018-05-15 13:46         ` Eugeniu Rosca
  0 siblings, 1 reply; 31+ messages in thread
From: Simon Glass @ 2018-05-14 19:52 UTC (permalink / raw)
  To: u-boot

Hi,

On 13 May 2018 at 16:45, Eugeniu Rosca <roscaeugeniu@gmail.com> wrote:
> Hi Simon,
>
> On Mon, May 14, 2018 at 08:00:40AM +1000, Simon Glass wrote:
>> Hi,
>>
>> On 13 May 2018 at 03:13, Eugeniu Rosca <roscaeugeniu@gmail.com> wrote:
>> > From: Rob Herring <robh@kernel.org>
>> >
>> > This adds the following commits from upstream:
>> >
>> > aadd0b65c987 checks: centralize printing of property names in failure messages
>> > 88960e398907 checks: centralize printing of node path in check_msg
>> > f1879e1a50eb Add limited read-only support for older (V2 and V3) device tree to libfdt.
>> > 37dea76e9700 srcpos: drop special handling of tab
>> > 65893da4aee0 libfdt: overlay: Add missing license
>> > 962a45ca034d Avoid installing pylibfdt when dependencies are missing
>> > cd6ea1b2bea6 Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT}
>> > 51b3a16338df Makefile.tests: Add LIBDL make(1) variable for portability sake
>> > 333d533a8f4d Attempt to auto-detect stat(1) being used if not given proper invocation
>> > e54388015af1 dtc: Bump version to v1.4.6
>> > a1fe86f380cb fdtoverlay: Switch from using alloca to malloc
>> > c8d5472de3ff tests: Improve compatibility with other platforms
>> > c81d389a10cc checks: add chosen node checks
>> > e671852042a7 checks: add aliases node checks
>> > d0c44ebe3f42 checks: check for #{size,address}-cells without child nodes
>> > 18a3d84bb802 checks: add string list check for *-names properties
>> > 8fe94fd6f19f checks: add string list check
>> > 6c5730819604 checks: add a string check for 'label' property
>> > a384191eba09 checks: fix sound-dai phandle with arg property check
>> > b260c4f610c0 Fix ambiguous grammar for devicetree rule
>> > fe667e382bac tests: Add some basic tests for the pci_bridge checks
>> > 7975f6422260 Fix widespread incorrect use of strneq(), replace with new strprefixeq()
>> > fca296445eab Add strstarts() helper function
>> > cc392f089007 tests: Check non-matching cases for fdt_node_check_compatible()
>> > bba26a5291c8 livetree: avoid assertion of orphan phandles with overlays
>> > c8f8194d76cc implement strnlen for systems that need it
>> > c8b38f65fdec libfdt: Remove leading underscores from identifiers
>> > 3b62fdaebfe5 Remove leading underscores from identifiers
>> > 2d45d1c5c65e Replace FDT_VERSION() with stringify()
>> > 2e6fe5a107b5 Fix some errors in comments
>> > b0ae9e4b0ceb tests: Correct warning in sw_tree1.c
>> >
>> > Commit c8b38f65fdec upstream ("libfdt: Remove leading underscores from
>> > identifiers") changed the multiple inclusion define protection, so the
>> > kernel's libfdt_env.h needs the corresponding update.
>> >
>> > Signed-off-by: Rob Herring <robh@kernel.org>
>> > [ Linux commit: 9130ba884640328bb78aaa4840e5ddf06ccafb1c ]
>> > [erosca: - Fixup conflicts in include/linux/libfdt_env.h caused by v2018.03-rc4
>> >            commit b08c8c487083 ("libfdt: move headers to <linux/libfdt.h>
>> >            and <linux/libfdt_env.h>")
>> >          - Fix build errors in lib/libfdt/fdt_ro.c, tools/libfdt/fdt_rw.c by:
>> >            - s/_fdt_mem_rsv/fdt_mem_rsv_/
>> >            - s/_fdt_offset_ptr/fdt_offset_ptr_/
>> >            - s/_fdt_check_node_offset/fdt_check_node_offset_/
>> >            - s/_fdt_check_prop_offset/fdt_check_prop_offset_/
>> >            - s/_fdt_find_add_string/fdt_find_add_string_/]
>> > Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
>> > ---
>> >
>> > v1-v2:
>> > * Newly pushed
>> >
>> >  include/linux/libfdt_env.h           |   6 +-
>> >  lib/libfdt/fdt_ro.c                  |  18 +-
>> >  scripts/dtc/checks.c                 | 439 ++++++++++++++++++---------
>> >  scripts/dtc/dtc-parser.y             |  17 +-
>> >  scripts/dtc/dtc.c                    |   7 +-
>> >  scripts/dtc/dtc.h                    |  11 +-
>> >  scripts/dtc/flattree.c               |   2 +-
>> >  scripts/dtc/libfdt/fdt.c             |  13 +-
>> >  scripts/dtc/libfdt/fdt.h             |   6 +-
>> >  scripts/dtc/libfdt/fdt_overlay.c     |  51 ++++
>> >  scripts/dtc/libfdt/fdt_ro.c          | 132 ++++++--
>> >  scripts/dtc/libfdt/fdt_rw.c          |  90 +++---
>> >  scripts/dtc/libfdt/fdt_sw.c          |  24 +-
>> >  scripts/dtc/libfdt/fdt_wip.c         |  10 +-
>> >  scripts/dtc/libfdt/libfdt.h          |  37 +--
>> >  scripts/dtc/libfdt/libfdt_env.h      |  33 +-
>> >  scripts/dtc/libfdt/libfdt_internal.h |  32 +-
>> >  scripts/dtc/livetree.c               |  10 +-
>> >  scripts/dtc/srcpos.c                 |   5 -
>> >  scripts/dtc/srcpos.h                 |   6 +-
>> >  scripts/dtc/util.h                   |   9 +-
>> >  scripts/dtc/version_gen.h            |   2 +-
>> >  tools/libfdt/fdt_rw.c                |   2 +-
>> >  23 files changed, 632 insertions(+), 330 deletions(-)
>>
>> Can you please check that this does not adversely impact code size?
>
> Sure. Here are the sizes before and after this patch (sandbox):
>
> 1. ELF size comparison shows 96 bytes increase
> $ du -b u-boot.before u-boot.after
>   8055864       u-boot.before
>   8055960       u-boot.after
>
> 2. BIN size comparison shows no change
> $ du -b u-boot.bin.before u-boot.bin.after
>   3377256       u-boot.bin.before
>   3377256       u-boot.bin.after
>
> 3. "size" tool gives more details about ELF file size increase:
> $ size u-boot.before u-boot.after
>    text    data     bss     dec     hex filename
>    1199720        76952  291760 1568432  17eeb0 u-boot.before
>    1199736        76952  291760 1568448  17eec0 u-boot.after

Thanks for the info. That seems OK, but please check sandbox_spl (or
better yet one of the Thumb2 SPL images that uses libfdt) since it is
SPL that matters most.

>
> 4. "bloaty" (diff mode) gives even more details (confirming the above)
> $ bloaty -d compileunits u-boot.after -- u-boot.before
>      VM SIZE                                FILE SIZE
>  --------------                          --------------
>   +2.5%     +30 lib/libfdt/fdt.c             +96  +1.5%
>   [ = ]       0 lib/libfdt/fdt_sw.c          +21  +0.1%
>   +2.6%     +16 [LOAD [RX]]                  +16  +2.6%
>   [ = ]       0 lib/libfdt/fdt_overlay.c     +16  +0.1%
>   [ = ]       0 [section .debug_str]          +2  +0.0%
>   [ = ]       0 fs/ext4/ext4_common.c         -5  -0.0%
>   [ = ]       0 common/fdt_support.c         -11  -0.0%
>   -3.3%     -14 [section .text]              -14  -3.3%
>   [ = ]       0 [Unmapped]                   -25  -0.7%
>   +0.0%     +32 TOTAL                        +96  +0.0%

BTW buildman has a -B flag that shows function size.

Regards,
Simon

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 4/6] scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987
  2018-05-14 19:52       ` Simon Glass
@ 2018-05-15 13:46         ` Eugeniu Rosca
  2018-05-15 16:05           ` Simon Glass
  0 siblings, 1 reply; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-15 13:46 UTC (permalink / raw)
  To: u-boot

Hi Simon,

On Mon, May 14, 2018 at 01:52:09PM -0600, Simon Glass wrote:
> Hi,
> 
> On 13 May 2018 at 16:45, Eugeniu Rosca <roscaeugeniu@gmail.com> wrote:
> > Hi Simon,
> >
> > On Mon, May 14, 2018 at 08:00:40AM +1000, Simon Glass wrote:
> >> Hi,
> >>
> >> Can you please check that this does not adversely impact code size?
> >
> > Sure. Here are the sizes before and after this patch (sandbox):
> >
> > 1. ELF size comparison shows 96 bytes increase
> > $ du -b u-boot.before u-boot.after
> >   8055864       u-boot.before
> >   8055960       u-boot.after
> >
> > 2. BIN size comparison shows no change
> > $ du -b u-boot.bin.before u-boot.bin.after
> >   3377256       u-boot.bin.before
> >   3377256       u-boot.bin.after
> >
> > 3. "size" tool gives more details about ELF file size increase:
> > $ size u-boot.before u-boot.after
> >    text    data     bss     dec     hex filename
> >    1199720        76952  291760 1568432  17eeb0 u-boot.before
> >    1199736        76952  291760 1568448  17eec0 u-boot.after
> 
> Thanks for the info. That seems OK, but please check sandbox_spl (or
> better yet one of the Thumb2 SPL images that uses libfdt) since it is
> SPL that matters most.

I am having issues bringing up buildman on my host, so I just went
through the same procedure of building before and after using make
and comparing the ELF/BIN size for:
1. sandbox_spl_defconfig
2. x600_defconfig

There is no drastic change to previous results.

1.1 sandbox_spl_defconfig ELF size increase: 7394784-7394712 = 72 bytes.
1.2 sandbox_spl_defconfig BIN size increase: 3298280-3298280 = 0 bytes.

2.1 x600_defconfig ELF size increase: 3766144-3766232 = 88 bytes.
2.2 x600_defconfig BIN size increase: 439288-439240 = 48 bytes.

> >
> > 4. "bloaty" (diff mode) gives even more details (confirming the above)
> > $ bloaty -d compileunits u-boot.after -- u-boot.before
> >      VM SIZE                                FILE SIZE
> >  --------------                          --------------
> >   +2.5%     +30 lib/libfdt/fdt.c             +96  +1.5%
> >   [ = ]       0 lib/libfdt/fdt_sw.c          +21  +0.1%
> >   +2.6%     +16 [LOAD [RX]]                  +16  +2.6%
> >   [ = ]       0 lib/libfdt/fdt_overlay.c     +16  +0.1%
> >   [ = ]       0 [section .debug_str]          +2  +0.0%
> >   [ = ]       0 fs/ext4/ext4_common.c         -5  -0.0%
> >   [ = ]       0 common/fdt_support.c         -11  -0.0%
> >   -3.3%     -14 [section .text]              -14  -3.3%
> >   [ = ]       0 [Unmapped]                   -25  -0.7%
> >   +0.0%     +32 TOTAL                        +96  +0.0%
> 
> BTW buildman has a -B flag that shows function size.

Thanks for the tip. The nice thing about bloaty is that it provides
both VM and FILE size numbers. I am not sure if buildman can do the
same. Anyway, this was helpful and is expected to save time on my end
when I manage to bring it up.

> 
> Regards,
> Simon

Regards,
Eugeniu.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 5/6] scripts/dtc: Re-sync with Linux 4.17-rc4
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 5/6] scripts/dtc: Re-sync with Linux 4.17-rc4 Eugeniu Rosca
@ 2018-05-15 14:06   ` Eugeniu Rosca
  2018-05-15 16:05     ` Simon Glass
  2018-05-16  1:48     ` Masahiro Yamada
  0 siblings, 2 replies; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-15 14:06 UTC (permalink / raw)
  To: u-boot

Dear Masahiro, Simon,

I think this patch logically belongs and is tightly coupled to the Linux
4.17-rc4 Kconfig re-sync. Since you skipped it, I wonder if you have a
different view on this.

Most of the Linux commits imported here are actually DTC-specific pieces
from the Linux commits squashed into Kconfig re-sync patch. The idea of
doing that is to create a patch whose scope is limited to DTC. I could
have kept the integrity of Linux commits, which would have extended the
Kconfig re-sync patch to DTC as well. I still can take a different
approach, depending on your feedback. Filtering out this patch doesn't
sound good to me. TIA for your input.

Regards,
Eugeniu.

On Sat, May 12, 2018 at 07:13:30PM +0200, Eugeniu Rosca wrote:
> To achieve a DTC state (more or less) equivalent to Linux 4.17-rc4,
> backport the DTC-specific part from below Linux commits:
> 
> b23d1a241f4eb4 ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
> 9a8dfb394c0467 ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
> 59889300274569 (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
> e039139be8c251 ("scripts/dtc: generate lexer and parser during build instead of shipping")
> b24413180f5600 ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license")
> 
> With this commit, the diff between Linux and U-boot common DTC files is:
> $ git diff --stat --diff-filter=M v4.17-rc4 <this-commit> -- scripts/dtc
>   scripts/dtc/.gitignore | 2 +-
>   scripts/dtc/Makefile   | 3 +++
> 
> The delta is coming from U-boot commits:
> * v2017.11 de163ecedb8a ("scripts: dtc: Add .gitignore")
> * v2018.01 15b97f5c5e6d ("pylibfdt: move pylibfdt to scripts/dtc/pylibfdt and refactor makefile")
> 
> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> ---
> 
> v1->v2:
> * Newly pushed
> 
>  scripts/dtc/.gitignore               |    3 -
>  scripts/dtc/Makefile                 |    4 +-
>  scripts/dtc/dtc-lexer.lex.c_shipped  | 2259 -------------------------
>  scripts/dtc/dtc-parser.tab.c_shipped | 2321 --------------------------
>  scripts/dtc/dtc-parser.tab.h_shipped |  125 --
>  scripts/dtc/update-dtc-source.sh     |    8 +-
>  6 files changed, 3 insertions(+), 4717 deletions(-)
>  delete mode 100644 scripts/dtc/dtc-lexer.lex.c_shipped
>  delete mode 100644 scripts/dtc/dtc-parser.tab.c_shipped
>  delete mode 100644 scripts/dtc/dtc-parser.tab.h_shipped
> 
> diff --git a/scripts/dtc/.gitignore b/scripts/dtc/.gitignore
> index d807c081a250..689b9be0f935 100644
> --- a/scripts/dtc/.gitignore
> +++ b/scripts/dtc/.gitignore
> @@ -1,4 +1 @@
>  /dtc
> -/dtc-lexer.lex.c
> -/dtc-parser.tab.c
> -/dtc-parser.tab.h
> diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
> index 90ef2db85c5f..e999be939831 100644
> --- a/scripts/dtc/Makefile
> +++ b/scripts/dtc/Makefile
> @@ -1,3 +1,4 @@
> +# SPDX-License-Identifier: GPL-2.0
>  # scripts/dtc makefile
>  
>  hostprogs-y	:= dtc
> @@ -27,8 +28,5 @@ HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)
>  # dependencies on generated files need to be listed explicitly
>  $(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
>  
> -# generated files need to be cleaned explicitly
> -clean-files	:= dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h
> -
>  # Added for U-Boot
>  subdir-$(CONFIG_PYLIBFDT) += pylibfdt
> diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped
> deleted file mode 100644
> index 011bb9632ff2..000000000000
> --- a/scripts/dtc/dtc-lexer.lex.c_shipped
> +++ /dev/null
> @@ -1,2259 +0,0 @@
> -#line 2 "dtc-lexer.lex.c"
> -
> -#line 4 "dtc-lexer.lex.c"
> -
> -#define  YY_INT_ALIGNED short int
> -
> -/* A lexical scanner generated by flex */
> -
> -#define FLEX_SCANNER
> -#define YY_FLEX_MAJOR_VERSION 2
> -#define YY_FLEX_MINOR_VERSION 6
> -#define YY_FLEX_SUBMINOR_VERSION 1
> -#if YY_FLEX_SUBMINOR_VERSION > 0
> -#define FLEX_BETA
> -#endif
> -
> -/* First, we deal with  platform-specific or compiler-specific issues. */
> -
> -/* begin standard C headers. */
> -#include <stdio.h>
> -#include <string.h>
> -#include <errno.h>
> -#include <stdlib.h>
> -
> -/* end standard C headers. */
> -
> -/* flex integer type definitions */
> -
> -#ifndef FLEXINT_H
> -#define FLEXINT_H
> -
> -/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
> -
> -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
> -
> -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
> - * if you want the limit (max/min) macros for int types. 
> - */
> -#ifndef __STDC_LIMIT_MACROS
> -#define __STDC_LIMIT_MACROS 1
> -#endif
> -
> -#include <inttypes.h>
> -typedef int8_t flex_int8_t;
> -typedef uint8_t flex_uint8_t;
> -typedef int16_t flex_int16_t;
> -typedef uint16_t flex_uint16_t;
> -typedef int32_t flex_int32_t;
> -typedef uint32_t flex_uint32_t;
> -#else
> -typedef signed char flex_int8_t;
> -typedef short int flex_int16_t;
> -typedef int flex_int32_t;
> -typedef unsigned char flex_uint8_t; 
> -typedef unsigned short int flex_uint16_t;
> -typedef unsigned int flex_uint32_t;
> -
> -/* Limits of integral types. */
> -#ifndef INT8_MIN
> -#define INT8_MIN               (-128)
> -#endif
> -#ifndef INT16_MIN
> -#define INT16_MIN              (-32767-1)
> -#endif
> -#ifndef INT32_MIN
> -#define INT32_MIN              (-2147483647-1)
> -#endif
> -#ifndef INT8_MAX
> -#define INT8_MAX               (127)
> -#endif
> -#ifndef INT16_MAX
> -#define INT16_MAX              (32767)
> -#endif
> -#ifndef INT32_MAX
> -#define INT32_MAX              (2147483647)
> -#endif
> -#ifndef UINT8_MAX
> -#define UINT8_MAX              (255U)
> -#endif
> -#ifndef UINT16_MAX
> -#define UINT16_MAX             (65535U)
> -#endif
> -#ifndef UINT32_MAX
> -#define UINT32_MAX             (4294967295U)
> -#endif
> -
> -#endif /* ! C99 */
> -
> -#endif /* ! FLEXINT_H */
> -
> -/* TODO: this is always defined, so inline it */
> -#define yyconst const
> -
> -#if defined(__GNUC__) && __GNUC__ >= 3
> -#define yynoreturn __attribute__((__noreturn__))
> -#else
> -#define yynoreturn
> -#endif
> -
> -/* Returned upon end-of-file. */
> -#define YY_NULL 0
> -
> -/* Promotes a possibly negative, possibly signed char to an unsigned
> - * integer for use as an array index.  If the signed char is negative,
> - * we want to instead treat it as an 8-bit unsigned char, hence the
> - * double cast.
> - */
> -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
> -
> -/* Enter a start condition.  This macro really ought to take a parameter,
> - * but we do it the disgusting crufty way forced on us by the ()-less
> - * definition of BEGIN.
> - */
> -#define BEGIN (yy_start) = 1 + 2 *
> -
> -/* Translate the current start state into a value that can be later handed
> - * to BEGIN to return to the state.  The YYSTATE alias is for lex
> - * compatibility.
> - */
> -#define YY_START (((yy_start) - 1) / 2)
> -#define YYSTATE YY_START
> -
> -/* Action number for EOF rule of a given start state. */
> -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
> -
> -/* Special action meaning "start processing a new file". */
> -#define YY_NEW_FILE yyrestart(yyin  )
> -
> -#define YY_END_OF_BUFFER_CHAR 0
> -
> -/* Size of default input buffer. */
> -#ifndef YY_BUF_SIZE
> -#ifdef __ia64__
> -/* On IA-64, the buffer size is 16k, not 8k.
> - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
> - * Ditto for the __ia64__ case accordingly.
> - */
> -#define YY_BUF_SIZE 32768
> -#else
> -#define YY_BUF_SIZE 16384
> -#endif /* __ia64__ */
> -#endif
> -
> -/* The state buf must be large enough to hold one state per character in the main buffer.
> - */
> -#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
> -
> -#ifndef YY_TYPEDEF_YY_BUFFER_STATE
> -#define YY_TYPEDEF_YY_BUFFER_STATE
> -typedef struct yy_buffer_state *YY_BUFFER_STATE;
> -#endif
> -
> -#ifndef YY_TYPEDEF_YY_SIZE_T
> -#define YY_TYPEDEF_YY_SIZE_T
> -typedef size_t yy_size_t;
> -#endif
> -
> -extern int yyleng;
> -
> -extern FILE *yyin, *yyout;
> -
> -#define EOB_ACT_CONTINUE_SCAN 0
> -#define EOB_ACT_END_OF_FILE 1
> -#define EOB_ACT_LAST_MATCH 2
> -
> -    #define YY_LESS_LINENO(n)
> -    #define YY_LINENO_REWIND_TO(ptr)
> -    
> -/* Return all but the first "n" matched characters back to the input stream. */
> -#define yyless(n) \
> -	do \
> -		{ \
> -		/* Undo effects of setting up yytext. */ \
> -        int yyless_macro_arg = (n); \
> -        YY_LESS_LINENO(yyless_macro_arg);\
> -		*yy_cp = (yy_hold_char); \
> -		YY_RESTORE_YY_MORE_OFFSET \
> -		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
> -		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
> -		} \
> -	while ( 0 )
> -
> -#define unput(c) yyunput( c, (yytext_ptr)  )
> -
> -#ifndef YY_STRUCT_YY_BUFFER_STATE
> -#define YY_STRUCT_YY_BUFFER_STATE
> -struct yy_buffer_state
> -	{
> -	FILE *yy_input_file;
> -
> -	char *yy_ch_buf;		/* input buffer */
> -	char *yy_buf_pos;		/* current position in input buffer */
> -
> -	/* Size of input buffer in bytes, not including room for EOB
> -	 * characters.
> -	 */
> -	int yy_buf_size;
> -
> -	/* Number of characters read into yy_ch_buf, not including EOB
> -	 * characters.
> -	 */
> -	int yy_n_chars;
> -
> -	/* Whether we "own" the buffer - i.e., we know we created it,
> -	 * and can realloc() it to grow it, and should free() it to
> -	 * delete it.
> -	 */
> -	int yy_is_our_buffer;
> -
> -	/* Whether this is an "interactive" input source; if so, and
> -	 * if we're using stdio for input, then we want to use getc()
> -	 * instead of fread(), to make sure we stop fetching input after
> -	 * each newline.
> -	 */
> -	int yy_is_interactive;
> -
> -	/* Whether we're considered to be at the beginning of a line.
> -	 * If so, '^' rules will be active on the next match, otherwise
> -	 * not.
> -	 */
> -	int yy_at_bol;
> -
> -    int yy_bs_lineno; /**< The line count. */
> -    int yy_bs_column; /**< The column count. */
> -
> -	/* Whether to try to fill the input buffer when we reach the
> -	 * end of it.
> -	 */
> -	int yy_fill_buffer;
> -
> -	int yy_buffer_status;
> -
> -#define YY_BUFFER_NEW 0
> -#define YY_BUFFER_NORMAL 1
> -	/* When an EOF's been seen but there's still some text to process
> -	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
> -	 * shouldn't try reading from the input source any more.  We might
> -	 * still have a bunch of tokens to match, though, because of
> -	 * possible backing-up.
> -	 *
> -	 * When we actually see the EOF, we change the status to "new"
> -	 * (via yyrestart()), so that the user can continue scanning by
> -	 * just pointing yyin at a new input file.
> -	 */
> -#define YY_BUFFER_EOF_PENDING 2
> -
> -	};
> -#endif /* !YY_STRUCT_YY_BUFFER_STATE */
> -
> -/* Stack of input buffers. */
> -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
> -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
> -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
> -
> -/* We provide macros for accessing buffer states in case in the
> - * future we want to put the buffer states in a more general
> - * "scanner state".
> - *
> - * Returns the top of the stack, or NULL.
> - */
> -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
> -                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
> -                          : NULL)
> -
> -/* Same as previous macro, but useful when we know that the buffer stack is not
> - * NULL or when we need an lvalue. For internal use only.
> - */
> -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
> -
> -/* yy_hold_char holds the character lost when yytext is formed. */
> -static char yy_hold_char;
> -static int yy_n_chars;		/* number of characters read into yy_ch_buf */
> -int yyleng;
> -
> -/* Points to current character in buffer. */
> -static char *yy_c_buf_p = NULL;
> -static int yy_init = 0;		/* whether we need to initialize */
> -static int yy_start = 0;	/* start state number */
> -
> -/* Flag which is used to allow yywrap()'s to do buffer switches
> - * instead of setting up a fresh yyin.  A bit of a hack ...
> - */
> -static int yy_did_buffer_switch_on_eof;
> -
> -void yyrestart (FILE *input_file  );
> -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
> -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
> -void yy_delete_buffer (YY_BUFFER_STATE b  );
> -void yy_flush_buffer (YY_BUFFER_STATE b  );
> -void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
> -void yypop_buffer_state (void );
> -
> -static void yyensure_buffer_stack (void );
> -static void yy_load_buffer_state (void );
> -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
> -
> -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
> -
> -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
> -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
> -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
> -
> -void *yyalloc (yy_size_t  );
> -void *yyrealloc (void *,yy_size_t  );
> -void yyfree (void *  );
> -
> -#define yy_new_buffer yy_create_buffer
> -
> -#define yy_set_interactive(is_interactive) \
> -	{ \
> -	if ( ! YY_CURRENT_BUFFER ){ \
> -        yyensure_buffer_stack (); \
> -		YY_CURRENT_BUFFER_LVALUE =    \
> -            yy_create_buffer(yyin,YY_BUF_SIZE ); \
> -	} \
> -	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
> -	}
> -
> -#define yy_set_bol(at_bol) \
> -	{ \
> -	if ( ! YY_CURRENT_BUFFER ){\
> -        yyensure_buffer_stack (); \
> -		YY_CURRENT_BUFFER_LVALUE =    \
> -            yy_create_buffer(yyin,YY_BUF_SIZE ); \
> -	} \
> -	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
> -	}
> -
> -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
> -
> -/* Begin user sect3 */
> -
> -#define yywrap() (/*CONSTCOND*/1)
> -#define YY_SKIP_YYWRAP
> -
> -typedef unsigned char YY_CHAR;
> -
> -FILE *yyin = NULL, *yyout = NULL;
> -
> -typedef int yy_state_type;
> -
> -extern int yylineno;
> -
> -int yylineno = 1;
> -
> -extern char *yytext;
> -#ifdef yytext_ptr
> -#undef yytext_ptr
> -#endif
> -#define yytext_ptr yytext
> -
> -static yy_state_type yy_get_previous_state (void );
> -static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
> -static int yy_get_next_buffer (void );
> -static void yynoreturn yy_fatal_error (yyconst char* msg  );
> -
> -/* Done after the current pattern has been matched and before the
> - * corresponding action - sets up yytext.
> - */
> -#define YY_DO_BEFORE_ACTION \
> -	(yytext_ptr) = yy_bp; \
> -	yyleng = (int) (yy_cp - yy_bp); \
> -	(yy_hold_char) = *yy_cp; \
> -	*yy_cp = '\0'; \
> -	(yy_c_buf_p) = yy_cp;
> -
> -#define YY_NUM_RULES 31
> -#define YY_END_OF_BUFFER 32
> -/* This struct is not used in this scanner,
> -   but its presence is necessary. */
> -struct yy_trans_info
> -	{
> -	flex_int32_t yy_verify;
> -	flex_int32_t yy_nxt;
> -	};
> -static yyconst flex_int16_t yy_accept[166] =
> -    {   0,
> -        0,    0,    0,    0,    0,    0,    0,    0,   32,   30,
> -       19,   19,   30,   30,   30,   30,   30,   30,   30,   30,
> -       30,   30,   30,   30,   30,   30,   16,   17,   17,   30,
> -       17,   11,   11,   19,   27,    0,    3,    0,   28,   13,
> -        0,    0,   12,    0,    0,    0,    0,    0,    0,    0,
> -        0,   22,   24,   26,   25,   23,    0,   10,   29,    0,
> -        0,    0,   15,   15,   17,   17,   17,   11,   11,   11,
> -        0,   13,    0,   12,    0,    0,    0,   21,    0,    0,
> -        0,    0,    0,    0,    0,    0,    0,   17,   11,   11,
> -       11,    0,   14,   20,    0,    0,    0,    0,    0,    0,
> -
> -        0,    0,    0,    0,   17,    0,    0,    0,    0,    0,
> -        0,    0,    0,    0,    0,   17,    7,    0,    0,    0,
> -        0,    0,    0,    0,    2,    0,    0,    0,    0,    0,
> -        0,    0,    0,    0,    4,   18,    0,    0,    5,    2,
> -        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
> -        0,    0,    1,    0,    0,    0,    0,    6,    9,    0,
> -        0,    0,    0,    8,    0
> -    } ;
> -
> -static yyconst YY_CHAR yy_ec[256] =
> -    {   0,
> -        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
> -        4,    4,    4,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    2,    5,    6,    7,    1,    1,    8,    9,    1,
> -        1,   10,   11,   11,   12,   11,   13,   14,   15,   16,
> -       16,   16,   16,   16,   16,   16,   16,   17,    1,   18,
> -       19,   20,   11,   11,   21,   21,   21,   21,   21,   21,
> -       22,   22,   22,   22,   22,   23,   22,   22,   22,   22,
> -       22,   22,   22,   22,   24,   22,   22,   25,   22,   22,
> -        1,   26,   27,    1,   22,    1,   21,   28,   29,   30,
> -
> -       31,   21,   32,   22,   33,   22,   22,   34,   35,   36,
> -       37,   38,   22,   39,   40,   41,   42,   43,   22,   25,
> -       44,   22,   45,   46,   47,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1
> -    } ;
> -
> -static yyconst YY_CHAR yy_meta[48] =
> -    {   0,
> -        1,    1,    1,    1,    1,    1,    2,    3,    1,    2,
> -        2,    2,    4,    5,    5,    5,    6,    1,    1,    1,
> -        7,    8,    8,    8,    8,    1,    1,    7,    7,    7,
> -        7,    8,    8,    8,    8,    8,    8,    8,    8,    8,
> -        8,    8,    8,    8,    3,    1,    4
> -    } ;
> -
> -static yyconst flex_uint16_t yy_base[180] =
> -    {   0,
> -        0,  393,   35,  392,   66,  391,   38,  107,  397,  401,
> -       55,  113,  377,  112,  111,  111,  114,   42,  376,  106,
> -      377,  347,  126,  120,    0,  147,  401,    0,  124,    0,
> -      137,  158,  170,  163,  401,  153,  401,  389,  401,    0,
> -      378,  120,  401,  131,  380,  386,  355,  139,  351,  355,
> -      351,  401,  401,  401,  401,  401,  367,  401,  401,  185,
> -      350,  346,  401,  364,    0,  185,  347,  189,  356,  355,
> -        0,    0,  330,  180,  366,  141,  372,  361,  332,  338,
> -      331,  341,  334,  326,  205,  331,  337,  329,  401,  341,
> -      167,  316,  401,  349,  348,  320,  328,  346,  180,  318,
> -
> -      324,  209,  324,  320,  322,  342,  338,  309,  306,  315,
> -      305,  315,  312,  192,  342,  341,  401,  293,  306,  282,
> -      268,  252,  255,  203,  285,  282,  272,  268,  252,  233,
> -      232,  239,  208,  107,  401,  401,  238,  211,  401,  211,
> -      212,  208,  228,  203,  215,  207,  233,  222,  212,  211,
> -      203,  227,  401,  237,  225,  204,  185,  401,  401,  149,
> -      128,   88,   42,  401,  401,  253,  259,  267,  271,  275,
> -      281,  288,  292,  300,  308,  312,  318,  326,  334
> -    } ;
> -
> -static yyconst flex_int16_t yy_def[180] =
> -    {   0,
> -      165,    1,    1,    3,  165,    5,    1,    1,  165,  165,
> -      165,  165,  165,  166,  167,  168,  165,  165,  165,  165,
> -      169,  165,  165,  165,  170,  169,  165,  171,  172,  171,
> -      171,  165,  165,  165,  165,  166,  165,  166,  165,  173,
> -      165,  168,  165,  168,  174,  175,  165,  165,  165,  165,
> -      165,  165,  165,  165,  165,  165,  169,  165,  165,  165,
> -      165,  165,  165,  169,  171,  172,  171,  165,  165,  165,
> -      176,  173,  177,  168,  174,  174,  175,  165,  165,  165,
> -      165,  165,  165,  165,  165,  165,  165,  171,  165,  165,
> -      176,  177,  165,  165,  165,  165,  165,  165,  165,  165,
> -
> -      165,  165,  165,  165,  171,  165,  165,  165,  165,  165,
> -      165,  165,  165,  178,  165,  171,  165,  165,  165,  165,
> -      165,  165,  165,  178,  165,  178,  165,  165,  165,  165,
> -      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
> -      165,  165,  165,  165,  165,  165,  165,  179,  165,  165,
> -      165,  179,  165,  179,  165,  165,  165,  165,  165,  165,
> -      165,  165,  165,  165,    0,  165,  165,  165,  165,  165,
> -      165,  165,  165,  165,  165,  165,  165,  165,  165
> -    } ;
> -
> -static yyconst flex_uint16_t yy_nxt[449] =
> -    {   0,
> -       10,   11,   12,   11,   13,   14,   10,   15,   16,   10,
> -       10,   10,   17,   10,   10,   10,   10,   18,   19,   20,
> -       21,   21,   21,   21,   21,   10,   10,   21,   21,   21,
> -       21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
> -       21,   21,   21,   21,   10,   22,   10,   24,   25,   25,
> -       25,   32,   33,   33,  164,   26,   34,   34,   34,   52,
> -       53,   27,   26,   26,   26,   26,   10,   11,   12,   11,
> -       13,   14,   28,   15,   16,   28,   28,   28,   24,   28,
> -       28,   28,   10,   18,   19,   20,   29,   29,   29,   29,
> -       29,   30,   10,   29,   29,   29,   29,   29,   29,   29,
> -
> -       29,   29,   29,   29,   29,   29,   29,   29,   29,   29,
> -       10,   22,   10,   23,   34,   34,   34,   37,   39,   43,
> -       32,   33,   33,   45,   55,   56,   46,   60,   43,   45,
> -       65,  163,   46,   65,   65,   65,   44,   38,   60,   74,
> -       58,   47,  141,   48,  142,   44,   49,   47,   50,   48,
> -       76,   51,   62,   94,   50,   41,   44,   51,   37,   61,
> -       64,   64,   64,   58,   34,   34,   34,   64,  162,   80,
> -       67,   68,   68,   68,   64,   64,   64,   64,   38,   81,
> -       69,   70,   71,   68,   68,   68,   60,  161,   43,   69,
> -       70,   65,   69,   70,   65,   65,   65,  125,   85,   85,
> -
> -       85,   58,   68,   68,   68,   44,  102,  110,  125,  133,
> -      102,   69,   70,  111,  114,  160,  159,  126,   85,   85,
> -       85,  140,  140,  140,  140,  140,  140,  153,  126,  147,
> -      147,  147,  153,  148,  147,  147,  147,  158,  148,  165,
> -      157,  156,  155,  151,  150,  149,  146,  154,  145,  144,
> -      143,  139,  154,   36,   36,   36,   36,   36,   36,   36,
> -       36,   40,  138,  137,  136,   40,   40,   42,   42,   42,
> -       42,   42,   42,   42,   42,   57,   57,   57,   57,   63,
> -      135,   63,   65,  134,  165,   65,  133,   65,   65,   66,
> -      132,  131,   66,   66,   66,   66,   72,  130,   72,   72,
> -
> -       75,   75,   75,   75,   75,   75,   75,   75,   77,   77,
> -       77,   77,   77,   77,   77,   77,   91,  129,   91,   92,
> -      128,   92,   92,  127,   92,   92,  124,  124,  124,  124,
> -      124,  124,  124,  124,  152,  152,  152,  152,  152,  152,
> -      152,  152,   60,   60,  123,  122,  121,  120,  119,  118,
> -      117,   45,  116,  111,  115,  113,  112,  109,  108,  107,
> -       46,  106,   93,   89,  105,  104,  103,  101,  100,   99,
> -       98,   97,   96,   95,   78,   76,   93,   90,   89,   88,
> -       58,   87,   86,   58,   84,   83,   82,   79,   78,   76,
> -       73,  165,   59,   58,   54,   35,  165,   31,   23,   23,
> -
> -        9,  165,  165,  165,  165,  165,  165,  165,  165,  165,
> -      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
> -      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
> -      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
> -      165,  165,  165,  165,  165,  165,  165,  165
> -    } ;
> -
> -static yyconst flex_int16_t yy_chk[449] =
> -    {   0,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
> -        1,    1,    1,    1,    1,    1,    1,    3,    3,    3,
> -        3,    7,    7,    7,  163,    3,   11,   11,   11,   18,
> -       18,    3,    3,    3,    3,    3,    5,    5,    5,    5,
> -        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
> -        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
> -        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
> -
> -        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
> -        5,    5,    5,    8,   12,   12,   12,   14,   15,   16,
> -        8,    8,    8,   17,   20,   20,   17,   23,   42,   24,
> -       29,  162,   24,   29,   29,   29,   16,   14,   31,   44,
> -       29,   17,  134,   17,  134,   42,   17,   24,   17,   24,
> -       76,   17,   24,   76,   24,   15,   44,   24,   36,   23,
> -       26,   26,   26,   26,   34,   34,   34,   26,  161,   48,
> -       31,   32,   32,   32,   26,   26,   26,   26,   36,   48,
> -       32,   32,   32,   33,   33,   33,   60,  160,   74,   91,
> -       91,   66,   33,   33,   66,   66,   66,  114,   60,   60,
> -
> -       60,   66,   68,   68,   68,   74,   85,   99,  124,  133,
> -      102,   68,   68,   99,  102,  157,  156,  114,   85,   85,
> -       85,  133,  133,  133,  140,  140,  140,  148,  124,  143,
> -      143,  143,  152,  143,  147,  147,  147,  155,  147,  154,
> -      151,  150,  149,  146,  145,  144,  142,  148,  141,  138,
> -      137,  132,  152,  166,  166,  166,  166,  166,  166,  166,
> -      166,  167,  131,  130,  129,  167,  167,  168,  168,  168,
> -      168,  168,  168,  168,  168,  169,  169,  169,  169,  170,
> -      128,  170,  171,  127,  126,  171,  125,  171,  171,  172,
> -      123,  122,  172,  172,  172,  172,  173,  121,  173,  173,
> -
> -      174,  174,  174,  174,  174,  174,  174,  174,  175,  175,
> -      175,  175,  175,  175,  175,  175,  176,  120,  176,  177,
> -      119,  177,  177,  118,  177,  177,  178,  178,  178,  178,
> -      178,  178,  178,  178,  179,  179,  179,  179,  179,  179,
> -      179,  179,  116,  115,  113,  112,  111,  110,  109,  108,
> -      107,  106,  105,  104,  103,  101,  100,   98,   97,   96,
> -       95,   94,   92,   90,   88,   87,   86,   84,   83,   82,
> -       81,   80,   79,   78,   77,   75,   73,   70,   69,   67,
> -       64,   62,   61,   57,   51,   50,   49,   47,   46,   45,
> -       41,   38,   22,   21,   19,   13,    9,    6,    4,    2,
> -
> -      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
> -      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
> -      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
> -      165,  165,  165,  165,  165,  165,  165,  165,  165,  165,
> -      165,  165,  165,  165,  165,  165,  165,  165
> -    } ;
> -
> -static yy_state_type yy_last_accepting_state;
> -static char *yy_last_accepting_cpos;
> -
> -extern int yy_flex_debug;
> -int yy_flex_debug = 0;
> -
> -/* The intent behind this definition is that it'll catch
> - * any uses of REJECT which flex missed.
> - */
> -#define REJECT reject_used_but_not_detected
> -#define yymore() yymore_used_but_not_detected
> -#define YY_MORE_ADJ 0
> -#define YY_RESTORE_YY_MORE_OFFSET
> -char *yytext;
> -#line 1 "dtc-lexer.l"
> -/*
> - * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
> - *
> - *
> - * This program is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU General Public License as
> - * published by the Free Software Foundation; either version 2 of the
> - * License, or (at your option) any later version.
> - *
> - *  This program is distributed in the hope that it will be useful,
> - *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> - *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> - *  General Public License for more details.
> - *
> - *  You should have received a copy of the GNU General Public License
> - *  along with this program; if not, write to the Free Software
> - *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
> - *                                                                   USA
> - */
> -#define YY_NO_INPUT 1
> -
> -
> -
> -#line 37 "dtc-lexer.l"
> -#include "dtc.h"
> -#include "srcpos.h"
> -#include "dtc-parser.tab.h"
> -
> -YYLTYPE yylloc;
> -extern bool treesource_error;
> -
> -/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
> -#define	YY_USER_ACTION \
> -	{ \
> -		srcpos_update(&yylloc, yytext, yyleng); \
> -	}
> -
> -/*#define LEXDEBUG	1*/
> -
> -#ifdef LEXDEBUG
> -#define DPRINT(fmt, ...)	fprintf(stderr, fmt, ##__VA_ARGS__)
> -#else
> -#define DPRINT(fmt, ...)	do { } while (0)
> -#endif
> -
> -static int dts_version = 1;
> -
> -#define BEGIN_DEFAULT()		DPRINT("<V1>\n"); \
> -				BEGIN(V1); \
> -
> -static void push_input_file(const char *filename);
> -static bool pop_input_file(void);
> -static void PRINTF(1, 2) lexical_error(const char *fmt, ...);
> -
> -#line 661 "dtc-lexer.lex.c"
> -
> -#define INITIAL 0
> -#define BYTESTRING 1
> -#define PROPNODENAME 2
> -#define V1 3
> -
> -#ifndef YY_NO_UNISTD_H
> -/* Special case for "unistd.h", since it is non-ANSI. We include it way
> - * down here because we want the user's section 1 to have been scanned first.
> - * The user has a chance to override it with an option.
> - */
> -#include <unistd.h>
> -#endif
> -
> -#ifndef YY_EXTRA_TYPE
> -#define YY_EXTRA_TYPE void *
> -#endif
> -
> -static int yy_init_globals (void );
> -
> -/* Accessor methods to globals.
> -   These are made visible to non-reentrant scanners for convenience. */
> -
> -int yylex_destroy (void );
> -
> -int yyget_debug (void );
> -
> -void yyset_debug (int debug_flag  );
> -
> -YY_EXTRA_TYPE yyget_extra (void );
> -
> -void yyset_extra (YY_EXTRA_TYPE user_defined  );
> -
> -FILE *yyget_in (void );
> -
> -void yyset_in  (FILE * _in_str  );
> -
> -FILE *yyget_out (void );
> -
> -void yyset_out  (FILE * _out_str  );
> -
> -			int yyget_leng (void );
> -
> -char *yyget_text (void );
> -
> -int yyget_lineno (void );
> -
> -void yyset_lineno (int _line_number  );
> -
> -/* Macros after this point can all be overridden by user definitions in
> - * section 1.
> - */
> -
> -#ifndef YY_SKIP_YYWRAP
> -#ifdef __cplusplus
> -extern "C" int yywrap (void );
> -#else
> -extern int yywrap (void );
> -#endif
> -#endif
> -
> -#ifndef YY_NO_UNPUT
> -    
> -#endif
> -
> -#ifndef yytext_ptr
> -static void yy_flex_strncpy (char *,yyconst char *,int );
> -#endif
> -
> -#ifdef YY_NEED_STRLEN
> -static int yy_flex_strlen (yyconst char * );
> -#endif
> -
> -#ifndef YY_NO_INPUT
> -
> -#ifdef __cplusplus
> -static int yyinput (void );
> -#else
> -static int input (void );
> -#endif
> -
> -#endif
> -
> -/* Amount of stuff to slurp up with each read. */
> -#ifndef YY_READ_BUF_SIZE
> -#ifdef __ia64__
> -/* On IA-64, the buffer size is 16k, not 8k */
> -#define YY_READ_BUF_SIZE 16384
> -#else
> -#define YY_READ_BUF_SIZE 8192
> -#endif /* __ia64__ */
> -#endif
> -
> -/* Copy whatever the last rule matched to the standard output. */
> -#ifndef ECHO
> -/* This used to be an fputs(), but since the string might contain NUL's,
> - * we now use fwrite().
> - */
> -#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
> -#endif
> -
> -/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
> - * is returned in "result".
> - */
> -#ifndef YY_INPUT
> -#define YY_INPUT(buf,result,max_size) \
> -	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
> -		{ \
> -		int c = '*'; \
> -		size_t n; \
> -		for ( n = 0; n < max_size && \
> -			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
> -			buf[n] = (char) c; \
> -		if ( c == '\n' ) \
> -			buf[n++] = (char) c; \
> -		if ( c == EOF && ferror( yyin ) ) \
> -			YY_FATAL_ERROR( "input in flex scanner failed" ); \
> -		result = n; \
> -		} \
> -	else \
> -		{ \
> -		errno=0; \
> -		while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
> -			{ \
> -			if( errno != EINTR) \
> -				{ \
> -				YY_FATAL_ERROR( "input in flex scanner failed" ); \
> -				break; \
> -				} \
> -			errno=0; \
> -			clearerr(yyin); \
> -			} \
> -		}\
> -\
> -
> -#endif
> -
> -/* No semi-colon after return; correct usage is to write "yyterminate();" -
> - * we don't want an extra ';' after the "return" because that will cause
> - * some compilers to complain about unreachable statements.
> - */
> -#ifndef yyterminate
> -#define yyterminate() return YY_NULL
> -#endif
> -
> -/* Number of entries by which start-condition stack grows. */
> -#ifndef YY_START_STACK_INCR
> -#define YY_START_STACK_INCR 25
> -#endif
> -
> -/* Report a fatal error. */
> -#ifndef YY_FATAL_ERROR
> -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
> -#endif
> -
> -/* end tables serialization structures and prototypes */
> -
> -/* Default declaration of generated scanner - a define so the user can
> - * easily add parameters.
> - */
> -#ifndef YY_DECL
> -#define YY_DECL_IS_OURS 1
> -
> -extern int yylex (void);
> -
> -#define YY_DECL int yylex (void)
> -#endif /* !YY_DECL */
> -
> -/* Code executed at the beginning of each rule, after yytext and yyleng
> - * have been set up.
> - */
> -#ifndef YY_USER_ACTION
> -#define YY_USER_ACTION
> -#endif
> -
> -/* Code executed at the end of each rule. */
> -#ifndef YY_BREAK
> -#define YY_BREAK /*LINTED*/break;
> -#endif
> -
> -#define YY_RULE_SETUP \
> -	if ( yyleng > 0 ) \
> -		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
> -				(yytext[yyleng - 1] == '\n'); \
> -	YY_USER_ACTION
> -
> -/** The main scanner function which does all the work.
> - */
> -YY_DECL
> -{
> -	yy_state_type yy_current_state;
> -	char *yy_cp, *yy_bp;
> -	int yy_act;
> -    
> -	if ( !(yy_init) )
> -		{
> -		(yy_init) = 1;
> -
> -#ifdef YY_USER_INIT
> -		YY_USER_INIT;
> -#endif
> -
> -		if ( ! (yy_start) )
> -			(yy_start) = 1;	/* first start state */
> -
> -		if ( ! yyin )
> -			yyin = stdin;
> -
> -		if ( ! yyout )
> -			yyout = stdout;
> -
> -		if ( ! YY_CURRENT_BUFFER ) {
> -			yyensure_buffer_stack ();
> -			YY_CURRENT_BUFFER_LVALUE =
> -				yy_create_buffer(yyin,YY_BUF_SIZE );
> -		}
> -
> -		yy_load_buffer_state( );
> -		}
> -
> -	{
> -#line 69 "dtc-lexer.l"
> -
> -#line 885 "dtc-lexer.lex.c"
> -
> -	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
> -		{
> -		yy_cp = (yy_c_buf_p);
> -
> -		/* Support of yytext. */
> -		*yy_cp = (yy_hold_char);
> -
> -		/* yy_bp points to the position in yy_ch_buf of the start of
> -		 * the current run.
> -		 */
> -		yy_bp = yy_cp;
> -
> -		yy_current_state = (yy_start);
> -		yy_current_state += YY_AT_BOL();
> -yy_match:
> -		do
> -			{
> -			YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
> -			if ( yy_accept[yy_current_state] )
> -				{
> -				(yy_last_accepting_state) = yy_current_state;
> -				(yy_last_accepting_cpos) = yy_cp;
> -				}
> -			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
> -				{
> -				yy_current_state = (int) yy_def[yy_current_state];
> -				if ( yy_current_state >= 166 )
> -					yy_c = yy_meta[(unsigned int) yy_c];
> -				}
> -			yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
> -			++yy_cp;
> -			}
> -		while ( yy_current_state != 165 );
> -		yy_cp = (yy_last_accepting_cpos);
> -		yy_current_state = (yy_last_accepting_state);
> -
> -yy_find_action:
> -		yy_act = yy_accept[yy_current_state];
> -
> -		YY_DO_BEFORE_ACTION;
> -
> -do_action:	/* This label is used only to access EOF actions. */
> -
> -		switch ( yy_act )
> -	{ /* beginning of action switch */
> -			case 0: /* must back up */
> -			/* undo the effects of YY_DO_BEFORE_ACTION */
> -			*yy_cp = (yy_hold_char);
> -			yy_cp = (yy_last_accepting_cpos);
> -			yy_current_state = (yy_last_accepting_state);
> -			goto yy_find_action;
> -
> -case 1:
> -/* rule 1 can match eol */
> -YY_RULE_SETUP
> -#line 70 "dtc-lexer.l"
> -{
> -			char *name = strchr(yytext, '\"') + 1;
> -			yytext[yyleng-1] = '\0';
> -			push_input_file(name);
> -		}
> -	YY_BREAK
> -case 2:
> -/* rule 2 can match eol */
> -YY_RULE_SETUP
> -#line 76 "dtc-lexer.l"
> -{
> -			char *line, *fnstart, *fnend;
> -			struct data fn;
> -			/* skip text before line # */
> -			line = yytext;
> -			while (!isdigit((unsigned char)*line))
> -				line++;
> -
> -			/* regexp ensures that first and list "
> -			 * in the whole yytext are those at
> -			 * beginning and end of the filename string */
> -			fnstart = memchr(yytext, '"', yyleng);
> -			for (fnend = yytext + yyleng - 1;
> -			     *fnend != '"'; fnend--)
> -				;
> -			assert(fnstart && fnend && (fnend > fnstart));
> -
> -			fn = data_copy_escape_string(fnstart + 1,
> -						     fnend - fnstart - 1);
> -
> -			/* Don't allow nuls in filenames */
> -			if (memchr(fn.val, '\0', fn.len - 1))
> -				lexical_error("nul in line number directive");
> -
> -			/* -1 since #line is the number of the next line */
> -			srcpos_set_line(xstrdup(fn.val), atoi(line) - 1);
> -			data_free(fn);
> -		}
> -	YY_BREAK
> -case YY_STATE_EOF(INITIAL):
> -case YY_STATE_EOF(BYTESTRING):
> -case YY_STATE_EOF(PROPNODENAME):
> -case YY_STATE_EOF(V1):
> -#line 105 "dtc-lexer.l"
> -{
> -			if (!pop_input_file()) {
> -				yyterminate();
> -			}
> -		}
> -	YY_BREAK
> -case 3:
> -/* rule 3 can match eol */
> -YY_RULE_SETUP
> -#line 111 "dtc-lexer.l"
> -{
> -			DPRINT("String: %s\n", yytext);
> -			yylval.data = data_copy_escape_string(yytext+1,
> -					yyleng-2);
> -			return DT_STRING;
> -		}
> -	YY_BREAK
> -case 4:
> -YY_RULE_SETUP
> -#line 118 "dtc-lexer.l"
> -{
> -			DPRINT("Keyword: /dts-v1/\n");
> -			dts_version = 1;
> -			BEGIN_DEFAULT();
> -			return DT_V1;
> -		}
> -	YY_BREAK
> -case 5:
> -YY_RULE_SETUP
> -#line 125 "dtc-lexer.l"
> -{
> -			DPRINT("Keyword: /plugin/\n");
> -			return DT_PLUGIN;
> -		}
> -	YY_BREAK
> -case 6:
> -YY_RULE_SETUP
> -#line 130 "dtc-lexer.l"
> -{
> -			DPRINT("Keyword: /memreserve/\n");
> -			BEGIN_DEFAULT();
> -			return DT_MEMRESERVE;
> -		}
> -	YY_BREAK
> -case 7:
> -YY_RULE_SETUP
> -#line 136 "dtc-lexer.l"
> -{
> -			DPRINT("Keyword: /bits/\n");
> -			BEGIN_DEFAULT();
> -			return DT_BITS;
> -		}
> -	YY_BREAK
> -case 8:
> -YY_RULE_SETUP
> -#line 142 "dtc-lexer.l"
> -{
> -			DPRINT("Keyword: /delete-property/\n");
> -			DPRINT("<PROPNODENAME>\n");
> -			BEGIN(PROPNODENAME);
> -			return DT_DEL_PROP;
> -		}
> -	YY_BREAK
> -case 9:
> -YY_RULE_SETUP
> -#line 149 "dtc-lexer.l"
> -{
> -			DPRINT("Keyword: /delete-node/\n");
> -			DPRINT("<PROPNODENAME>\n");
> -			BEGIN(PROPNODENAME);
> -			return DT_DEL_NODE;
> -		}
> -	YY_BREAK
> -case 10:
> -YY_RULE_SETUP
> -#line 156 "dtc-lexer.l"
> -{
> -			DPRINT("Label: %s\n", yytext);
> -			yylval.labelref = xstrdup(yytext);
> -			yylval.labelref[yyleng-1] = '\0';
> -			return DT_LABEL;
> -		}
> -	YY_BREAK
> -case 11:
> -YY_RULE_SETUP
> -#line 163 "dtc-lexer.l"
> -{
> -			char *e;
> -			DPRINT("Integer Literal: '%s'\n", yytext);
> -
> -			errno = 0;
> -			yylval.integer = strtoull(yytext, &e, 0);
> -
> -			if (*e && e[strspn(e, "UL")]) {
> -				lexical_error("Bad integer literal '%s'",
> -					      yytext);
> -			}
> -
> -			if (errno == ERANGE)
> -				lexical_error("Integer literal '%s' out of range",
> -					      yytext);
> -			else
> -				/* ERANGE is the only strtoull error triggerable
> -				 *  by strings matching the pattern */
> -				assert(errno == 0);
> -			return DT_LITERAL;
> -		}
> -	YY_BREAK
> -case 12:
> -/* rule 12 can match eol */
> -YY_RULE_SETUP
> -#line 185 "dtc-lexer.l"
> -{
> -			struct data d;
> -			DPRINT("Character literal: %s\n", yytext);
> -
> -			d = data_copy_escape_string(yytext+1, yyleng-2);
> -			if (d.len == 1) {
> -				lexical_error("Empty character literal");
> -				yylval.integer = 0;
> -			} else {
> -				yylval.integer = (unsigned char)d.val[0];
> -
> -				if (d.len > 2)
> -					lexical_error("Character literal has %d"
> -						      " characters instead of 1",
> -						      d.len - 1);
> -			}
> -
> -			data_free(d);
> -			return DT_CHAR_LITERAL;
> -		}
> -	YY_BREAK
> -case 13:
> -YY_RULE_SETUP
> -#line 206 "dtc-lexer.l"
> -{	/* label reference */
> -			DPRINT("Ref: %s\n", yytext+1);
> -			yylval.labelref = xstrdup(yytext+1);
> -			return DT_REF;
> -		}
> -	YY_BREAK
> -case 14:
> -YY_RULE_SETUP
> -#line 212 "dtc-lexer.l"
> -{	/* new-style path reference */
> -			yytext[yyleng-1] = '\0';
> -			DPRINT("Ref: %s\n", yytext+2);
> -			yylval.labelref = xstrdup(yytext+2);
> -			return DT_REF;
> -		}
> -	YY_BREAK
> -case 15:
> -YY_RULE_SETUP
> -#line 219 "dtc-lexer.l"
> -{
> -			yylval.byte = strtol(yytext, NULL, 16);
> -			DPRINT("Byte: %02x\n", (int)yylval.byte);
> -			return DT_BYTE;
> -		}
> -	YY_BREAK
> -case 16:
> -YY_RULE_SETUP
> -#line 225 "dtc-lexer.l"
> -{
> -			DPRINT("/BYTESTRING\n");
> -			BEGIN_DEFAULT();
> -			return ']';
> -		}
> -	YY_BREAK
> -case 17:
> -YY_RULE_SETUP
> -#line 231 "dtc-lexer.l"
> -{
> -			DPRINT("PropNodeName: %s\n", yytext);
> -			yylval.propnodename = xstrdup((yytext[0] == '\\') ?
> -							yytext + 1 : yytext);
> -			BEGIN_DEFAULT();
> -			return DT_PROPNODENAME;
> -		}
> -	YY_BREAK
> -case 18:
> -YY_RULE_SETUP
> -#line 239 "dtc-lexer.l"
> -{
> -			DPRINT("Binary Include\n");
> -			return DT_INCBIN;
> -		}
> -	YY_BREAK
> -case 19:
> -/* rule 19 can match eol */
> -YY_RULE_SETUP
> -#line 244 "dtc-lexer.l"
> -/* eat whitespace */
> -	YY_BREAK
> -case 20:
> -/* rule 20 can match eol */
> -YY_RULE_SETUP
> -#line 245 "dtc-lexer.l"
> -/* eat C-style comments */
> -	YY_BREAK
> -case 21:
> -/* rule 21 can match eol */
> -YY_RULE_SETUP
> -#line 246 "dtc-lexer.l"
> -/* eat C++-style comments */
> -	YY_BREAK
> -case 22:
> -YY_RULE_SETUP
> -#line 248 "dtc-lexer.l"
> -{ return DT_LSHIFT; };
> -	YY_BREAK
> -case 23:
> -YY_RULE_SETUP
> -#line 249 "dtc-lexer.l"
> -{ return DT_RSHIFT; };
> -	YY_BREAK
> -case 24:
> -YY_RULE_SETUP
> -#line 250 "dtc-lexer.l"
> -{ return DT_LE; };
> -	YY_BREAK
> -case 25:
> -YY_RULE_SETUP
> -#line 251 "dtc-lexer.l"
> -{ return DT_GE; };
> -	YY_BREAK
> -case 26:
> -YY_RULE_SETUP
> -#line 252 "dtc-lexer.l"
> -{ return DT_EQ; };
> -	YY_BREAK
> -case 27:
> -YY_RULE_SETUP
> -#line 253 "dtc-lexer.l"
> -{ return DT_NE; };
> -	YY_BREAK
> -case 28:
> -YY_RULE_SETUP
> -#line 254 "dtc-lexer.l"
> -{ return DT_AND; };
> -	YY_BREAK
> -case 29:
> -YY_RULE_SETUP
> -#line 255 "dtc-lexer.l"
> -{ return DT_OR; };
> -	YY_BREAK
> -case 30:
> -YY_RULE_SETUP
> -#line 257 "dtc-lexer.l"
> -{
> -			DPRINT("Char: %c (\\x%02x)\n", yytext[0],
> -				(unsigned)yytext[0]);
> -			if (yytext[0] == '[') {
> -				DPRINT("<BYTESTRING>\n");
> -				BEGIN(BYTESTRING);
> -			}
> -			if ((yytext[0] == '{')
> -			    || (yytext[0] == ';')) {
> -				DPRINT("<PROPNODENAME>\n");
> -				BEGIN(PROPNODENAME);
> -			}
> -			return yytext[0];
> -		}
> -	YY_BREAK
> -case 31:
> -YY_RULE_SETUP
> -#line 272 "dtc-lexer.l"
> -ECHO;
> -	YY_BREAK
> -#line 1257 "dtc-lexer.lex.c"
> -
> -	case YY_END_OF_BUFFER:
> -		{
> -		/* Amount of text matched not including the EOB char. */
> -		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
> -
> -		/* Undo the effects of YY_DO_BEFORE_ACTION. */
> -		*yy_cp = (yy_hold_char);
> -		YY_RESTORE_YY_MORE_OFFSET
> -
> -		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
> -			{
> -			/* We're scanning a new file or input source.  It's
> -			 * possible that this happened because the user
> -			 * just pointed yyin at a new source and called
> -			 * yylex().  If so, then we have to assure
> -			 * consistency between YY_CURRENT_BUFFER and our
> -			 * globals.  Here is the right place to do so, because
> -			 * this is the first action (other than possibly a
> -			 * back-up) that will match for the new input source.
> -			 */
> -			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
> -			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
> -			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
> -			}
> -
> -		/* Note that here we test for yy_c_buf_p "<=" to the position
> -		 * of the first EOB in the buffer, since yy_c_buf_p will
> -		 * already have been incremented past the NUL character
> -		 * (since all states make transitions on EOB to the
> -		 * end-of-buffer state).  Contrast this with the test
> -		 * in input().
> -		 */
> -		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
> -			{ /* This was really a NUL. */
> -			yy_state_type yy_next_state;
> -
> -			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
> -
> -			yy_current_state = yy_get_previous_state(  );
> -
> -			/* Okay, we're now positioned to make the NUL
> -			 * transition.  We couldn't have
> -			 * yy_get_previous_state() go ahead and do it
> -			 * for us because it doesn't know how to deal
> -			 * with the possibility of jamming (and we don't
> -			 * want to build jamming into it because then it
> -			 * will run more slowly).
> -			 */
> -
> -			yy_next_state = yy_try_NUL_trans( yy_current_state );
> -
> -			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
> -
> -			if ( yy_next_state )
> -				{
> -				/* Consume the NUL. */
> -				yy_cp = ++(yy_c_buf_p);
> -				yy_current_state = yy_next_state;
> -				goto yy_match;
> -				}
> -
> -			else
> -				{
> -				yy_cp = (yy_last_accepting_cpos);
> -				yy_current_state = (yy_last_accepting_state);
> -				goto yy_find_action;
> -				}
> -			}
> -
> -		else switch ( yy_get_next_buffer(  ) )
> -			{
> -			case EOB_ACT_END_OF_FILE:
> -				{
> -				(yy_did_buffer_switch_on_eof) = 0;
> -
> -				if ( yywrap( ) )
> -					{
> -					/* Note: because we've taken care in
> -					 * yy_get_next_buffer() to have set up
> -					 * yytext, we can now set up
> -					 * yy_c_buf_p so that if some total
> -					 * hoser (like flex itself) wants to
> -					 * call the scanner after we return the
> -					 * YY_NULL, it'll still work - another
> -					 * YY_NULL will get returned.
> -					 */
> -					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
> -
> -					yy_act = YY_STATE_EOF(YY_START);
> -					goto do_action;
> -					}
> -
> -				else
> -					{
> -					if ( ! (yy_did_buffer_switch_on_eof) )
> -						YY_NEW_FILE;
> -					}
> -				break;
> -				}
> -
> -			case EOB_ACT_CONTINUE_SCAN:
> -				(yy_c_buf_p) =
> -					(yytext_ptr) + yy_amount_of_matched_text;
> -
> -				yy_current_state = yy_get_previous_state(  );
> -
> -				yy_cp = (yy_c_buf_p);
> -				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
> -				goto yy_match;
> -
> -			case EOB_ACT_LAST_MATCH:
> -				(yy_c_buf_p) =
> -				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
> -
> -				yy_current_state = yy_get_previous_state(  );
> -
> -				yy_cp = (yy_c_buf_p);
> -				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
> -				goto yy_find_action;
> -			}
> -		break;
> -		}
> -
> -	default:
> -		YY_FATAL_ERROR(
> -			"fatal flex scanner internal error--no action found" );
> -	} /* end of action switch */
> -		} /* end of scanning one token */
> -	} /* end of user's declarations */
> -} /* end of yylex */
> -
> -/* yy_get_next_buffer - try to read in a new buffer
> - *
> - * Returns a code representing an action:
> - *	EOB_ACT_LAST_MATCH -
> - *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
> - *	EOB_ACT_END_OF_FILE - end of file
> - */
> -static int yy_get_next_buffer (void)
> -{
> -    	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
> -	char *source = (yytext_ptr);
> -	int number_to_move, i;
> -	int ret_val;
> -
> -	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
> -		YY_FATAL_ERROR(
> -		"fatal flex scanner internal error--end of buffer missed" );
> -
> -	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
> -		{ /* Don't try to fill the buffer, so this is an EOF. */
> -		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
> -			{
> -			/* We matched a single character, the EOB, so
> -			 * treat this as a final EOF.
> -			 */
> -			return EOB_ACT_END_OF_FILE;
> -			}
> -
> -		else
> -			{
> -			/* We matched some text prior to the EOB, first
> -			 * process it.
> -			 */
> -			return EOB_ACT_LAST_MATCH;
> -			}
> -		}
> -
> -	/* Try to read more data. */
> -
> -	/* First move last chars to start of buffer. */
> -	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
> -
> -	for ( i = 0; i < number_to_move; ++i )
> -		*(dest++) = *(source++);
> -
> -	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
> -		/* don't do the read, it's not guaranteed to return an EOF,
> -		 * just force an EOF
> -		 */
> -		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
> -
> -	else
> -		{
> -			int num_to_read =
> -			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
> -
> -		while ( num_to_read <= 0 )
> -			{ /* Not enough room in the buffer - grow it. */
> -
> -			/* just a shorter name for the current buffer */
> -			YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
> -
> -			int yy_c_buf_p_offset =
> -				(int) ((yy_c_buf_p) - b->yy_ch_buf);
> -
> -			if ( b->yy_is_our_buffer )
> -				{
> -				int new_size = b->yy_buf_size * 2;
> -
> -				if ( new_size <= 0 )
> -					b->yy_buf_size += b->yy_buf_size / 8;
> -				else
> -					b->yy_buf_size *= 2;
> -
> -				b->yy_ch_buf = (char *)
> -					/* Include room in for 2 EOB chars. */
> -					yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
> -				}
> -			else
> -				/* Can't grow it, we don't own it. */
> -				b->yy_ch_buf = NULL;
> -
> -			if ( ! b->yy_ch_buf )
> -				YY_FATAL_ERROR(
> -				"fatal error - scanner input buffer overflow" );
> -
> -			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
> -
> -			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
> -						number_to_move - 1;
> -
> -			}
> -
> -		if ( num_to_read > YY_READ_BUF_SIZE )
> -			num_to_read = YY_READ_BUF_SIZE;
> -
> -		/* Read in more data. */
> -		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
> -			(yy_n_chars), num_to_read );
> -
> -		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
> -		}
> -
> -	if ( (yy_n_chars) == 0 )
> -		{
> -		if ( number_to_move == YY_MORE_ADJ )
> -			{
> -			ret_val = EOB_ACT_END_OF_FILE;
> -			yyrestart(yyin  );
> -			}
> -
> -		else
> -			{
> -			ret_val = EOB_ACT_LAST_MATCH;
> -			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
> -				YY_BUFFER_EOF_PENDING;
> -			}
> -		}
> -
> -	else
> -		ret_val = EOB_ACT_CONTINUE_SCAN;
> -
> -	if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
> -		/* Extend the array by 50%, plus the number we really need. */
> -		int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
> -		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
> -		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
> -			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
> -	}
> -
> -	(yy_n_chars) += number_to_move;
> -	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
> -	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
> -
> -	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
> -
> -	return ret_val;
> -}
> -
> -/* yy_get_previous_state - get the state just before the EOB char was reached */
> -
> -    static yy_state_type yy_get_previous_state (void)
> -{
> -	yy_state_type yy_current_state;
> -	char *yy_cp;
> -    
> -	yy_current_state = (yy_start);
> -	yy_current_state += YY_AT_BOL();
> -
> -	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
> -		{
> -		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
> -		if ( yy_accept[yy_current_state] )
> -			{
> -			(yy_last_accepting_state) = yy_current_state;
> -			(yy_last_accepting_cpos) = yy_cp;
> -			}
> -		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
> -			{
> -			yy_current_state = (int) yy_def[yy_current_state];
> -			if ( yy_current_state >= 166 )
> -				yy_c = yy_meta[(unsigned int) yy_c];
> -			}
> -		yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
> -		}
> -
> -	return yy_current_state;
> -}
> -
> -/* yy_try_NUL_trans - try to make a transition on the NUL character
> - *
> - * synopsis
> - *	next_state = yy_try_NUL_trans( current_state );
> - */
> -    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
> -{
> -	int yy_is_jam;
> -    	char *yy_cp = (yy_c_buf_p);
> -
> -	YY_CHAR yy_c = 1;
> -	if ( yy_accept[yy_current_state] )
> -		{
> -		(yy_last_accepting_state) = yy_current_state;
> -		(yy_last_accepting_cpos) = yy_cp;
> -		}
> -	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
> -		{
> -		yy_current_state = (int) yy_def[yy_current_state];
> -		if ( yy_current_state >= 166 )
> -			yy_c = yy_meta[(unsigned int) yy_c];
> -		}
> -	yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
> -	yy_is_jam = (yy_current_state == 165);
> -
> -		return yy_is_jam ? 0 : yy_current_state;
> -}
> -
> -#ifndef YY_NO_UNPUT
> -
> -#endif
> -
> -#ifndef YY_NO_INPUT
> -#ifdef __cplusplus
> -    static int yyinput (void)
> -#else
> -    static int input  (void)
> -#endif
> -
> -{
> -	int c;
> -    
> -	*(yy_c_buf_p) = (yy_hold_char);
> -
> -	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
> -		{
> -		/* yy_c_buf_p now points to the character we want to return.
> -		 * If this occurs *before* the EOB characters, then it's a
> -		 * valid NUL; if not, then we've hit the end of the buffer.
> -		 */
> -		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
> -			/* This was really a NUL. */
> -			*(yy_c_buf_p) = '\0';
> -
> -		else
> -			{ /* need more input */
> -			int offset = (yy_c_buf_p) - (yytext_ptr);
> -			++(yy_c_buf_p);
> -
> -			switch ( yy_get_next_buffer(  ) )
> -				{
> -				case EOB_ACT_LAST_MATCH:
> -					/* This happens because yy_g_n_b()
> -					 * sees that we've accumulated a
> -					 * token and flags that we need to
> -					 * try matching the token before
> -					 * proceeding.  But for input(),
> -					 * there's no matching to consider.
> -					 * So convert the EOB_ACT_LAST_MATCH
> -					 * to EOB_ACT_END_OF_FILE.
> -					 */
> -
> -					/* Reset buffer status. */
> -					yyrestart(yyin );
> -
> -					/*FALLTHROUGH*/
> -
> -				case EOB_ACT_END_OF_FILE:
> -					{
> -					if ( yywrap( ) )
> -						return 0;
> -
> -					if ( ! (yy_did_buffer_switch_on_eof) )
> -						YY_NEW_FILE;
> -#ifdef __cplusplus
> -					return yyinput();
> -#else
> -					return input();
> -#endif
> -					}
> -
> -				case EOB_ACT_CONTINUE_SCAN:
> -					(yy_c_buf_p) = (yytext_ptr) + offset;
> -					break;
> -				}
> -			}
> -		}
> -
> -	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
> -	*(yy_c_buf_p) = '\0';	/* preserve yytext */
> -	(yy_hold_char) = *++(yy_c_buf_p);
> -
> -	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
> -
> -	return c;
> -}
> -#endif	/* ifndef YY_NO_INPUT */
> -
> -/** Immediately switch to a different input stream.
> - * @param input_file A readable stream.
> - * 
> - * @note This function does not reset the start condition to @c INITIAL .
> - */
> -    void yyrestart  (FILE * input_file )
> -{
> -    
> -	if ( ! YY_CURRENT_BUFFER ){
> -        yyensure_buffer_stack ();
> -		YY_CURRENT_BUFFER_LVALUE =
> -            yy_create_buffer(yyin,YY_BUF_SIZE );
> -	}
> -
> -	yy_init_buffer(YY_CURRENT_BUFFER,input_file );
> -	yy_load_buffer_state( );
> -}
> -
> -/** Switch to a different input buffer.
> - * @param new_buffer The new input buffer.
> - * 
> - */
> -    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
> -{
> -    
> -	/* TODO. We should be able to replace this entire function body
> -	 * with
> -	 *		yypop_buffer_state();
> -	 *		yypush_buffer_state(new_buffer);
> -     */
> -	yyensure_buffer_stack ();
> -	if ( YY_CURRENT_BUFFER == new_buffer )
> -		return;
> -
> -	if ( YY_CURRENT_BUFFER )
> -		{
> -		/* Flush out information for old buffer. */
> -		*(yy_c_buf_p) = (yy_hold_char);
> -		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
> -		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
> -		}
> -
> -	YY_CURRENT_BUFFER_LVALUE = new_buffer;
> -	yy_load_buffer_state( );
> -
> -	/* We don't actually know whether we did this switch during
> -	 * EOF (yywrap()) processing, but the only time this flag
> -	 * is looked at is after yywrap() is called, so it's safe
> -	 * to go ahead and always set it.
> -	 */
> -	(yy_did_buffer_switch_on_eof) = 1;
> -}
> -
> -static void yy_load_buffer_state  (void)
> -{
> -    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
> -	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
> -	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
> -	(yy_hold_char) = *(yy_c_buf_p);
> -}
> -
> -/** Allocate and initialize an input buffer state.
> - * @param file A readable stream.
> - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
> - * 
> - * @return the allocated buffer state.
> - */
> -    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
> -{
> -	YY_BUFFER_STATE b;
> -    
> -	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
> -	if ( ! b )
> -		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
> -
> -	b->yy_buf_size = (yy_size_t)size;
> -
> -	/* yy_ch_buf has to be 2 characters longer than the size given because
> -	 * we need to put in 2 end-of-buffer characters.
> -	 */
> -	b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
> -	if ( ! b->yy_ch_buf )
> -		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
> -
> -	b->yy_is_our_buffer = 1;
> -
> -	yy_init_buffer(b,file );
> -
> -	return b;
> -}
> -
> -/** Destroy the buffer.
> - * @param b a buffer created with yy_create_buffer()
> - * 
> - */
> -    void yy_delete_buffer (YY_BUFFER_STATE  b )
> -{
> -    
> -	if ( ! b )
> -		return;
> -
> -	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
> -		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
> -
> -	if ( b->yy_is_our_buffer )
> -		yyfree((void *) b->yy_ch_buf  );
> -
> -	yyfree((void *) b  );
> -}
> -
> -/* Initializes or reinitializes a buffer.
> - * This function is sometimes called more than once on the same buffer,
> - * such as during a yyrestart() or at EOF.
> - */
> -    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
> -
> -{
> -	int oerrno = errno;
> -    
> -	yy_flush_buffer(b );
> -
> -	b->yy_input_file = file;
> -	b->yy_fill_buffer = 1;
> -
> -    /* If b is the current buffer, then yy_init_buffer was _probably_
> -     * called from yyrestart() or through yy_get_next_buffer.
> -     * In that case, we don't want to reset the lineno or column.
> -     */
> -    if (b != YY_CURRENT_BUFFER){
> -        b->yy_bs_lineno = 1;
> -        b->yy_bs_column = 0;
> -    }
> -
> -        b->yy_is_interactive = 0;
> -    
> -	errno = oerrno;
> -}
> -
> -/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
> - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
> - * 
> - */
> -    void yy_flush_buffer (YY_BUFFER_STATE  b )
> -{
> -    	if ( ! b )
> -		return;
> -
> -	b->yy_n_chars = 0;
> -
> -	/* We always need two end-of-buffer characters.  The first causes
> -	 * a transition to the end-of-buffer state.  The second causes
> -	 * a jam in that state.
> -	 */
> -	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
> -	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
> -
> -	b->yy_buf_pos = &b->yy_ch_buf[0];
> -
> -	b->yy_at_bol = 1;
> -	b->yy_buffer_status = YY_BUFFER_NEW;
> -
> -	if ( b == YY_CURRENT_BUFFER )
> -		yy_load_buffer_state( );
> -}
> -
> -/** Pushes the new state onto the stack. The new state becomes
> - *  the current state. This function will allocate the stack
> - *  if necessary.
> - *  @param new_buffer The new state.
> - *  
> - */
> -void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
> -{
> -    	if (new_buffer == NULL)
> -		return;
> -
> -	yyensure_buffer_stack();
> -
> -	/* This block is copied from yy_switch_to_buffer. */
> -	if ( YY_CURRENT_BUFFER )
> -		{
> -		/* Flush out information for old buffer. */
> -		*(yy_c_buf_p) = (yy_hold_char);
> -		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
> -		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
> -		}
> -
> -	/* Only push if top exists. Otherwise, replace top. */
> -	if (YY_CURRENT_BUFFER)
> -		(yy_buffer_stack_top)++;
> -	YY_CURRENT_BUFFER_LVALUE = new_buffer;
> -
> -	/* copied from yy_switch_to_buffer. */
> -	yy_load_buffer_state( );
> -	(yy_did_buffer_switch_on_eof) = 1;
> -}
> -
> -/** Removes and deletes the top of the stack, if present.
> - *  The next element becomes the new top.
> - *  
> - */
> -void yypop_buffer_state (void)
> -{
> -    	if (!YY_CURRENT_BUFFER)
> -		return;
> -
> -	yy_delete_buffer(YY_CURRENT_BUFFER );
> -	YY_CURRENT_BUFFER_LVALUE = NULL;
> -	if ((yy_buffer_stack_top) > 0)
> -		--(yy_buffer_stack_top);
> -
> -	if (YY_CURRENT_BUFFER) {
> -		yy_load_buffer_state( );
> -		(yy_did_buffer_switch_on_eof) = 1;
> -	}
> -}
> -
> -/* Allocates the stack if it does not exist.
> - *  Guarantees space for at least one push.
> - */
> -static void yyensure_buffer_stack (void)
> -{
> -	int num_to_alloc;
> -    
> -	if (!(yy_buffer_stack)) {
> -
> -		/* First allocation is just for 2 elements, since we don't know if this
> -		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
> -		 * immediate realloc on the next call.
> -         */
> -      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
> -		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
> -								(num_to_alloc * sizeof(struct yy_buffer_state*)
> -								);
> -		if ( ! (yy_buffer_stack) )
> -			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
> -
> -		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
> -
> -		(yy_buffer_stack_max) = num_to_alloc;
> -		(yy_buffer_stack_top) = 0;
> -		return;
> -	}
> -
> -	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
> -
> -		/* Increase the buffer to prepare for a possible push. */
> -		yy_size_t grow_size = 8 /* arbitrary grow size */;
> -
> -		num_to_alloc = (yy_buffer_stack_max) + grow_size;
> -		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
> -								((yy_buffer_stack),
> -								num_to_alloc * sizeof(struct yy_buffer_state*)
> -								);
> -		if ( ! (yy_buffer_stack) )
> -			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
> -
> -		/* zero only the new slots.*/
> -		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
> -		(yy_buffer_stack_max) = num_to_alloc;
> -	}
> -}
> -
> -/** Setup the input buffer state to scan directly from a user-specified character buffer.
> - * @param base the character buffer
> - * @param size the size in bytes of the character buffer
> - * 
> - * @return the newly allocated buffer state object.
> - */
> -YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
> -{
> -	YY_BUFFER_STATE b;
> -    
> -	if ( size < 2 ||
> -	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
> -	     base[size-1] != YY_END_OF_BUFFER_CHAR )
> -		/* They forgot to leave room for the EOB's. */
> -		return NULL;
> -
> -	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
> -	if ( ! b )
> -		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
> -
> -	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
> -	b->yy_buf_pos = b->yy_ch_buf = base;
> -	b->yy_is_our_buffer = 0;
> -	b->yy_input_file = NULL;
> -	b->yy_n_chars = b->yy_buf_size;
> -	b->yy_is_interactive = 0;
> -	b->yy_at_bol = 1;
> -	b->yy_fill_buffer = 0;
> -	b->yy_buffer_status = YY_BUFFER_NEW;
> -
> -	yy_switch_to_buffer(b  );
> -
> -	return b;
> -}
> -
> -/** Setup the input buffer state to scan a string. The next call to yylex() will
> - * scan from a @e copy of @a str.
> - * @param yystr a NUL-terminated string to scan
> - * 
> - * @return the newly allocated buffer state object.
> - * @note If you want to scan bytes that may contain NUL values, then use
> - *       yy_scan_bytes() instead.
> - */
> -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
> -{
> -    
> -	return yy_scan_bytes(yystr,(int) strlen(yystr) );
> -}
> -
> -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
> - * scan from a @e copy of @a bytes.
> - * @param yybytes the byte buffer to scan
> - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
> - * 
> - * @return the newly allocated buffer state object.
> - */
> -YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
> -{
> -	YY_BUFFER_STATE b;
> -	char *buf;
> -	yy_size_t n;
> -	int i;
> -    
> -	/* Get memory for full buffer, including space for trailing EOB's. */
> -	n = (yy_size_t) (_yybytes_len + 2);
> -	buf = (char *) yyalloc(n  );
> -	if ( ! buf )
> -		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
> -
> -	for ( i = 0; i < _yybytes_len; ++i )
> -		buf[i] = yybytes[i];
> -
> -	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
> -
> -	b = yy_scan_buffer(buf,n );
> -	if ( ! b )
> -		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
> -
> -	/* It's okay to grow etc. this buffer, and we should throw it
> -	 * away when we're done.
> -	 */
> -	b->yy_is_our_buffer = 1;
> -
> -	return b;
> -}
> -
> -#ifndef YY_EXIT_FAILURE
> -#define YY_EXIT_FAILURE 2
> -#endif
> -
> -static void yynoreturn yy_fatal_error (yyconst char* msg )
> -{
> -			(void) fprintf( stderr, "%s\n", msg );
> -	exit( YY_EXIT_FAILURE );
> -}
> -
> -/* Redefine yyless() so it works in section 3 code. */
> -
> -#undef yyless
> -#define yyless(n) \
> -	do \
> -		{ \
> -		/* Undo effects of setting up yytext. */ \
> -        int yyless_macro_arg = (n); \
> -        YY_LESS_LINENO(yyless_macro_arg);\
> -		yytext[yyleng] = (yy_hold_char); \
> -		(yy_c_buf_p) = yytext + yyless_macro_arg; \
> -		(yy_hold_char) = *(yy_c_buf_p); \
> -		*(yy_c_buf_p) = '\0'; \
> -		yyleng = yyless_macro_arg; \
> -		} \
> -	while ( 0 )
> -
> -/* Accessor  methods (get/set functions) to struct members. */
> -
> -/** Get the current line number.
> - * 
> - */
> -int yyget_lineno  (void)
> -{
> -    
> -    return yylineno;
> -}
> -
> -/** Get the input stream.
> - * 
> - */
> -FILE *yyget_in  (void)
> -{
> -        return yyin;
> -}
> -
> -/** Get the output stream.
> - * 
> - */
> -FILE *yyget_out  (void)
> -{
> -        return yyout;
> -}
> -
> -/** Get the length of the current token.
> - * 
> - */
> -int yyget_leng  (void)
> -{
> -        return yyleng;
> -}
> -
> -/** Get the current token.
> - * 
> - */
> -
> -char *yyget_text  (void)
> -{
> -        return yytext;
> -}
> -
> -/** Set the current line number.
> - * @param _line_number line number
> - * 
> - */
> -void yyset_lineno (int  _line_number )
> -{
> -    
> -    yylineno = _line_number;
> -}
> -
> -/** Set the input stream. This does not discard the current
> - * input buffer.
> - * @param _in_str A readable stream.
> - * 
> - * @see yy_switch_to_buffer
> - */
> -void yyset_in (FILE *  _in_str )
> -{
> -        yyin = _in_str ;
> -}
> -
> -void yyset_out (FILE *  _out_str )
> -{
> -        yyout = _out_str ;
> -}
> -
> -int yyget_debug  (void)
> -{
> -        return yy_flex_debug;
> -}
> -
> -void yyset_debug (int  _bdebug )
> -{
> -        yy_flex_debug = _bdebug ;
> -}
> -
> -static int yy_init_globals (void)
> -{
> -        /* Initialization is the same as for the non-reentrant scanner.
> -     * This function is called from yylex_destroy(), so don't allocate here.
> -     */
> -
> -    (yy_buffer_stack) = NULL;
> -    (yy_buffer_stack_top) = 0;
> -    (yy_buffer_stack_max) = 0;
> -    (yy_c_buf_p) = NULL;
> -    (yy_init) = 0;
> -    (yy_start) = 0;
> -
> -/* Defined in main.c */
> -#ifdef YY_STDINIT
> -    yyin = stdin;
> -    yyout = stdout;
> -#else
> -    yyin = NULL;
> -    yyout = NULL;
> -#endif
> -
> -    /* For future reference: Set errno on error, since we are called by
> -     * yylex_init()
> -     */
> -    return 0;
> -}
> -
> -/* yylex_destroy is for both reentrant and non-reentrant scanners. */
> -int yylex_destroy  (void)
> -{
> -    
> -    /* Pop the buffer stack, destroying each element. */
> -	while(YY_CURRENT_BUFFER){
> -		yy_delete_buffer(YY_CURRENT_BUFFER  );
> -		YY_CURRENT_BUFFER_LVALUE = NULL;
> -		yypop_buffer_state();
> -	}
> -
> -	/* Destroy the stack itself. */
> -	yyfree((yy_buffer_stack) );
> -	(yy_buffer_stack) = NULL;
> -
> -    /* Reset the globals. This is important in a non-reentrant scanner so the next time
> -     * yylex() is called, initialization will occur. */
> -    yy_init_globals( );
> -
> -    return 0;
> -}
> -
> -/*
> - * Internal utility routines.
> - */
> -
> -#ifndef yytext_ptr
> -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
> -{
> -		
> -	int i;
> -	for ( i = 0; i < n; ++i )
> -		s1[i] = s2[i];
> -}
> -#endif
> -
> -#ifdef YY_NEED_STRLEN
> -static int yy_flex_strlen (yyconst char * s )
> -{
> -	int n;
> -	for ( n = 0; s[n]; ++n )
> -		;
> -
> -	return n;
> -}
> -#endif
> -
> -void *yyalloc (yy_size_t  size )
> -{
> -			return malloc(size);
> -}
> -
> -void *yyrealloc  (void * ptr, yy_size_t  size )
> -{
> -		
> -	/* The cast to (char *) in the following accommodates both
> -	 * implementations that use char* generic pointers, and those
> -	 * that use void* generic pointers.  It works with the latter
> -	 * because both ANSI C and C++ allow castless assignment from
> -	 * any pointer type to void*, and deal with argument conversions
> -	 * as though doing an assignment.
> -	 */
> -	return realloc(ptr, size);
> -}
> -
> -void yyfree (void * ptr )
> -{
> -			free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
> -}
> -
> -#define YYTABLES_NAME "yytables"
> -
> -#line 272 "dtc-lexer.l"
> -
> -
> -
> -static void push_input_file(const char *filename)
> -{
> -	assert(filename);
> -
> -	srcfile_push(filename);
> -
> -	yyin = current_srcfile->f;
> -
> -	yypush_buffer_state(yy_create_buffer(yyin,YY_BUF_SIZE));
> -}
> -
> -
> -static bool pop_input_file(void)
> -{
> -	if (srcfile_pop() == 0)
> -		return false;
> -
> -	yypop_buffer_state();
> -	yyin = current_srcfile->f;
> -
> -	return true;
> -}
> -
> -static void lexical_error(const char *fmt, ...)
> -{
> -	va_list ap;
> -
> -	va_start(ap, fmt);
> -	srcpos_verror(&yylloc, "Lexical error", fmt, ap);
> -	va_end(ap);
> -
> -	treesource_error = true;
> -}
> -
> diff --git a/scripts/dtc/dtc-parser.tab.c_shipped b/scripts/dtc/dtc-parser.tab.c_shipped
> deleted file mode 100644
> index aea514fa6928..000000000000
> --- a/scripts/dtc/dtc-parser.tab.c_shipped
> +++ /dev/null
> @@ -1,2321 +0,0 @@
> -/* A Bison parser, made by GNU Bison 3.0.4.  */
> -
> -/* Bison implementation for Yacc-like parsers in C
> -
> -   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
> -
> -   This program is free software: you can redistribute it and/or modify
> -   it under the terms of the GNU General Public License as published by
> -   the Free Software Foundation, either version 3 of the License, or
> -   (at your option) any later version.
> -
> -   This program is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> -   GNU General Public License for more details.
> -
> -   You should have received a copy of the GNU General Public License
> -   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
> -
> -/* As a special exception, you may create a larger work that contains
> -   part or all of the Bison parser skeleton and distribute that work
> -   under terms of your choice, so long as that work isn't itself a
> -   parser generator using the skeleton or a modified version thereof
> -   as a parser skeleton.  Alternatively, if you modify or redistribute
> -   the parser skeleton itself, you may (at your option) remove this
> -   special exception, which will cause the skeleton and the resulting
> -   Bison output files to be licensed under the GNU General Public
> -   License without this special exception.
> -
> -   This special exception was added by the Free Software Foundation in
> -   version 2.2 of Bison.  */
> -
> -/* C LALR(1) parser skeleton written by Richard Stallman, by
> -   simplifying the original so-called "semantic" parser.  */
> -
> -/* All symbols defined below should begin with yy or YY, to avoid
> -   infringing on user name space.  This should be done even for local
> -   variables, as they might otherwise be expanded by user macros.
> -   There are some unavoidable exceptions within include files to
> -   define necessary library symbols; they are noted "INFRINGES ON
> -   USER NAME SPACE" below.  */
> -
> -/* Identify Bison output.  */
> -#define YYBISON 1
> -
> -/* Bison version.  */
> -#define YYBISON_VERSION "3.0.4"
> -
> -/* Skeleton name.  */
> -#define YYSKELETON_NAME "yacc.c"
> -
> -/* Pure parsers.  */
> -#define YYPURE 0
> -
> -/* Push parsers.  */
> -#define YYPUSH 0
> -
> -/* Pull parsers.  */
> -#define YYPULL 1
> -
> -
> -
> -
> -/* Copy the first part of user declarations.  */
> -#line 20 "dtc-parser.y" /* yacc.c:339  */
> -
> -#include <stdio.h>
> -#include <inttypes.h>
> -
> -#include "dtc.h"
> -#include "srcpos.h"
> -
> -extern int yylex(void);
> -extern void yyerror(char const *s);
> -#define ERROR(loc, ...) \
> -	do { \
> -		srcpos_error((loc), "Error", __VA_ARGS__); \
> -		treesource_error = true; \
> -	} while (0)
> -
> -extern struct dt_info *parser_output;
> -extern bool treesource_error;
> -
> -#line 85 "dtc-parser.tab.c" /* yacc.c:339  */
> -
> -# ifndef YY_NULLPTR
> -#  if defined __cplusplus && 201103L <= __cplusplus
> -#   define YY_NULLPTR nullptr
> -#  else
> -#   define YY_NULLPTR 0
> -#  endif
> -# endif
> -
> -/* Enabling verbose error messages.  */
> -#ifdef YYERROR_VERBOSE
> -# undef YYERROR_VERBOSE
> -# define YYERROR_VERBOSE 1
> -#else
> -# define YYERROR_VERBOSE 0
> -#endif
> -
> -/* In a future release of Bison, this section will be replaced
> -   by #include "dtc-parser.tab.h".  */
> -#ifndef YY_YY_DTC_PARSER_TAB_H_INCLUDED
> -# define YY_YY_DTC_PARSER_TAB_H_INCLUDED
> -/* Debug traces.  */
> -#ifndef YYDEBUG
> -# define YYDEBUG 0
> -#endif
> -#if YYDEBUG
> -extern int yydebug;
> -#endif
> -
> -/* Token type.  */
> -#ifndef YYTOKENTYPE
> -# define YYTOKENTYPE
> -  enum yytokentype
> -  {
> -    DT_V1 = 258,
> -    DT_PLUGIN = 259,
> -    DT_MEMRESERVE = 260,
> -    DT_LSHIFT = 261,
> -    DT_RSHIFT = 262,
> -    DT_LE = 263,
> -    DT_GE = 264,
> -    DT_EQ = 265,
> -    DT_NE = 266,
> -    DT_AND = 267,
> -    DT_OR = 268,
> -    DT_BITS = 269,
> -    DT_DEL_PROP = 270,
> -    DT_DEL_NODE = 271,
> -    DT_PROPNODENAME = 272,
> -    DT_LITERAL = 273,
> -    DT_CHAR_LITERAL = 274,
> -    DT_BYTE = 275,
> -    DT_STRING = 276,
> -    DT_LABEL = 277,
> -    DT_REF = 278,
> -    DT_INCBIN = 279
> -  };
> -#endif
> -
> -/* Value type.  */
> -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
> -
> -union YYSTYPE
> -{
> -#line 39 "dtc-parser.y" /* yacc.c:355  */
> -
> -	char *propnodename;
> -	char *labelref;
> -	uint8_t byte;
> -	struct data data;
> -
> -	struct {
> -		struct data	data;
> -		int		bits;
> -	} array;
> -
> -	struct property *prop;
> -	struct property *proplist;
> -	struct node *node;
> -	struct node *nodelist;
> -	struct reserve_info *re;
> -	uint64_t integer;
> -	unsigned int flags;
> -
> -#line 170 "dtc-parser.tab.c" /* yacc.c:355  */
> -};
> -
> -typedef union YYSTYPE YYSTYPE;
> -# define YYSTYPE_IS_TRIVIAL 1
> -# define YYSTYPE_IS_DECLARED 1
> -#endif
> -
> -/* Location type.  */
> -#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
> -typedef struct YYLTYPE YYLTYPE;
> -struct YYLTYPE
> -{
> -  int first_line;
> -  int first_column;
> -  int last_line;
> -  int last_column;
> -};
> -# define YYLTYPE_IS_DECLARED 1
> -# define YYLTYPE_IS_TRIVIAL 1
> -#endif
> -
> -
> -extern YYSTYPE yylval;
> -extern YYLTYPE yylloc;
> -int yyparse (void);
> -
> -#endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED  */
> -
> -/* Copy the second part of user declarations.  */
> -
> -#line 201 "dtc-parser.tab.c" /* yacc.c:358  */
> -
> -#ifdef short
> -# undef short
> -#endif
> -
> -#ifdef YYTYPE_UINT8
> -typedef YYTYPE_UINT8 yytype_uint8;
> -#else
> -typedef unsigned char yytype_uint8;
> -#endif
> -
> -#ifdef YYTYPE_INT8
> -typedef YYTYPE_INT8 yytype_int8;
> -#else
> -typedef signed char yytype_int8;
> -#endif
> -
> -#ifdef YYTYPE_UINT16
> -typedef YYTYPE_UINT16 yytype_uint16;
> -#else
> -typedef unsigned short int yytype_uint16;
> -#endif
> -
> -#ifdef YYTYPE_INT16
> -typedef YYTYPE_INT16 yytype_int16;
> -#else
> -typedef short int yytype_int16;
> -#endif
> -
> -#ifndef YYSIZE_T
> -# ifdef __SIZE_TYPE__
> -#  define YYSIZE_T __SIZE_TYPE__
> -# elif defined size_t
> -#  define YYSIZE_T size_t
> -# elif ! defined YYSIZE_T
> -#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
> -#  define YYSIZE_T size_t
> -# else
> -#  define YYSIZE_T unsigned int
> -# endif
> -#endif
> -
> -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
> -
> -#ifndef YY_
> -# if defined YYENABLE_NLS && YYENABLE_NLS
> -#  if ENABLE_NLS
> -#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
> -#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
> -#  endif
> -# endif
> -# ifndef YY_
> -#  define YY_(Msgid) Msgid
> -# endif
> -#endif
> -
> -#ifndef YY_ATTRIBUTE
> -# if (defined __GNUC__                                               \
> -      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
> -     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
> -#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
> -# else
> -#  define YY_ATTRIBUTE(Spec) /* empty */
> -# endif
> -#endif
> -
> -#ifndef YY_ATTRIBUTE_PURE
> -# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
> -#endif
> -
> -#ifndef YY_ATTRIBUTE_UNUSED
> -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
> -#endif
> -
> -#if !defined _Noreturn \
> -     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
> -# if defined _MSC_VER && 1200 <= _MSC_VER
> -#  define _Noreturn __declspec (noreturn)
> -# else
> -#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
> -# endif
> -#endif
> -
> -/* Suppress unused-variable warnings by "using" E.  */
> -#if ! defined lint || defined __GNUC__
> -# define YYUSE(E) ((void) (E))
> -#else
> -# define YYUSE(E) /* empty */
> -#endif
> -
> -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
> -/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
> -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
> -    _Pragma ("GCC diagnostic push") \
> -    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
> -    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
> -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
> -    _Pragma ("GCC diagnostic pop")
> -#else
> -# define YY_INITIAL_VALUE(Value) Value
> -#endif
> -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
> -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
> -# define YY_IGNORE_MAYBE_UNINITIALIZED_END
> -#endif
> -#ifndef YY_INITIAL_VALUE
> -# define YY_INITIAL_VALUE(Value) /* Nothing. */
> -#endif
> -
> -
> -#if ! defined yyoverflow || YYERROR_VERBOSE
> -
> -/* The parser invokes alloca or malloc; define the necessary symbols.  */
> -
> -# ifdef YYSTACK_USE_ALLOCA
> -#  if YYSTACK_USE_ALLOCA
> -#   ifdef __GNUC__
> -#    define YYSTACK_ALLOC __builtin_alloca
> -#   elif defined __BUILTIN_VA_ARG_INCR
> -#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
> -#   elif defined _AIX
> -#    define YYSTACK_ALLOC __alloca
> -#   elif defined _MSC_VER
> -#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
> -#    define alloca _alloca
> -#   else
> -#    define YYSTACK_ALLOC alloca
> -#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
> -#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
> -      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
> -#     ifndef EXIT_SUCCESS
> -#      define EXIT_SUCCESS 0
> -#     endif
> -#    endif
> -#   endif
> -#  endif
> -# endif
> -
> -# ifdef YYSTACK_ALLOC
> -   /* Pacify GCC's 'empty if-body' warning.  */
> -#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
> -#  ifndef YYSTACK_ALLOC_MAXIMUM
> -    /* The OS might guarantee only one guard page at the bottom of the stack,
> -       and a page size can be as small as 4096 bytes.  So we cannot safely
> -       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
> -       to allow for a few compiler-allocated temporary stack slots.  */
> -#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
> -#  endif
> -# else
> -#  define YYSTACK_ALLOC YYMALLOC
> -#  define YYSTACK_FREE YYFREE
> -#  ifndef YYSTACK_ALLOC_MAXIMUM
> -#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
> -#  endif
> -#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
> -       && ! ((defined YYMALLOC || defined malloc) \
> -             && (defined YYFREE || defined free)))
> -#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
> -#   ifndef EXIT_SUCCESS
> -#    define EXIT_SUCCESS 0
> -#   endif
> -#  endif
> -#  ifndef YYMALLOC
> -#   define YYMALLOC malloc
> -#   if ! defined malloc && ! defined EXIT_SUCCESS
> -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
> -#   endif
> -#  endif
> -#  ifndef YYFREE
> -#   define YYFREE free
> -#   if ! defined free && ! defined EXIT_SUCCESS
> -void free (void *); /* INFRINGES ON USER NAME SPACE */
> -#   endif
> -#  endif
> -# endif
> -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
> -
> -
> -#if (! defined yyoverflow \
> -     && (! defined __cplusplus \
> -         || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
> -             && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
> -
> -/* A type that is properly aligned for any stack member.  */
> -union yyalloc
> -{
> -  yytype_int16 yyss_alloc;
> -  YYSTYPE yyvs_alloc;
> -  YYLTYPE yyls_alloc;
> -};
> -
> -/* The size of the maximum gap between one aligned stack and the next.  */
> -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
> -
> -/* The size of an array large to enough to hold all stacks, each with
> -   N elements.  */
> -# define YYSTACK_BYTES(N) \
> -     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
> -      + 2 * YYSTACK_GAP_MAXIMUM)
> -
> -# define YYCOPY_NEEDED 1
> -
> -/* Relocate STACK from its old location to the new one.  The
> -   local variables YYSIZE and YYSTACKSIZE give the old and new number of
> -   elements in the stack, and YYPTR gives the new location of the
> -   stack.  Advance YYPTR to a properly aligned location for the next
> -   stack.  */
> -# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
> -    do                                                                  \
> -      {                                                                 \
> -        YYSIZE_T yynewbytes;                                            \
> -        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
> -        Stack = &yyptr->Stack_alloc;                                    \
> -        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
> -        yyptr += yynewbytes / sizeof (*yyptr);                          \
> -      }                                                                 \
> -    while (0)
> -
> -#endif
> -
> -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
> -/* Copy COUNT objects from SRC to DST.  The source and destination do
> -   not overlap.  */
> -# ifndef YYCOPY
> -#  if defined __GNUC__ && 1 < __GNUC__
> -#   define YYCOPY(Dst, Src, Count) \
> -      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
> -#  else
> -#   define YYCOPY(Dst, Src, Count)              \
> -      do                                        \
> -        {                                       \
> -          YYSIZE_T yyi;                         \
> -          for (yyi = 0; yyi < (Count); yyi++)   \
> -            (Dst)[yyi] = (Src)[yyi];            \
> -        }                                       \
> -      while (0)
> -#  endif
> -# endif
> -#endif /* !YYCOPY_NEEDED */
> -
> -/* YYFINAL -- State number of the termination state.  */
> -#define YYFINAL  6
> -/* YYLAST -- Last index in YYTABLE.  */
> -#define YYLAST   138
> -
> -/* YYNTOKENS -- Number of terminals.  */
> -#define YYNTOKENS  48
> -/* YYNNTS -- Number of nonterminals.  */
> -#define YYNNTS  30
> -/* YYNRULES -- Number of rules.  */
> -#define YYNRULES  85
> -/* YYNSTATES -- Number of states.  */
> -#define YYNSTATES  149
> -
> -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
> -   by yylex, with out-of-bounds checking.  */
> -#define YYUNDEFTOK  2
> -#define YYMAXUTOK   279
> -
> -#define YYTRANSLATE(YYX)                                                \
> -  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
> -
> -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
> -   as returned by yylex, without out-of-bounds checking.  */
> -static const yytype_uint8 yytranslate[] =
> -{
> -       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,    47,     2,     2,     2,    45,    41,     2,
> -      33,    35,    44,    42,    34,    43,     2,    26,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,    38,    25,
> -      36,    29,    30,    37,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,    31,     2,    32,    40,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,    27,    39,    28,    46,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
> -       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
> -       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
> -      15,    16,    17,    18,    19,    20,    21,    22,    23,    24
> -};
> -
> -#if YYDEBUG
> -  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
> -static const yytype_uint16 yyrline[] =
> -{
> -       0,   109,   109,   117,   121,   128,   129,   139,   142,   149,
> -     153,   161,   165,   170,   181,   200,   213,   220,   228,   231,
> -     238,   242,   246,   250,   258,   262,   266,   270,   274,   290,
> -     300,   308,   311,   315,   322,   338,   343,   362,   376,   383,
> -     384,   385,   392,   396,   397,   401,   402,   406,   407,   411,
> -     412,   416,   417,   421,   422,   426,   427,   428,   432,   433,
> -     434,   435,   436,   440,   441,   442,   446,   447,   448,   452,
> -     453,   462,   471,   475,   476,   477,   478,   483,   486,   490,
> -     498,   501,   505,   513,   517,   521
> -};
> -#endif
> -
> -#if YYDEBUG || YYERROR_VERBOSE || 0
> -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
> -   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
> -static const char *const yytname[] =
> -{
> -  "$end", "error", "$undefined", "DT_V1", "DT_PLUGIN", "DT_MEMRESERVE",
> -  "DT_LSHIFT", "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND",
> -  "DT_OR", "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME",
> -  "DT_LITERAL", "DT_CHAR_LITERAL", "DT_BYTE", "DT_STRING", "DT_LABEL",
> -  "DT_REF", "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['",
> -  "']'", "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'",
> -  "'+'", "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
> -  "header", "headers", "memreserves", "memreserve", "devicetree",
> -  "nodedef", "proplist", "propdef", "propdata", "propdataprefix",
> -  "arrayprefix", "integer_prim", "integer_expr", "integer_trinary",
> -  "integer_or", "integer_and", "integer_bitor", "integer_bitxor",
> -  "integer_bitand", "integer_eq", "integer_rela", "integer_shift",
> -  "integer_add", "integer_mul", "integer_unary", "bytestring", "subnodes",
> -  "subnode", YY_NULLPTR
> -};
> -#endif
> -
> -# ifdef YYPRINT
> -/* YYTOKNUM[NUM] -- (External) token number corresponding to the
> -   (internal) symbol number NUM (which must be that of a token).  */
> -static const yytype_uint16 yytoknum[] =
> -{
> -       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
> -     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
> -     275,   276,   277,   278,   279,    59,    47,   123,   125,    61,
> -      62,    91,    93,    40,    44,    41,    60,    63,    58,   124,
> -      94,    38,    43,    45,    42,    37,   126,    33
> -};
> -# endif
> -
> -#define YYPACT_NINF -44
> -
> -#define yypact_value_is_default(Yystate) \
> -  (!!((Yystate) == (-44)))
> -
> -#define YYTABLE_NINF -1
> -
> -#define yytable_value_is_error(Yytable_value) \
> -  0
> -
> -  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
> -     STATE-NUM.  */
> -static const yytype_int8 yypact[] =
> -{
> -      14,    27,    61,    14,     8,    18,   -44,   -44,    37,     8,
> -      40,     8,    64,   -44,   -44,   -12,    37,   -44,    50,    52,
> -     -44,   -44,   -12,   -12,   -12,   -44,    51,   -44,    -4,    78,
> -      53,    54,    55,    17,     2,    30,    38,    -3,   -44,    66,
> -     -44,   -44,    70,    72,    50,    50,   -44,   -44,   -44,   -44,
> -     -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,
> -     -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -12,   -44,
> -       3,    73,    50,   -44,   -44,    78,    59,    53,    54,    55,
> -      17,     2,     2,    30,    30,    30,    30,    38,    38,    -3,
> -      -3,   -44,   -44,   -44,    82,    83,    44,     3,   -44,    74,
> -       3,   -44,   -44,   -12,    76,    79,   -44,   -44,   -44,   -44,
> -     -44,    80,   -44,   -44,   -44,   -44,   -44,   -10,    36,   -44,
> -     -44,   -44,   -44,    85,   -44,   -44,   -44,    75,   -44,   -44,
> -      21,    71,    88,    -6,   -44,   -44,   -44,   -44,   -44,    11,
> -     -44,   -44,   -44,    37,   -44,    77,    37,    81,   -44
> -};
> -
> -  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
> -     Performed when YYTABLE does not specify something else to do.  Zero
> -     means the default is an error.  */
> -static const yytype_uint8 yydefact[] =
> -{
> -       0,     0,     0,     5,     7,     3,     1,     6,     0,     0,
> -      16,     7,     0,    39,    40,     0,     0,    10,     0,     2,
> -       8,     4,     0,     0,     0,    73,     0,    42,    43,    45,
> -      47,    49,    51,    53,    55,    58,    65,    68,    72,     0,
> -      18,    11,     0,     0,     0,     0,    74,    75,    76,    41,
> -       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
> -       0,     0,     0,     0,     0,     0,     0,     0,     0,     9,
> -      80,     0,     0,    14,    12,    46,     0,    48,    50,    52,
> -      54,    56,    57,    61,    62,    60,    59,    63,    64,    66,
> -      67,    70,    69,    71,     0,     0,     0,     0,    19,     0,
> -      80,    15,    13,     0,     0,     0,    21,    31,    83,    23,
> -      85,     0,    82,    81,    44,    22,    84,     0,     0,    17,
> -      30,    20,    32,     0,    24,    33,    27,     0,    77,    35,
> -       0,     0,     0,     0,    38,    37,    25,    36,    34,     0,
> -      78,    79,    26,     0,    29,     0,     0,     0,    28
> -};
> -
> -  /* YYPGOTO[NTERM-NUM].  */
> -static const yytype_int8 yypgoto[] =
> -{
> -     -44,   -44,   -44,   103,    99,   104,   -44,   -43,   -44,   -21,
> -     -44,   -44,   -44,    -8,    63,     9,   -44,    65,    67,    68,
> -      69,    62,    26,     4,    22,    23,   -19,   -44,    20,    28
> -};
> -
> -  /* YYDEFGOTO[NTERM-NUM].  */
> -static const yytype_int16 yydefgoto[] =
> -{
> -      -1,     2,     3,     4,    10,    11,    19,    41,    70,    98,
> -     117,   118,   130,    25,    26,    27,    28,    29,    30,    31,
> -      32,    33,    34,    35,    36,    37,    38,   133,    99,   100
> -};
> -
> -  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
> -     positive, shift that token.  If negative, reduce the rule whose
> -     number is the opposite.  If YYTABLE_NINF, syntax error.  */
> -static const yytype_uint8 yytable[] =
> -{
> -      16,    73,    74,    46,    47,    48,    13,    14,    39,    50,
> -      58,    59,   120,     8,   140,   121,   141,     1,    94,    95,
> -      96,    15,    12,    66,   122,    97,   142,    56,    57,   102,
> -       9,    22,    60,    51,    23,    24,    62,    63,    61,    13,
> -      14,    67,    68,   134,   135,   143,   144,    91,    92,    93,
> -     123,   136,     5,   108,    15,    13,    14,   124,   125,   126,
> -     127,     6,    83,    84,    85,    86,    18,   128,    42,   106,
> -      15,    40,   129,   107,    43,    44,   109,    40,    45,   112,
> -      64,    65,    81,    82,    87,    88,    49,    89,    90,    21,
> -      52,    69,    53,    71,    54,    72,    55,   103,   101,   104,
> -     105,   115,   111,   131,   116,   119,     7,   138,   132,   139,
> -      20,   146,   114,    17,    76,    75,   148,    80,     0,    77,
> -     113,    78,   137,    79,     0,   110,     0,     0,     0,     0,
> -       0,     0,     0,     0,     0,   145,     0,     0,   147
> -};
> -
> -static const yytype_int16 yycheck[] =
> -{
> -       8,    44,    45,    22,    23,    24,    18,    19,    16,    13,
> -       8,     9,    22,     5,    20,    25,    22,     3,    15,    16,
> -      17,    33,     4,    26,    34,    22,    32,    10,    11,    72,
> -      22,    43,    30,    37,    46,    47,     6,     7,    36,    18,
> -      19,    44,    45,    22,    23,    34,    35,    66,    67,    68,
> -      14,    30,    25,    96,    33,    18,    19,    21,    22,    23,
> -      24,     0,    58,    59,    60,    61,    26,    31,    16,    25,
> -      33,    27,    36,    29,    22,    23,    97,    27,    26,   100,
> -      42,    43,    56,    57,    62,    63,    35,    64,    65,    25,
> -      12,    25,    39,    23,    40,    23,    41,    38,    25,    17,
> -      17,    25,    28,    18,    25,    25,     3,    36,    33,    21,
> -      11,    34,   103,     9,    51,    50,    35,    55,    -1,    52,
> -     100,    53,   130,    54,    -1,    97,    -1,    -1,    -1,    -1,
> -      -1,    -1,    -1,    -1,    -1,   143,    -1,    -1,   146
> -};
> -
> -  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
> -     symbol of state STATE-NUM.  */
> -static const yytype_uint8 yystos[] =
> -{
> -       0,     3,    49,    50,    51,    25,     0,    51,     5,    22,
> -      52,    53,     4,    18,    19,    33,    61,    53,    26,    54,
> -      52,    25,    43,    46,    47,    61,    62,    63,    64,    65,
> -      66,    67,    68,    69,    70,    71,    72,    73,    74,    61,
> -      27,    55,    16,    22,    23,    26,    74,    74,    74,    35,
> -      13,    37,    12,    39,    40,    41,    10,    11,     8,     9,
> -      30,    36,     6,     7,    42,    43,    26,    44,    45,    25,
> -      56,    23,    23,    55,    55,    65,    62,    66,    67,    68,
> -      69,    70,    70,    71,    71,    71,    71,    72,    72,    73,
> -      73,    74,    74,    74,    15,    16,    17,    22,    57,    76,
> -      77,    25,    55,    38,    17,    17,    25,    29,    55,    57,
> -      77,    28,    57,    76,    63,    25,    25,    58,    59,    25,
> -      22,    25,    34,    14,    21,    22,    23,    24,    31,    36,
> -      60,    18,    33,    75,    22,    23,    30,    61,    36,    21,
> -      20,    22,    32,    34,    35,    61,    34,    61,    35
> -};
> -
> -  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
> -static const yytype_uint8 yyr1[] =
> -{
> -       0,    48,    49,    50,    50,    51,    51,    52,    52,    53,
> -      53,    54,    54,    54,    54,    54,    54,    55,    56,    56,
> -      57,    57,    57,    57,    58,    58,    58,    58,    58,    58,
> -      58,    59,    59,    59,    60,    60,    60,    60,    60,    61,
> -      61,    61,    62,    63,    63,    64,    64,    65,    65,    66,
> -      66,    67,    67,    68,    68,    69,    69,    69,    70,    70,
> -      70,    70,    70,    71,    71,    71,    72,    72,    72,    73,
> -      73,    73,    73,    74,    74,    74,    74,    75,    75,    75,
> -      76,    76,    76,    77,    77,    77
> -};
> -
> -  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
> -static const yytype_uint8 yyr2[] =
> -{
> -       0,     2,     3,     2,     4,     1,     2,     0,     2,     4,
> -       2,     2,     3,     4,     3,     4,     0,     5,     0,     2,
> -       4,     2,     3,     2,     2,     3,     4,     2,     9,     5,
> -       2,     0,     2,     2,     3,     1,     2,     2,     2,     1,
> -       1,     3,     1,     1,     5,     1,     3,     1,     3,     1,
> -       3,     1,     3,     1,     3,     1,     3,     3,     1,     3,
> -       3,     3,     3,     3,     3,     1,     3,     3,     1,     3,
> -       3,     3,     1,     1,     2,     2,     2,     0,     2,     2,
> -       0,     2,     2,     2,     3,     2
> -};
> -
> -
> -#define yyerrok         (yyerrstatus = 0)
> -#define yyclearin       (yychar = YYEMPTY)
> -#define YYEMPTY         (-2)
> -#define YYEOF           0
> -
> -#define YYACCEPT        goto yyacceptlab
> -#define YYABORT         goto yyabortlab
> -#define YYERROR         goto yyerrorlab
> -
> -
> -#define YYRECOVERING()  (!!yyerrstatus)
> -
> -#define YYBACKUP(Token, Value)                                  \
> -do                                                              \
> -  if (yychar == YYEMPTY)                                        \
> -    {                                                           \
> -      yychar = (Token);                                         \
> -      yylval = (Value);                                         \
> -      YYPOPSTACK (yylen);                                       \
> -      yystate = *yyssp;                                         \
> -      goto yybackup;                                            \
> -    }                                                           \
> -  else                                                          \
> -    {                                                           \
> -      yyerror (YY_("syntax error: cannot back up")); \
> -      YYERROR;                                                  \
> -    }                                                           \
> -while (0)
> -
> -/* Error token number */
> -#define YYTERROR        1
> -#define YYERRCODE       256
> -
> -
> -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
> -   If N is 0, then set CURRENT to the empty location which ends
> -   the previous symbol: RHS[0] (always defined).  */
> -
> -#ifndef YYLLOC_DEFAULT
> -# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
> -    do                                                                  \
> -      if (N)                                                            \
> -        {                                                               \
> -          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
> -          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
> -          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
> -          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
> -        }                                                               \
> -      else                                                              \
> -        {                                                               \
> -          (Current).first_line   = (Current).last_line   =              \
> -            YYRHSLOC (Rhs, 0).last_line;                                \
> -          (Current).first_column = (Current).last_column =              \
> -            YYRHSLOC (Rhs, 0).last_column;                              \
> -        }                                                               \
> -    while (0)
> -#endif
> -
> -#define YYRHSLOC(Rhs, K) ((Rhs)[K])
> -
> -
> -/* Enable debugging if requested.  */
> -#if YYDEBUG
> -
> -# ifndef YYFPRINTF
> -#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
> -#  define YYFPRINTF fprintf
> -# endif
> -
> -# define YYDPRINTF(Args)                        \
> -do {                                            \
> -  if (yydebug)                                  \
> -    YYFPRINTF Args;                             \
> -} while (0)
> -
> -
> -/* YY_LOCATION_PRINT -- Print the location on the stream.
> -   This macro was not mandated originally: define only if we know
> -   we won't break user code: when these are the locations we know.  */
> -
> -#ifndef YY_LOCATION_PRINT
> -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
> -
> -/* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
> -
> -YY_ATTRIBUTE_UNUSED
> -static unsigned
> -yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
> -{
> -  unsigned res = 0;
> -  int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
> -  if (0 <= yylocp->first_line)
> -    {
> -      res += YYFPRINTF (yyo, "%d", yylocp->first_line);
> -      if (0 <= yylocp->first_column)
> -        res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
> -    }
> -  if (0 <= yylocp->last_line)
> -    {
> -      if (yylocp->first_line < yylocp->last_line)
> -        {
> -          res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
> -          if (0 <= end_col)
> -            res += YYFPRINTF (yyo, ".%d", end_col);
> -        }
> -      else if (0 <= end_col && yylocp->first_column < end_col)
> -        res += YYFPRINTF (yyo, "-%d", end_col);
> -    }
> -  return res;
> - }
> -
> -#  define YY_LOCATION_PRINT(File, Loc)          \
> -  yy_location_print_ (File, &(Loc))
> -
> -# else
> -#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
> -# endif
> -#endif
> -
> -
> -# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
> -do {                                                                      \
> -  if (yydebug)                                                            \
> -    {                                                                     \
> -      YYFPRINTF (stderr, "%s ", Title);                                   \
> -      yy_symbol_print (stderr,                                            \
> -                  Type, Value, Location); \
> -      YYFPRINTF (stderr, "\n");                                           \
> -    }                                                                     \
> -} while (0)
> -
> -
> -/*----------------------------------------.
> -| Print this symbol's value on YYOUTPUT.  |
> -`----------------------------------------*/
> -
> -static void
> -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
> -{
> -  FILE *yyo = yyoutput;
> -  YYUSE (yyo);
> -  YYUSE (yylocationp);
> -  if (!yyvaluep)
> -    return;
> -# ifdef YYPRINT
> -  if (yytype < YYNTOKENS)
> -    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
> -# endif
> -  YYUSE (yytype);
> -}
> -
> -
> -/*--------------------------------.
> -| Print this symbol on YYOUTPUT.  |
> -`--------------------------------*/
> -
> -static void
> -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
> -{
> -  YYFPRINTF (yyoutput, "%s %s (",
> -             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
> -
> -  YY_LOCATION_PRINT (yyoutput, *yylocationp);
> -  YYFPRINTF (yyoutput, ": ");
> -  yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
> -  YYFPRINTF (yyoutput, ")");
> -}
> -
> -/*------------------------------------------------------------------.
> -| yy_stack_print -- Print the state stack from its BOTTOM up to its |
> -| TOP (included).                                                   |
> -`------------------------------------------------------------------*/
> -
> -static void
> -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
> -{
> -  YYFPRINTF (stderr, "Stack now");
> -  for (; yybottom <= yytop; yybottom++)
> -    {
> -      int yybot = *yybottom;
> -      YYFPRINTF (stderr, " %d", yybot);
> -    }
> -  YYFPRINTF (stderr, "\n");
> -}
> -
> -# define YY_STACK_PRINT(Bottom, Top)                            \
> -do {                                                            \
> -  if (yydebug)                                                  \
> -    yy_stack_print ((Bottom), (Top));                           \
> -} while (0)
> -
> -
> -/*------------------------------------------------.
> -| Report that the YYRULE is going to be reduced.  |
> -`------------------------------------------------*/
> -
> -static void
> -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
> -{
> -  unsigned long int yylno = yyrline[yyrule];
> -  int yynrhs = yyr2[yyrule];
> -  int yyi;
> -  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
> -             yyrule - 1, yylno);
> -  /* The symbols being reduced.  */
> -  for (yyi = 0; yyi < yynrhs; yyi++)
> -    {
> -      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
> -      yy_symbol_print (stderr,
> -                       yystos[yyssp[yyi + 1 - yynrhs]],
> -                       &(yyvsp[(yyi + 1) - (yynrhs)])
> -                       , &(yylsp[(yyi + 1) - (yynrhs)])                       );
> -      YYFPRINTF (stderr, "\n");
> -    }
> -}
> -
> -# define YY_REDUCE_PRINT(Rule)          \
> -do {                                    \
> -  if (yydebug)                          \
> -    yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
> -} while (0)
> -
> -/* Nonzero means print parse trace.  It is left uninitialized so that
> -   multiple parsers can coexist.  */
> -int yydebug;
> -#else /* !YYDEBUG */
> -# define YYDPRINTF(Args)
> -# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
> -# define YY_STACK_PRINT(Bottom, Top)
> -# define YY_REDUCE_PRINT(Rule)
> -#endif /* !YYDEBUG */
> -
> -
> -/* YYINITDEPTH -- initial size of the parser's stacks.  */
> -#ifndef YYINITDEPTH
> -# define YYINITDEPTH 200
> -#endif
> -
> -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
> -   if the built-in stack extension method is used).
> -
> -   Do not make this value too large; the results are undefined if
> -   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
> -   evaluated with infinite-precision integer arithmetic.  */
> -
> -#ifndef YYMAXDEPTH
> -# define YYMAXDEPTH 10000
> -#endif
> -
> -
> -#if YYERROR_VERBOSE
> -
> -# ifndef yystrlen
> -#  if defined __GLIBC__ && defined _STRING_H
> -#   define yystrlen strlen
> -#  else
> -/* Return the length of YYSTR.  */
> -static YYSIZE_T
> -yystrlen (const char *yystr)
> -{
> -  YYSIZE_T yylen;
> -  for (yylen = 0; yystr[yylen]; yylen++)
> -    continue;
> -  return yylen;
> -}
> -#  endif
> -# endif
> -
> -# ifndef yystpcpy
> -#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
> -#   define yystpcpy stpcpy
> -#  else
> -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
> -   YYDEST.  */
> -static char *
> -yystpcpy (char *yydest, const char *yysrc)
> -{
> -  char *yyd = yydest;
> -  const char *yys = yysrc;
> -
> -  while ((*yyd++ = *yys++) != '\0')
> -    continue;
> -
> -  return yyd - 1;
> -}
> -#  endif
> -# endif
> -
> -# ifndef yytnamerr
> -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
> -   quotes and backslashes, so that it's suitable for yyerror.  The
> -   heuristic is that double-quoting is unnecessary unless the string
> -   contains an apostrophe, a comma, or backslash (other than
> -   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
> -   null, do not copy; instead, return the length of what the result
> -   would have been.  */
> -static YYSIZE_T
> -yytnamerr (char *yyres, const char *yystr)
> -{
> -  if (*yystr == '"')
> -    {
> -      YYSIZE_T yyn = 0;
> -      char const *yyp = yystr;
> -
> -      for (;;)
> -        switch (*++yyp)
> -          {
> -          case '\'':
> -          case ',':
> -            goto do_not_strip_quotes;
> -
> -          case '\\':
> -            if (*++yyp != '\\')
> -              goto do_not_strip_quotes;
> -            /* Fall through.  */
> -          default:
> -            if (yyres)
> -              yyres[yyn] = *yyp;
> -            yyn++;
> -            break;
> -
> -          case '"':
> -            if (yyres)
> -              yyres[yyn] = '\0';
> -            return yyn;
> -          }
> -    do_not_strip_quotes: ;
> -    }
> -
> -  if (! yyres)
> -    return yystrlen (yystr);
> -
> -  return yystpcpy (yyres, yystr) - yyres;
> -}
> -# endif
> -
> -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
> -   about the unexpected token YYTOKEN for the state stack whose top is
> -   YYSSP.
> -
> -   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
> -   not large enough to hold the message.  In that case, also set
> -   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
> -   required number of bytes is too large to store.  */
> -static int
> -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
> -                yytype_int16 *yyssp, int yytoken)
> -{
> -  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
> -  YYSIZE_T yysize = yysize0;
> -  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
> -  /* Internationalized format string. */
> -  const char *yyformat = YY_NULLPTR;
> -  /* Arguments of yyformat. */
> -  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
> -  /* Number of reported tokens (one for the "unexpected", one per
> -     "expected"). */
> -  int yycount = 0;
> -
> -  /* There are many possibilities here to consider:
> -     - If this state is a consistent state with a default action, then
> -       the only way this function was invoked is if the default action
> -       is an error action.  In that case, don't check for expected
> -       tokens because there are none.
> -     - The only way there can be no lookahead present (in yychar) is if
> -       this state is a consistent state with a default action.  Thus,
> -       detecting the absence of a lookahead is sufficient to determine
> -       that there is no unexpected or expected token to report.  In that
> -       case, just report a simple "syntax error".
> -     - Don't assume there isn't a lookahead just because this state is a
> -       consistent state with a default action.  There might have been a
> -       previous inconsistent state, consistent state with a non-default
> -       action, or user semantic action that manipulated yychar.
> -     - Of course, the expected token list depends on states to have
> -       correct lookahead information, and it depends on the parser not
> -       to perform extra reductions after fetching a lookahead from the
> -       scanner and before detecting a syntax error.  Thus, state merging
> -       (from LALR or IELR) and default reductions corrupt the expected
> -       token list.  However, the list is correct for canonical LR with
> -       one exception: it will still contain any token that will not be
> -       accepted due to an error action in a later state.
> -  */
> -  if (yytoken != YYEMPTY)
> -    {
> -      int yyn = yypact[*yyssp];
> -      yyarg[yycount++] = yytname[yytoken];
> -      if (!yypact_value_is_default (yyn))
> -        {
> -          /* Start YYX at -YYN if negative to avoid negative indexes in
> -             YYCHECK.  In other words, skip the first -YYN actions for
> -             this state because they are default actions.  */
> -          int yyxbegin = yyn < 0 ? -yyn : 0;
> -          /* Stay within bounds of both yycheck and yytname.  */
> -          int yychecklim = YYLAST - yyn + 1;
> -          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
> -          int yyx;
> -
> -          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
> -            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
> -                && !yytable_value_is_error (yytable[yyx + yyn]))
> -              {
> -                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
> -                  {
> -                    yycount = 1;
> -                    yysize = yysize0;
> -                    break;
> -                  }
> -                yyarg[yycount++] = yytname[yyx];
> -                {
> -                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
> -                  if (! (yysize <= yysize1
> -                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
> -                    return 2;
> -                  yysize = yysize1;
> -                }
> -              }
> -        }
> -    }
> -
> -  switch (yycount)
> -    {
> -# define YYCASE_(N, S)                      \
> -      case N:                               \
> -        yyformat = S;                       \
> -      break
> -      YYCASE_(0, YY_("syntax error"));
> -      YYCASE_(1, YY_("syntax error, unexpected %s"));
> -      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
> -      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
> -      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
> -      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
> -# undef YYCASE_
> -    }
> -
> -  {
> -    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
> -    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
> -      return 2;
> -    yysize = yysize1;
> -  }
> -
> -  if (*yymsg_alloc < yysize)
> -    {
> -      *yymsg_alloc = 2 * yysize;
> -      if (! (yysize <= *yymsg_alloc
> -             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
> -        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
> -      return 1;
> -    }
> -
> -  /* Avoid sprintf, as that infringes on the user's name space.
> -     Don't have undefined behavior even if the translation
> -     produced a string with the wrong number of "%s"s.  */
> -  {
> -    char *yyp = *yymsg;
> -    int yyi = 0;
> -    while ((*yyp = *yyformat) != '\0')
> -      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
> -        {
> -          yyp += yytnamerr (yyp, yyarg[yyi++]);
> -          yyformat += 2;
> -        }
> -      else
> -        {
> -          yyp++;
> -          yyformat++;
> -        }
> -  }
> -  return 0;
> -}
> -#endif /* YYERROR_VERBOSE */
> -
> -/*-----------------------------------------------.
> -| Release the memory associated to this symbol.  |
> -`-----------------------------------------------*/
> -
> -static void
> -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
> -{
> -  YYUSE (yyvaluep);
> -  YYUSE (yylocationp);
> -  if (!yymsg)
> -    yymsg = "Deleting";
> -  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
> -
> -  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
> -  YYUSE (yytype);
> -  YY_IGNORE_MAYBE_UNINITIALIZED_END
> -}
> -
> -
> -
> -
> -/* The lookahead symbol.  */
> -int yychar;
> -
> -/* The semantic value of the lookahead symbol.  */
> -YYSTYPE yylval;
> -/* Location data for the lookahead symbol.  */
> -YYLTYPE yylloc
> -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
> -  = { 1, 1, 1, 1 }
> -# endif
> -;
> -/* Number of syntax errors so far.  */
> -int yynerrs;
> -
> -
> -/*----------.
> -| yyparse.  |
> -`----------*/
> -
> -int
> -yyparse (void)
> -{
> -    int yystate;
> -    /* Number of tokens to shift before error messages enabled.  */
> -    int yyerrstatus;
> -
> -    /* The stacks and their tools:
> -       'yyss': related to states.
> -       'yyvs': related to semantic values.
> -       'yyls': related to locations.
> -
> -       Refer to the stacks through separate pointers, to allow yyoverflow
> -       to reallocate them elsewhere.  */
> -
> -    /* The state stack.  */
> -    yytype_int16 yyssa[YYINITDEPTH];
> -    yytype_int16 *yyss;
> -    yytype_int16 *yyssp;
> -
> -    /* The semantic value stack.  */
> -    YYSTYPE yyvsa[YYINITDEPTH];
> -    YYSTYPE *yyvs;
> -    YYSTYPE *yyvsp;
> -
> -    /* The location stack.  */
> -    YYLTYPE yylsa[YYINITDEPTH];
> -    YYLTYPE *yyls;
> -    YYLTYPE *yylsp;
> -
> -    /* The locations where the error started and ended.  */
> -    YYLTYPE yyerror_range[3];
> -
> -    YYSIZE_T yystacksize;
> -
> -  int yyn;
> -  int yyresult;
> -  /* Lookahead token as an internal (translated) token number.  */
> -  int yytoken = 0;
> -  /* The variables used to return semantic value and location from the
> -     action routines.  */
> -  YYSTYPE yyval;
> -  YYLTYPE yyloc;
> -
> -#if YYERROR_VERBOSE
> -  /* Buffer for error messages, and its allocated size.  */
> -  char yymsgbuf[128];
> -  char *yymsg = yymsgbuf;
> -  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
> -#endif
> -
> -#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
> -
> -  /* The number of symbols on the RHS of the reduced rule.
> -     Keep to zero when no symbol should be popped.  */
> -  int yylen = 0;
> -
> -  yyssp = yyss = yyssa;
> -  yyvsp = yyvs = yyvsa;
> -  yylsp = yyls = yylsa;
> -  yystacksize = YYINITDEPTH;
> -
> -  YYDPRINTF ((stderr, "Starting parse\n"));
> -
> -  yystate = 0;
> -  yyerrstatus = 0;
> -  yynerrs = 0;
> -  yychar = YYEMPTY; /* Cause a token to be read.  */
> -  yylsp[0] = yylloc;
> -  goto yysetstate;
> -
> -/*------------------------------------------------------------.
> -| yynewstate -- Push a new state, which is found in yystate.  |
> -`------------------------------------------------------------*/
> - yynewstate:
> -  /* In all cases, when you get here, the value and location stacks
> -     have just been pushed.  So pushing a state here evens the stacks.  */
> -  yyssp++;
> -
> - yysetstate:
> -  *yyssp = yystate;
> -
> -  if (yyss + yystacksize - 1 <= yyssp)
> -    {
> -      /* Get the current used size of the three stacks, in elements.  */
> -      YYSIZE_T yysize = yyssp - yyss + 1;
> -
> -#ifdef yyoverflow
> -      {
> -        /* Give user a chance to reallocate the stack.  Use copies of
> -           these so that the &'s don't force the real ones into
> -           memory.  */
> -        YYSTYPE *yyvs1 = yyvs;
> -        yytype_int16 *yyss1 = yyss;
> -        YYLTYPE *yyls1 = yyls;
> -
> -        /* Each stack pointer address is followed by the size of the
> -           data in use in that stack, in bytes.  This used to be a
> -           conditional around just the two extra args, but that might
> -           be undefined if yyoverflow is a macro.  */
> -        yyoverflow (YY_("memory exhausted"),
> -                    &yyss1, yysize * sizeof (*yyssp),
> -                    &yyvs1, yysize * sizeof (*yyvsp),
> -                    &yyls1, yysize * sizeof (*yylsp),
> -                    &yystacksize);
> -
> -        yyls = yyls1;
> -        yyss = yyss1;
> -        yyvs = yyvs1;
> -      }
> -#else /* no yyoverflow */
> -# ifndef YYSTACK_RELOCATE
> -      goto yyexhaustedlab;
> -# else
> -      /* Extend the stack our own way.  */
> -      if (YYMAXDEPTH <= yystacksize)
> -        goto yyexhaustedlab;
> -      yystacksize *= 2;
> -      if (YYMAXDEPTH < yystacksize)
> -        yystacksize = YYMAXDEPTH;
> -
> -      {
> -        yytype_int16 *yyss1 = yyss;
> -        union yyalloc *yyptr =
> -          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
> -        if (! yyptr)
> -          goto yyexhaustedlab;
> -        YYSTACK_RELOCATE (yyss_alloc, yyss);
> -        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
> -        YYSTACK_RELOCATE (yyls_alloc, yyls);
> -#  undef YYSTACK_RELOCATE
> -        if (yyss1 != yyssa)
> -          YYSTACK_FREE (yyss1);
> -      }
> -# endif
> -#endif /* no yyoverflow */
> -
> -      yyssp = yyss + yysize - 1;
> -      yyvsp = yyvs + yysize - 1;
> -      yylsp = yyls + yysize - 1;
> -
> -      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
> -                  (unsigned long int) yystacksize));
> -
> -      if (yyss + yystacksize - 1 <= yyssp)
> -        YYABORT;
> -    }
> -
> -  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
> -
> -  if (yystate == YYFINAL)
> -    YYACCEPT;
> -
> -  goto yybackup;
> -
> -/*-----------.
> -| yybackup.  |
> -`-----------*/
> -yybackup:
> -
> -  /* Do appropriate processing given the current state.  Read a
> -     lookahead token if we need one and don't already have one.  */
> -
> -  /* First try to decide what to do without reference to lookahead token.  */
> -  yyn = yypact[yystate];
> -  if (yypact_value_is_default (yyn))
> -    goto yydefault;
> -
> -  /* Not known => get a lookahead token if don't already have one.  */
> -
> -  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
> -  if (yychar == YYEMPTY)
> -    {
> -      YYDPRINTF ((stderr, "Reading a token: "));
> -      yychar = yylex ();
> -    }
> -
> -  if (yychar <= YYEOF)
> -    {
> -      yychar = yytoken = YYEOF;
> -      YYDPRINTF ((stderr, "Now at end of input.\n"));
> -    }
> -  else
> -    {
> -      yytoken = YYTRANSLATE (yychar);
> -      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
> -    }
> -
> -  /* If the proper action on seeing token YYTOKEN is to reduce or to
> -     detect an error, take that action.  */
> -  yyn += yytoken;
> -  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
> -    goto yydefault;
> -  yyn = yytable[yyn];
> -  if (yyn <= 0)
> -    {
> -      if (yytable_value_is_error (yyn))
> -        goto yyerrlab;
> -      yyn = -yyn;
> -      goto yyreduce;
> -    }
> -
> -  /* Count tokens shifted since error; after three, turn off error
> -     status.  */
> -  if (yyerrstatus)
> -    yyerrstatus--;
> -
> -  /* Shift the lookahead token.  */
> -  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
> -
> -  /* Discard the shifted token.  */
> -  yychar = YYEMPTY;
> -
> -  yystate = yyn;
> -  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
> -  *++yyvsp = yylval;
> -  YY_IGNORE_MAYBE_UNINITIALIZED_END
> -  *++yylsp = yylloc;
> -  goto yynewstate;
> -
> -
> -/*-----------------------------------------------------------.
> -| yydefault -- do the default action for the current state.  |
> -`-----------------------------------------------------------*/
> -yydefault:
> -  yyn = yydefact[yystate];
> -  if (yyn == 0)
> -    goto yyerrlab;
> -  goto yyreduce;
> -
> -
> -/*-----------------------------.
> -| yyreduce -- Do a reduction.  |
> -`-----------------------------*/
> -yyreduce:
> -  /* yyn is the number of a rule to reduce with.  */
> -  yylen = yyr2[yyn];
> -
> -  /* If YYLEN is nonzero, implement the default value of the action:
> -     '$$ = $1'.
> -
> -     Otherwise, the following line sets YYVAL to garbage.
> -     This behavior is undocumented and Bison
> -     users should not rely upon it.  Assigning to YYVAL
> -     unconditionally makes the parser a bit smaller, and it avoids a
> -     GCC warning that YYVAL may be used uninitialized.  */
> -  yyval = yyvsp[1-yylen];
> -
> -  /* Default location.  */
> -  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
> -  YY_REDUCE_PRINT (yyn);
> -  switch (yyn)
> -    {
> -        case 2:
> -#line 110 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			parser_output = build_dt_info((yyvsp[-2].flags), (yyvsp[-1].re), (yyvsp[0].node),
> -			                              guess_boot_cpuid((yyvsp[0].node)));
> -		}
> -#line 1478 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 3:
> -#line 118 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.flags) = DTSF_V1;
> -		}
> -#line 1486 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 4:
> -#line 122 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.flags) = DTSF_V1 | DTSF_PLUGIN;
> -		}
> -#line 1494 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 6:
> -#line 130 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			if ((yyvsp[0].flags) != (yyvsp[-1].flags))
> -				ERROR(&(yylsp[0]), "Header flags don't match earlier ones");
> -			(yyval.flags) = (yyvsp[-1].flags);
> -		}
> -#line 1504 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 7:
> -#line 139 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.re) = NULL;
> -		}
> -#line 1512 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 8:
> -#line 143 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
> -		}
> -#line 1520 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 9:
> -#line 150 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
> -		}
> -#line 1528 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 10:
> -#line 154 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			add_label(&(yyvsp[0].re)->labels, (yyvsp[-1].labelref));
> -			(yyval.re) = (yyvsp[0].re);
> -		}
> -#line 1537 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 11:
> -#line 162 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.node) = name_node((yyvsp[0].node), "");
> -		}
> -#line 1545 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 12:
> -#line 166 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.node) = merge_nodes((yyvsp[-2].node), (yyvsp[0].node));
> -		}
> -#line 1553 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 13:
> -#line 171 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
> -
> -			if (target) {
> -				add_label(&target->labels, (yyvsp[-2].labelref));
> -				merge_nodes(target, (yyvsp[0].node));
> -			} else
> -				ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
> -			(yyval.node) = (yyvsp[-3].node);
> -		}
> -#line 1568 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 14:
> -#line 182 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			struct node *target = get_node_by_ref((yyvsp[-2].node), (yyvsp[-1].labelref));
> -
> -			if (target) {
> -				merge_nodes(target, (yyvsp[0].node));
> -			} else {
> -				/*
> -				 * We rely on the rule being always:
> -				 *   versioninfo plugindecl memreserves devicetree
> -				 * so $-1 is what we want (plugindecl)
> -				 */
> -				if ((yyvsp[(-1) - (3)].flags) & DTSF_PLUGIN)
> -					add_orphan_node((yyvsp[-2].node), (yyvsp[0].node), (yyvsp[-1].labelref));
> -				else
> -					ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
> -			}
> -			(yyval.node) = (yyvsp[-2].node);
> -		}
> -#line 1591 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 15:
> -#line 201 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
> -
> -			if (target)
> -				delete_node(target);
> -			else
> -				ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
> -
> -
> -			(yyval.node) = (yyvsp[-3].node);
> -		}
> -#line 1607 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 16:
> -#line 213 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			/* build empty node */
> -			(yyval.node) = name_node(build_node(NULL, NULL), "");
> -		}
> -#line 1616 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 17:
> -#line 221 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.node) = build_node((yyvsp[-3].proplist), (yyvsp[-2].nodelist));
> -		}
> -#line 1624 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 18:
> -#line 228 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.proplist) = NULL;
> -		}
> -#line 1632 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 19:
> -#line 232 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.proplist) = chain_property((yyvsp[0].prop), (yyvsp[-1].proplist));
> -		}
> -#line 1640 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 20:
> -#line 239 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.prop) = build_property((yyvsp[-3].propnodename), (yyvsp[-1].data));
> -		}
> -#line 1648 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 21:
> -#line 243 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.prop) = build_property((yyvsp[-1].propnodename), empty_data);
> -		}
> -#line 1656 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 22:
> -#line 247 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.prop) = build_property_delete((yyvsp[-1].propnodename));
> -		}
> -#line 1664 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 23:
> -#line 251 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			add_label(&(yyvsp[0].prop)->labels, (yyvsp[-1].labelref));
> -			(yyval.prop) = (yyvsp[0].prop);
> -		}
> -#line 1673 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 24:
> -#line 259 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.data) = data_merge((yyvsp[-1].data), (yyvsp[0].data));
> -		}
> -#line 1681 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 25:
> -#line 263 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.data) = data_merge((yyvsp[-2].data), (yyvsp[-1].array).data);
> -		}
> -#line 1689 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 26:
> -#line 267 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.data) = data_merge((yyvsp[-3].data), (yyvsp[-1].data));
> -		}
> -#line 1697 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 27:
> -#line 271 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.data) = data_add_marker((yyvsp[-1].data), REF_PATH, (yyvsp[0].labelref));
> -		}
> -#line 1705 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 28:
> -#line 275 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			FILE *f = srcfile_relative_open((yyvsp[-5].data).val, NULL);
> -			struct data d;
> -
> -			if ((yyvsp[-3].integer) != 0)
> -				if (fseek(f, (yyvsp[-3].integer), SEEK_SET) != 0)
> -					die("Couldn't seek to offset %llu in \"%s\": %s",
> -					    (unsigned long long)(yyvsp[-3].integer), (yyvsp[-5].data).val,
> -					    strerror(errno));
> -
> -			d = data_copy_file(f, (yyvsp[-1].integer));
> -
> -			(yyval.data) = data_merge((yyvsp[-8].data), d);
> -			fclose(f);
> -		}
> -#line 1725 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 29:
> -#line 291 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			FILE *f = srcfile_relative_open((yyvsp[-1].data).val, NULL);
> -			struct data d = empty_data;
> -
> -			d = data_copy_file(f, -1);
> -
> -			(yyval.data) = data_merge((yyvsp[-4].data), d);
> -			fclose(f);
> -		}
> -#line 1739 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 30:
> -#line 301 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
> -		}
> -#line 1747 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 31:
> -#line 308 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.data) = empty_data;
> -		}
> -#line 1755 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 32:
> -#line 312 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.data) = (yyvsp[-1].data);
> -		}
> -#line 1763 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 33:
> -#line 316 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
> -		}
> -#line 1771 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 34:
> -#line 323 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			unsigned long long bits;
> -
> -			bits = (yyvsp[-1].integer);
> -
> -			if ((bits !=  8) && (bits != 16) &&
> -			    (bits != 32) && (bits != 64)) {
> -				ERROR(&(yylsp[-1]), "Array elements must be"
> -				      " 8, 16, 32 or 64-bits");
> -				bits = 32;
> -			}
> -
> -			(yyval.array).data = empty_data;
> -			(yyval.array).bits = bits;
> -		}
> -#line 1791 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 35:
> -#line 339 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.array).data = empty_data;
> -			(yyval.array).bits = 32;
> -		}
> -#line 1800 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 36:
> -#line 344 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			if ((yyvsp[-1].array).bits < 64) {
> -				uint64_t mask = (1ULL << (yyvsp[-1].array).bits) - 1;
> -				/*
> -				 * Bits above mask must either be all zero
> -				 * (positive within range of mask) or all one
> -				 * (negative and sign-extended). The second
> -				 * condition is true if when we set all bits
> -				 * within the mask to one (i.e. | in the
> -				 * mask), all bits are one.
> -				 */
> -				if (((yyvsp[0].integer) > mask) && (((yyvsp[0].integer) | mask) != -1ULL))
> -					ERROR(&(yylsp[0]), "Value out of range for"
> -					      " %d-bit array element", (yyvsp[-1].array).bits);
> -			}
> -
> -			(yyval.array).data = data_append_integer((yyvsp[-1].array).data, (yyvsp[0].integer), (yyvsp[-1].array).bits);
> -		}
> -#line 1823 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 37:
> -#line 363 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			uint64_t val = ~0ULL >> (64 - (yyvsp[-1].array).bits);
> -
> -			if ((yyvsp[-1].array).bits == 32)
> -				(yyvsp[-1].array).data = data_add_marker((yyvsp[-1].array).data,
> -							  REF_PHANDLE,
> -							  (yyvsp[0].labelref));
> -			else
> -				ERROR(&(yylsp[0]), "References are only allowed in "
> -					    "arrays with 32-bit elements.");
> -
> -			(yyval.array).data = data_append_integer((yyvsp[-1].array).data, val, (yyvsp[-1].array).bits);
> -		}
> -#line 1841 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 38:
> -#line 377 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.array).data = data_add_marker((yyvsp[-1].array).data, LABEL, (yyvsp[0].labelref));
> -		}
> -#line 1849 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 41:
> -#line 386 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.integer) = (yyvsp[-1].integer);
> -		}
> -#line 1857 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 44:
> -#line 397 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-4].integer) ? (yyvsp[-2].integer) : (yyvsp[0].integer); }
> -#line 1863 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 46:
> -#line 402 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) || (yyvsp[0].integer); }
> -#line 1869 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 48:
> -#line 407 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) && (yyvsp[0].integer); }
> -#line 1875 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 50:
> -#line 412 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) | (yyvsp[0].integer); }
> -#line 1881 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 52:
> -#line 417 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) ^ (yyvsp[0].integer); }
> -#line 1887 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 54:
> -#line 422 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) & (yyvsp[0].integer); }
> -#line 1893 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 56:
> -#line 427 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) == (yyvsp[0].integer); }
> -#line 1899 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 57:
> -#line 428 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) != (yyvsp[0].integer); }
> -#line 1905 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 59:
> -#line 433 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) < (yyvsp[0].integer); }
> -#line 1911 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 60:
> -#line 434 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) > (yyvsp[0].integer); }
> -#line 1917 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 61:
> -#line 435 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) <= (yyvsp[0].integer); }
> -#line 1923 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 62:
> -#line 436 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) >= (yyvsp[0].integer); }
> -#line 1929 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 63:
> -#line 440 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) << (yyvsp[0].integer); }
> -#line 1935 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 64:
> -#line 441 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) >> (yyvsp[0].integer); }
> -#line 1941 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 66:
> -#line 446 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) + (yyvsp[0].integer); }
> -#line 1947 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 67:
> -#line 447 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) - (yyvsp[0].integer); }
> -#line 1953 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 69:
> -#line 452 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = (yyvsp[-2].integer) * (yyvsp[0].integer); }
> -#line 1959 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 70:
> -#line 454 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			if ((yyvsp[0].integer) != 0) {
> -				(yyval.integer) = (yyvsp[-2].integer) / (yyvsp[0].integer);
> -			} else {
> -				ERROR(&(yyloc), "Division by zero");
> -				(yyval.integer) = 0;
> -			}
> -		}
> -#line 1972 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 71:
> -#line 463 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			if ((yyvsp[0].integer) != 0) {
> -				(yyval.integer) = (yyvsp[-2].integer) % (yyvsp[0].integer);
> -			} else {
> -				ERROR(&(yyloc), "Division by zero");
> -				(yyval.integer) = 0;
> -			}
> -		}
> -#line 1985 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 74:
> -#line 476 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = -(yyvsp[0].integer); }
> -#line 1991 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 75:
> -#line 477 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = ~(yyvsp[0].integer); }
> -#line 1997 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 76:
> -#line 478 "dtc-parser.y" /* yacc.c:1646  */
> -    { (yyval.integer) = !(yyvsp[0].integer); }
> -#line 2003 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 77:
> -#line 483 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.data) = empty_data;
> -		}
> -#line 2011 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 78:
> -#line 487 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.data) = data_append_byte((yyvsp[-1].data), (yyvsp[0].byte));
> -		}
> -#line 2019 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 79:
> -#line 491 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
> -		}
> -#line 2027 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 80:
> -#line 498 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.nodelist) = NULL;
> -		}
> -#line 2035 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 81:
> -#line 502 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.nodelist) = chain_node((yyvsp[-1].node), (yyvsp[0].nodelist));
> -		}
> -#line 2043 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 82:
> -#line 506 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			ERROR(&(yylsp[0]), "Properties must precede subnodes");
> -			YYERROR;
> -		}
> -#line 2052 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 83:
> -#line 514 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.node) = name_node((yyvsp[0].node), (yyvsp[-1].propnodename));
> -		}
> -#line 2060 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 84:
> -#line 518 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			(yyval.node) = name_node(build_node_delete(), (yyvsp[-1].propnodename));
> -		}
> -#line 2068 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -  case 85:
> -#line 522 "dtc-parser.y" /* yacc.c:1646  */
> -    {
> -			add_label(&(yyvsp[0].node)->labels, (yyvsp[-1].labelref));
> -			(yyval.node) = (yyvsp[0].node);
> -		}
> -#line 2077 "dtc-parser.tab.c" /* yacc.c:1646  */
> -    break;
> -
> -
> -#line 2081 "dtc-parser.tab.c" /* yacc.c:1646  */
> -      default: break;
> -    }
> -  /* User semantic actions sometimes alter yychar, and that requires
> -     that yytoken be updated with the new translation.  We take the
> -     approach of translating immediately before every use of yytoken.
> -     One alternative is translating here after every semantic action,
> -     but that translation would be missed if the semantic action invokes
> -     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
> -     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
> -     incorrect destructor might then be invoked immediately.  In the
> -     case of YYERROR or YYBACKUP, subsequent parser actions might lead
> -     to an incorrect destructor call or verbose syntax error message
> -     before the lookahead is translated.  */
> -  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
> -
> -  YYPOPSTACK (yylen);
> -  yylen = 0;
> -  YY_STACK_PRINT (yyss, yyssp);
> -
> -  *++yyvsp = yyval;
> -  *++yylsp = yyloc;
> -
> -  /* Now 'shift' the result of the reduction.  Determine what state
> -     that goes to, based on the state we popped back to and the rule
> -     number reduced by.  */
> -
> -  yyn = yyr1[yyn];
> -
> -  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
> -  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
> -    yystate = yytable[yystate];
> -  else
> -    yystate = yydefgoto[yyn - YYNTOKENS];
> -
> -  goto yynewstate;
> -
> -
> -/*--------------------------------------.
> -| yyerrlab -- here on detecting error.  |
> -`--------------------------------------*/
> -yyerrlab:
> -  /* Make sure we have latest lookahead translation.  See comments at
> -     user semantic actions for why this is necessary.  */
> -  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
> -
> -  /* If not already recovering from an error, report this error.  */
> -  if (!yyerrstatus)
> -    {
> -      ++yynerrs;
> -#if ! YYERROR_VERBOSE
> -      yyerror (YY_("syntax error"));
> -#else
> -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
> -                                        yyssp, yytoken)
> -      {
> -        char const *yymsgp = YY_("syntax error");
> -        int yysyntax_error_status;
> -        yysyntax_error_status = YYSYNTAX_ERROR;
> -        if (yysyntax_error_status == 0)
> -          yymsgp = yymsg;
> -        else if (yysyntax_error_status == 1)
> -          {
> -            if (yymsg != yymsgbuf)
> -              YYSTACK_FREE (yymsg);
> -            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
> -            if (!yymsg)
> -              {
> -                yymsg = yymsgbuf;
> -                yymsg_alloc = sizeof yymsgbuf;
> -                yysyntax_error_status = 2;
> -              }
> -            else
> -              {
> -                yysyntax_error_status = YYSYNTAX_ERROR;
> -                yymsgp = yymsg;
> -              }
> -          }
> -        yyerror (yymsgp);
> -        if (yysyntax_error_status == 2)
> -          goto yyexhaustedlab;
> -      }
> -# undef YYSYNTAX_ERROR
> -#endif
> -    }
> -
> -  yyerror_range[1] = yylloc;
> -
> -  if (yyerrstatus == 3)
> -    {
> -      /* If just tried and failed to reuse lookahead token after an
> -         error, discard it.  */
> -
> -      if (yychar <= YYEOF)
> -        {
> -          /* Return failure if at end of input.  */
> -          if (yychar == YYEOF)
> -            YYABORT;
> -        }
> -      else
> -        {
> -          yydestruct ("Error: discarding",
> -                      yytoken, &yylval, &yylloc);
> -          yychar = YYEMPTY;
> -        }
> -    }
> -
> -  /* Else will try to reuse lookahead token after shifting the error
> -     token.  */
> -  goto yyerrlab1;
> -
> -
> -/*---------------------------------------------------.
> -| yyerrorlab -- error raised explicitly by YYERROR.  |
> -`---------------------------------------------------*/
> -yyerrorlab:
> -
> -  /* Pacify compilers like GCC when the user code never invokes
> -     YYERROR and the label yyerrorlab therefore never appears in user
> -     code.  */
> -  if (/*CONSTCOND*/ 0)
> -     goto yyerrorlab;
> -
> -  yyerror_range[1] = yylsp[1-yylen];
> -  /* Do not reclaim the symbols of the rule whose action triggered
> -     this YYERROR.  */
> -  YYPOPSTACK (yylen);
> -  yylen = 0;
> -  YY_STACK_PRINT (yyss, yyssp);
> -  yystate = *yyssp;
> -  goto yyerrlab1;
> -
> -
> -/*-------------------------------------------------------------.
> -| yyerrlab1 -- common code for both syntax error and YYERROR.  |
> -`-------------------------------------------------------------*/
> -yyerrlab1:
> -  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
> -
> -  for (;;)
> -    {
> -      yyn = yypact[yystate];
> -      if (!yypact_value_is_default (yyn))
> -        {
> -          yyn += YYTERROR;
> -          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
> -            {
> -              yyn = yytable[yyn];
> -              if (0 < yyn)
> -                break;
> -            }
> -        }
> -
> -      /* Pop the current state because it cannot handle the error token.  */
> -      if (yyssp == yyss)
> -        YYABORT;
> -
> -      yyerror_range[1] = *yylsp;
> -      yydestruct ("Error: popping",
> -                  yystos[yystate], yyvsp, yylsp);
> -      YYPOPSTACK (1);
> -      yystate = *yyssp;
> -      YY_STACK_PRINT (yyss, yyssp);
> -    }
> -
> -  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
> -  *++yyvsp = yylval;
> -  YY_IGNORE_MAYBE_UNINITIALIZED_END
> -
> -  yyerror_range[2] = yylloc;
> -  /* Using YYLLOC is tempting, but would change the location of
> -     the lookahead.  YYLOC is available though.  */
> -  YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
> -  *++yylsp = yyloc;
> -
> -  /* Shift the error token.  */
> -  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
> -
> -  yystate = yyn;
> -  goto yynewstate;
> -
> -
> -/*-------------------------------------.
> -| yyacceptlab -- YYACCEPT comes here.  |
> -`-------------------------------------*/
> -yyacceptlab:
> -  yyresult = 0;
> -  goto yyreturn;
> -
> -/*-----------------------------------.
> -| yyabortlab -- YYABORT comes here.  |
> -`-----------------------------------*/
> -yyabortlab:
> -  yyresult = 1;
> -  goto yyreturn;
> -
> -#if !defined yyoverflow || YYERROR_VERBOSE
> -/*-------------------------------------------------.
> -| yyexhaustedlab -- memory exhaustion comes here.  |
> -`-------------------------------------------------*/
> -yyexhaustedlab:
> -  yyerror (YY_("memory exhausted"));
> -  yyresult = 2;
> -  /* Fall through.  */
> -#endif
> -
> -yyreturn:
> -  if (yychar != YYEMPTY)
> -    {
> -      /* Make sure we have latest lookahead translation.  See comments at
> -         user semantic actions for why this is necessary.  */
> -      yytoken = YYTRANSLATE (yychar);
> -      yydestruct ("Cleanup: discarding lookahead",
> -                  yytoken, &yylval, &yylloc);
> -    }
> -  /* Do not reclaim the symbols of the rule whose action triggered
> -     this YYABORT or YYACCEPT.  */
> -  YYPOPSTACK (yylen);
> -  YY_STACK_PRINT (yyss, yyssp);
> -  while (yyssp != yyss)
> -    {
> -      yydestruct ("Cleanup: popping",
> -                  yystos[*yyssp], yyvsp, yylsp);
> -      YYPOPSTACK (1);
> -    }
> -#ifndef yyoverflow
> -  if (yyss != yyssa)
> -    YYSTACK_FREE (yyss);
> -#endif
> -#if YYERROR_VERBOSE
> -  if (yymsg != yymsgbuf)
> -    YYSTACK_FREE (yymsg);
> -#endif
> -  return yyresult;
> -}
> -#line 528 "dtc-parser.y" /* yacc.c:1906  */
> -
> -
> -void yyerror(char const *s)
> -{
> -	ERROR(&yylloc, "%s", s);
> -}
> diff --git a/scripts/dtc/dtc-parser.tab.h_shipped b/scripts/dtc/dtc-parser.tab.h_shipped
> deleted file mode 100644
> index 6aa512c1b337..000000000000
> --- a/scripts/dtc/dtc-parser.tab.h_shipped
> +++ /dev/null
> @@ -1,125 +0,0 @@
> -/* A Bison parser, made by GNU Bison 3.0.4.  */
> -
> -/* Bison interface for Yacc-like parsers in C
> -
> -   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
> -
> -   This program is free software: you can redistribute it and/or modify
> -   it under the terms of the GNU General Public License as published by
> -   the Free Software Foundation, either version 3 of the License, or
> -   (at your option) any later version.
> -
> -   This program is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> -   GNU General Public License for more details.
> -
> -   You should have received a copy of the GNU General Public License
> -   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
> -
> -/* As a special exception, you may create a larger work that contains
> -   part or all of the Bison parser skeleton and distribute that work
> -   under terms of your choice, so long as that work isn't itself a
> -   parser generator using the skeleton or a modified version thereof
> -   as a parser skeleton.  Alternatively, if you modify or redistribute
> -   the parser skeleton itself, you may (at your option) remove this
> -   special exception, which will cause the skeleton and the resulting
> -   Bison output files to be licensed under the GNU General Public
> -   License without this special exception.
> -
> -   This special exception was added by the Free Software Foundation in
> -   version 2.2 of Bison.  */
> -
> -#ifndef YY_YY_DTC_PARSER_TAB_H_INCLUDED
> -# define YY_YY_DTC_PARSER_TAB_H_INCLUDED
> -/* Debug traces.  */
> -#ifndef YYDEBUG
> -# define YYDEBUG 0
> -#endif
> -#if YYDEBUG
> -extern int yydebug;
> -#endif
> -
> -/* Token type.  */
> -#ifndef YYTOKENTYPE
> -# define YYTOKENTYPE
> -  enum yytokentype
> -  {
> -    DT_V1 = 258,
> -    DT_PLUGIN = 259,
> -    DT_MEMRESERVE = 260,
> -    DT_LSHIFT = 261,
> -    DT_RSHIFT = 262,
> -    DT_LE = 263,
> -    DT_GE = 264,
> -    DT_EQ = 265,
> -    DT_NE = 266,
> -    DT_AND = 267,
> -    DT_OR = 268,
> -    DT_BITS = 269,
> -    DT_DEL_PROP = 270,
> -    DT_DEL_NODE = 271,
> -    DT_PROPNODENAME = 272,
> -    DT_LITERAL = 273,
> -    DT_CHAR_LITERAL = 274,
> -    DT_BYTE = 275,
> -    DT_STRING = 276,
> -    DT_LABEL = 277,
> -    DT_REF = 278,
> -    DT_INCBIN = 279
> -  };
> -#endif
> -
> -/* Value type.  */
> -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
> -
> -union YYSTYPE
> -{
> -#line 39 "dtc-parser.y" /* yacc.c:1909  */
> -
> -	char *propnodename;
> -	char *labelref;
> -	uint8_t byte;
> -	struct data data;
> -
> -	struct {
> -		struct data	data;
> -		int		bits;
> -	} array;
> -
> -	struct property *prop;
> -	struct property *proplist;
> -	struct node *node;
> -	struct node *nodelist;
> -	struct reserve_info *re;
> -	uint64_t integer;
> -	unsigned int flags;
> -
> -#line 99 "dtc-parser.tab.h" /* yacc.c:1909  */
> -};
> -
> -typedef union YYSTYPE YYSTYPE;
> -# define YYSTYPE_IS_TRIVIAL 1
> -# define YYSTYPE_IS_DECLARED 1
> -#endif
> -
> -/* Location type.  */
> -#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
> -typedef struct YYLTYPE YYLTYPE;
> -struct YYLTYPE
> -{
> -  int first_line;
> -  int first_column;
> -  int last_line;
> -  int last_column;
> -};
> -# define YYLTYPE_IS_DECLARED 1
> -# define YYLTYPE_IS_TRIVIAL 1
> -#endif
> -
> -
> -extern YYSTYPE yylval;
> -extern YYLTYPE yylloc;
> -int yyparse (void);
> -
> -#endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED  */
> diff --git a/scripts/dtc/update-dtc-source.sh b/scripts/dtc/update-dtc-source.sh
> index f3e5c596050a..1a009fd195d0 100755
> --- a/scripts/dtc/update-dtc-source.sh
> +++ b/scripts/dtc/update-dtc-source.sh
> @@ -1,9 +1,10 @@
>  #!/bin/sh
> +# SPDX-License-Identifier: GPL-2.0
>  # Simple script to update the version of DTC carried by the Linux kernel
>  #
>  # This script assumes that the dtc and the linux git trees are in the
>  # same directory. After building dtc in the dtc directory, it copies the
> -# source files and generated source files into the scripts/dtc directory
> +# source files and generated source file(s) into the scripts/dtc directory
>  # in the kernel and creates a git commit updating them to the new
>  # version.
>  #
> @@ -33,7 +34,6 @@ DTC_LINUX_PATH=`pwd`/scripts/dtc
>  DTC_SOURCE="checks.c data.c dtc.c dtc.h flattree.c fstree.c livetree.c srcpos.c \
>  		srcpos.h treesource.c util.c util.h version_gen.h Makefile.dtc \
>  		dtc-lexer.l dtc-parser.y"
> -DTC_GENERATED="dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h"
>  LIBFDT_SOURCE="Makefile.libfdt fdt.c fdt.h fdt_addresses.c fdt_empty_tree.c \
>  		fdt_overlay.c fdt_ro.c fdt_rw.c fdt_strerror.c fdt_sw.c \
>  		fdt_wip.c libfdt.h libfdt_env.h libfdt_internal.h"
> @@ -58,10 +58,6 @@ for f in $DTC_SOURCE; do
>  	cp ${DTC_UPSTREAM_PATH}/${f} ${f}
>  	git add ${f}
>  done
> -for f in $DTC_GENERATED; do
> -	cp ${DTC_UPSTREAM_PATH}/$f ${f}_shipped
> -	git add ${f}_shipped
> -done
>  for f in $LIBFDT_SOURCE; do
>         cp ${DTC_UPSTREAM_PATH}/libfdt/${f} libfdt/${f}
>         git add libfdt/${f}
> -- 
> 2.17.0
> 
> 

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 4/6] scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987
  2018-05-15 13:46         ` Eugeniu Rosca
@ 2018-05-15 16:05           ` Simon Glass
  0 siblings, 0 replies; 31+ messages in thread
From: Simon Glass @ 2018-05-15 16:05 UTC (permalink / raw)
  To: u-boot

Hi,

On 15 May 2018 at 23:46, Eugeniu Rosca <erosca@de.adit-jv.com> wrote:
> Hi Simon,
>
> On Mon, May 14, 2018 at 01:52:09PM -0600, Simon Glass wrote:
>> Hi,
>>
>> On 13 May 2018 at 16:45, Eugeniu Rosca <roscaeugeniu@gmail.com> wrote:
>> > Hi Simon,
>> >
>> > On Mon, May 14, 2018 at 08:00:40AM +1000, Simon Glass wrote:
>> >> Hi,
>> >>
>> >> Can you please check that this does not adversely impact code size?
>> >
>> > Sure. Here are the sizes before and after this patch (sandbox):
>> >
>> > 1. ELF size comparison shows 96 bytes increase
>> > $ du -b u-boot.before u-boot.after
>> >   8055864       u-boot.before
>> >   8055960       u-boot.after
>> >
>> > 2. BIN size comparison shows no change
>> > $ du -b u-boot.bin.before u-boot.bin.after
>> >   3377256       u-boot.bin.before
>> >   3377256       u-boot.bin.after
>> >
>> > 3. "size" tool gives more details about ELF file size increase:
>> > $ size u-boot.before u-boot.after
>> >    text    data     bss     dec     hex filename
>> >    1199720        76952  291760 1568432  17eeb0 u-boot.before
>> >    1199736        76952  291760 1568448  17eec0 u-boot.after
>>
>> Thanks for the info. That seems OK, but please check sandbox_spl (or
>> better yet one of the Thumb2 SPL images that uses libfdt) since it is
>> SPL that matters most.
>
> I am having issues bringing up buildman on my host, so I just went
> through the same procedure of building before and after using make
> and comparing the ELF/BIN size for:
> 1. sandbox_spl_defconfig
> 2. x600_defconfig
>
> There is no drastic change to previous results.
>
> 1.1 sandbox_spl_defconfig ELF size increase: 7394784-7394712 = 72 bytes.
> 1.2 sandbox_spl_defconfig BIN size increase: 3298280-3298280 = 0 bytes.
>
> 2.1 x600_defconfig ELF size increase: 3766144-3766232 = 88 bytes.
> 2.2 x600_defconfig BIN size increase: 439288-439240 = 48 bytes.
>

OK

Reviewed-by: Simon Glass <sjg@chromium.org>

>> >
>> > 4. "bloaty" (diff mode) gives even more details (confirming the above)
>> > $ bloaty -d compileunits u-boot.after -- u-boot.before
>> >      VM SIZE                                FILE SIZE
>> >  --------------                          --------------
>> >   +2.5%     +30 lib/libfdt/fdt.c             +96  +1.5%
>> >   [ = ]       0 lib/libfdt/fdt_sw.c          +21  +0.1%
>> >   +2.6%     +16 [LOAD [RX]]                  +16  +2.6%
>> >   [ = ]       0 lib/libfdt/fdt_overlay.c     +16  +0.1%
>> >   [ = ]       0 [section .debug_str]          +2  +0.0%
>> >   [ = ]       0 fs/ext4/ext4_common.c         -5  -0.0%
>> >   [ = ]       0 common/fdt_support.c         -11  -0.0%
>> >   -3.3%     -14 [section .text]              -14  -3.3%
>> >   [ = ]       0 [Unmapped]                   -25  -0.7%
>> >   +0.0%     +32 TOTAL                        +96  +0.0%
>>
>> BTW buildman has a -B flag that shows function size.
>
> Thanks for the tip. The nice thing about bloaty is that it provides
> both VM and FILE size numbers. I am not sure if buildman can do the
> same. Anyway, this was helpful and is expected to save time on my end
> when I manage to bring it up.

I am not sure that the file size numbers are very useful though, since
we mostly care about the text and data size.

Regards,
Simon

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 5/6] scripts/dtc: Re-sync with Linux 4.17-rc4
  2018-05-15 14:06   ` Eugeniu Rosca
@ 2018-05-15 16:05     ` Simon Glass
  2018-05-16  1:48     ` Masahiro Yamada
  1 sibling, 0 replies; 31+ messages in thread
From: Simon Glass @ 2018-05-15 16:05 UTC (permalink / raw)
  To: u-boot

Hi Eugeniu,

On 16 May 2018 at 00:06, Eugeniu Rosca <erosca@de.adit-jv.com> wrote:
> Dear Masahiro, Simon,
>
> I think this patch logically belongs and is tightly coupled to the Linux
> 4.17-rc4 Kconfig re-sync. Since you skipped it, I wonder if you have a
> different view on this.
>
> Most of the Linux commits imported here are actually DTC-specific pieces
> from the Linux commits squashed into Kconfig re-sync patch. The idea of
> doing that is to create a patch whose scope is limited to DTC. I could
> have kept the integrity of Linux commits, which would have extended the
> Kconfig re-sync patch to DTC as well. I still can take a different
> approach, depending on your feedback. Filtering out this patch doesn't
> sound good to me. TIA for your input.

Reviewed-by: Simon Glass <sjg@chromium.org>

It seems OK to me, but Masahiro is the expert here.

- Simon

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 5/6] scripts/dtc: Re-sync with Linux 4.17-rc4
  2018-05-15 14:06   ` Eugeniu Rosca
  2018-05-15 16:05     ` Simon Glass
@ 2018-05-16  1:48     ` Masahiro Yamada
  1 sibling, 0 replies; 31+ messages in thread
From: Masahiro Yamada @ 2018-05-16  1:48 UTC (permalink / raw)
  To: u-boot

2018-05-15 23:06 GMT+09:00 Eugeniu Rosca <erosca@de.adit-jv.com>:
> Dear Masahiro, Simon,
>
> I think this patch logically belongs and is tightly coupled to the Linux
> 4.17-rc4 Kconfig re-sync. Since you skipped it, I wonder if you have a
> different view on this.
>
> Most of the Linux commits imported here are actually DTC-specific pieces
> from the Linux commits squashed into Kconfig re-sync patch. The idea of
> doing that is to create a patch whose scope is limited to DTC. I could
> have kept the integrity of Linux commits, which would have extended the
> Kconfig re-sync patch to DTC as well. I still can take a different
> approach, depending on your feedback. Filtering out this patch doesn't
> sound good to me. TIA for your input.



Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 4/6] scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 4/6] scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987 Eugeniu Rosca
  2018-05-13 22:00   ` Simon Glass
@ 2018-05-16  1:49   ` Masahiro Yamada
  1 sibling, 0 replies; 31+ messages in thread
From: Masahiro Yamada @ 2018-05-16  1:49 UTC (permalink / raw)
  To: u-boot

2018-05-13 2:13 GMT+09:00 Eugeniu Rosca <roscaeugeniu@gmail.com>:
> From: Rob Herring <robh@kernel.org>
>
> This adds the following commits from upstream:
>
> aadd0b65c987 checks: centralize printing of property names in failure messages
> 88960e398907 checks: centralize printing of node path in check_msg
> f1879e1a50eb Add limited read-only support for older (V2 and V3) device tree to libfdt.
> 37dea76e9700 srcpos: drop special handling of tab
> 65893da4aee0 libfdt: overlay: Add missing license
> 962a45ca034d Avoid installing pylibfdt when dependencies are missing
> cd6ea1b2bea6 Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT}
> 51b3a16338df Makefile.tests: Add LIBDL make(1) variable for portability sake
> 333d533a8f4d Attempt to auto-detect stat(1) being used if not given proper invocation
> e54388015af1 dtc: Bump version to v1.4.6
> a1fe86f380cb fdtoverlay: Switch from using alloca to malloc
> c8d5472de3ff tests: Improve compatibility with other platforms
> c81d389a10cc checks: add chosen node checks
> e671852042a7 checks: add aliases node checks
> d0c44ebe3f42 checks: check for #{size,address}-cells without child nodes
> 18a3d84bb802 checks: add string list check for *-names properties
> 8fe94fd6f19f checks: add string list check
> 6c5730819604 checks: add a string check for 'label' property
> a384191eba09 checks: fix sound-dai phandle with arg property check
> b260c4f610c0 Fix ambiguous grammar for devicetree rule
> fe667e382bac tests: Add some basic tests for the pci_bridge checks
> 7975f6422260 Fix widespread incorrect use of strneq(), replace with new strprefixeq()
> fca296445eab Add strstarts() helper function
> cc392f089007 tests: Check non-matching cases for fdt_node_check_compatible()
> bba26a5291c8 livetree: avoid assertion of orphan phandles with overlays
> c8f8194d76cc implement strnlen for systems that need it
> c8b38f65fdec libfdt: Remove leading underscores from identifiers
> 3b62fdaebfe5 Remove leading underscores from identifiers
> 2d45d1c5c65e Replace FDT_VERSION() with stringify()
> 2e6fe5a107b5 Fix some errors in comments
> b0ae9e4b0ceb tests: Correct warning in sw_tree1.c
>
> Commit c8b38f65fdec upstream ("libfdt: Remove leading underscores from
> identifiers") changed the multiple inclusion define protection, so the
> kernel's libfdt_env.h needs the corresponding update.
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> [ Linux commit: 9130ba884640328bb78aaa4840e5ddf06ccafb1c ]
> [erosca: - Fixup conflicts in include/linux/libfdt_env.h caused by v2018.03-rc4
>            commit b08c8c487083 ("libfdt: move headers to <linux/libfdt.h>
>            and <linux/libfdt_env.h>")
>          - Fix build errors in lib/libfdt/fdt_ro.c, tools/libfdt/fdt_rw.c by:
>            - s/_fdt_mem_rsv/fdt_mem_rsv_/
>            - s/_fdt_offset_ptr/fdt_offset_ptr_/
>            - s/_fdt_check_node_offset/fdt_check_node_offset_/
>            - s/_fdt_check_prop_offset/fdt_check_prop_offset_/
>            - s/_fdt_find_add_string/fdt_find_add_string_/]
> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> ---


Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>

-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 3/6] scripts/dtc: Update to upstream version v1.4.5-6-gc1e55a5513e9
  2018-05-12 17:13 ` [U-Boot] [PATCH v2 3/6] scripts/dtc: Update to upstream version v1.4.5-6-gc1e55a5513e9 Eugeniu Rosca
  2018-05-13 22:00   ` Simon Glass
@ 2018-05-16  1:54   ` Masahiro Yamada
  2018-05-16 11:51     ` Eugeniu Rosca
  1 sibling, 1 reply; 31+ messages in thread
From: Masahiro Yamada @ 2018-05-16  1:54 UTC (permalink / raw)
  To: u-boot

2018-05-13 2:13 GMT+09:00 Eugeniu Rosca <roscaeugeniu@gmail.com>:
> From: Rob Herring <robh@kernel.org>
>
> Pickup the fix for handling unresolved phandles in overlays.
>
> This adds the following commits from upstream:
>
> c1e55a5513e9 checks: fix handling of unresolved phandles for dts plugins
> f8872e29ce06 tests: Avoid 64-bit arithmetic in assembler
> 48c91c08bcfa libfdt: add stringlist functions to linker script
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> [ Linux commit: e45fe7f788dd1395befe5639149ad8dacfbd94ab ]
> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> ---
>
> v1->v2:
> * Newly pushed


Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4
  2018-05-12 17:13 [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4 Eugeniu Rosca
                   ` (5 preceding siblings ...)
  2018-05-12 18:25 ` [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4 Petr Vorel
@ 2018-05-16  1:59 ` Masahiro Yamada
  2018-05-16  5:09   ` Petr Vorel
  6 siblings, 1 reply; 31+ messages in thread
From: Masahiro Yamada @ 2018-05-16  1:59 UTC (permalink / raw)
  To: u-boot

2018-05-13 2:13 GMT+09:00 Eugeniu Rosca <roscaeugeniu@gmail.com>:
> Align Kconfig to Linux 4.17-rc4 with minimal impact on non-kconfig files.
>
> Previous Kconfig sync was done by commit bf7ab1e70fd762 ("kconfig:
> re-sync with Linux 4.10") and it achieved almost perfect alignment with
> a few (intended) exceptions, caused by below U-boot commits:
>
> [A] v2015.04 5f9eb2207500 ("kbuild: remove scripts/multiconfig.sh")
> [B] v2015.07 20c20826efab ("Kconfig: Enable usage of escape char '\' in string values")
> [C] v2016.01 da58dec86616 ("Various Makefiles: Add SPDX-License-Identifier tags")
> [D] v2016.03 5b8031ccb4ed ("Add more SPDX-License-Identifier tags")
> [E] v2016.03 192bc6948b02 ("Fix GCC format-security errors and convert sprintfs.")
>
> Here is the list of Kconfig commits which followed the v4.10 alignment:
>
> [F] v2018.01 0931ed3c0d0f ("kconfig/symbol.c: use correct pointer type argument for sizeof")
> [G] v2018.03 1414e09b4f25 ("kconfig: revert change that was not needed for -Wformat-security")
> [H] v2018.05 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style")
>
> Commit [F] was subsequently applied to Linux kernel as commit [I]
> with the same patch id, so it won't contribute to further misalignment.
>
> [I] v4.15-rc1 88127dae6ed9 ("kconfig/symbol.c: use correct pointer type argument for sizeof")
>
> Commit [G] is a Kconfig-specific revert of commit [E].
> Commit [H] relocated and reformatted the license doing no functional change.
>
> In summary, the only functional change that makes U-boot Kconfig
> diverge from Linux Kconfig is commit [B]. After a brief analysis,
> the purpose of [B] seems to be placing "\n" literals in string symbols
> like CONFIG_AUTOBOOT_PROMPT="autoboot in %d seconds\n" in order to pass
> them directly to printf and expect correct output at runtime. Currently,
> Linux doesn't seem to have this requirement, so for the moment [B] looks
> like a U-boot specific feature/fix. From point of view of further Kconfig
> alignment and backporting efforts, it is highly desired that commits
> like [B] are propagated to Linux and any Kconfig fixes/features are
> contributed to Linux kernel first. This specific Kconfig re-sync just
> keeps [B] in place.
>
> Contrary to 4.10 Kconfig re-sync (which achieves zero non-kconfig
> changes), 4.17-rc4 re-sync does some amount of updates in Kbuild
> (striving to keep them at minimum), due to a number of reasons:
> * Kbuild is affected by the removal of Kconfig "*shipped" files and now
>   requires flex and bison pre-installed on the host.
> * PYTHON{2,3} variables are defined in top-level Makefile as
>   prerequisite for running the newly developed Kconfig unit tests.
> * silentoldconfig becomes an "internal implementation detail" deprecated
>   for external use, being renamed to syncconfig.
>
> The exact non-kconfig files touched by this commit are:
>
> $ git show --format="" --stat -- ':!scripts/kconfig'
>  .gitignore             |  2 ++
>  Makefile               |  9 +++++++--
>  scripts/Makefile.build | 11 +++++++++++
>  scripts/Makefile.lib   | 41 ++++++++++++-----------------------------
>
> The imported Linux commits touching the above files are:
>
> c054be10ffdbd5   ("remove gperf left-overs from build system")
> 73a4f6dbe70a1b   ("kbuild: add LEX and YACC variables")
> 033dba2ec06c47   ("kbuild: prepare to remove C files pre-generated by flex and bison")
> eea199b445f64c   ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
> e71de5ee08dcb0   ("kbuild: remove remaining use of undefined YACC_PREFIX")
> d59fbbd09d5d6b   ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
> 911a91c39cabcb H ("kconfig: rename silentoldconfig to syncconfig")
> 59889300274569   (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
> 9a8dfb394c0467   ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
> 833e622459432e H ("genksyms: generate lexer and parser during build instead of shipping")
> b23d1a241f4eb4 H ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
> e9781b52d4e0e3 H ("kbuild: add PYTHON2 and PYTHON3 variables")
>
> The commits marked with 'H' are assessed as "hard" (build will fail)
> prerequisites and the rest of them are assessed as "soft" prerequisites
> for the re-sync. In spite of relatively high number of non-H commits,
> they belong to this Kconfig update topic-wise and decrease the number of
> cherry pick conflicts for many commits in this series. Additional effort
> can be put in eliminating the soft prerequisites, if really needed.
>
> The commits which contributed to this Kconfig re-sync are listed below.
> Whenever a conflict resolution has been performed (mostly by hand, but
> sometimes automatically by git), it is revealed by the '!' sign in the
> second column, which means a patch id mismatch between Linux and U-boot
> commits:
>
> 9be3213b14d44f   ("gconfig: remove misleading parentheses around a condition")
> ff85a1a80e0034   ("kconfig: Check for libncurses before menuconfig")
> ad8181060788c8   ("kconfig: fix sparse warnings in nconfig")
> cb77f0d623ff33 ! ("scripts: Switch to more portable Perl shebang")
> bb3290d91695bb ! ("Remove gperf usage from toolchain")
> c054be10ffdbd5   ("remove gperf left-overs from build system")
> b24413180f5600 ! ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license")
> 9059a3493efea6 ! ("kconfig: fix relational operators for bool and tristate symbols")
> 2c37e08464a850   ("kconfig: Warn if choice default is not in choice")
> 33ca1a24866373   ("kconfig: Document the 'menu' struct")
> 52aede4ba5efd1   ("kconfig: Document the 'symbol' struct")
> c873443430ebd1   ("kconfig: Sync zconf.y with zconf.tab.c_shipped")
> 9a826842ff2fbd   ("kconfig: Rename menu_check_dep() to rewrite_m()")
> fa8cedaef814ce   ("kconfig: Clarify expression rewriting")
> f77850d3fe0c96   ("kconfig: Clean up modules handling and fix crash")
> e3b03bf29d6b99   ("kconfig: display recursive dependency resolution hint just once")
> 73a4f6dbe70a1b ! ("kbuild: add LEX and YACC variables")
> 033dba2ec06c47 ! ("kbuild: prepare to remove C files pre-generated by flex and bison")
> 29c833061c1d8c   ("kconfig: generate lexer and parser during build instead of shipping")
> 26e47a3c11a25c   ("kconfig: Don't leak symbol names during parsing")
> 24161a6711c945   ("kconfig: Don't leak 'source' filenames during parsing")
> bc28fe1d5ede88   ("kconfig: Don't leak 'option' arguments during parsing")
> 0724a7c32a54e3   ("kconfig: Don't leak main menus during parsing")
> ae7440ef0c8013   ("kconfig: Fix automatic menu creation mem leak")
> 5b1374b3b3c2fc   ("kconfig: Fix expr_free() E_NOT leak")
> 7cf33f88e29410   ("kconfig: Fix choice symbol expression leak")
> 05cccce580456d   ("kconfig: Document automatic submenu creation code")
> 0735f7e5def2ab   ("kconfig: Document important expression functions")
> df60f4b92d3d0b   ("kconfig: Remove menu_end_entry()")
> b92d804a51796b   ("kconfig: drop 'boolean' keyword")
> 6479f327dea60d   ("kconfig: Warn if there is more than one help text")
> 52e58a3caeba5d   ("kconfig: make input_mode static")
> 5a3dc717b3c785   ("kconfig: make xfgets() really static")
> 84dd95d4f87a0d   ("kconfig: make conf_unsaved a local variable of conf_read()")
> 765f4cdef6f80d   ("kconfig: use default 'yy' prefix for lexer and parser")
> eea199b445f64c   ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX")
> e71de5ee08dcb0   ("kbuild: remove remaining use of undefined YACC_PREFIX")
> d59fbbd09d5d6b ! ("kbuild: replace hardcoded bison in cmd_bison_h with $(YACC)")
> 3e41ba05b6d60c   ("kconfig: Document SYMBOL_OPTIONAL logic")
> d3465af60f4471   ("kconfig: Clarify choice dependency propagation")
> 9d1a9e8bc18bea   ("kconfig: Document 'if' flattening logic")
> b53688014e3325   ("kconfig: Clarify menu and 'if' dependency propagation")
> d0fd0428ecf04b   ("kconfig: fix make xconfig when gettext is missing")
> 312ee68752faaa   ("kconfig: announce removal of oldnoconfig if used")
> 1ccb27143360bd   ("kconfig: make "Selected by:" and "Implied by:" readable")
> cedd55d49dee94 ! ("kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help")
> 1b9eda2e4892cb   ("kconfig: Warn if help text is blank")
> cb67ab2cd2b8ab   ("kconfig: do not write choice values when their dependency becomes n")
> 4f208f392103e8   ("kconfig: show '?' prompt even if no help text is available")
> cd58a91def2acc   ("kconfig: remove 'config*' pattern from .gitignnore")
> d2a04648a5dbc3   ("kconfig: remove check_stdin()")
> f3ff6fb5db68bc   ("kconfig: echo stdin to stdout if either is redirected")
> 9e3e10c725360b   ("kconfig: send error messages to stderr")
> d717f24d8c6808   ("kconfig: add xrealloc() helper")
> 523ca58b7db2e3   ("kconfig: remove const qualifier from sym_expand_string_value()")
> cd81fc82b93fa4   ("kconfig: add xstrdup() helper")
> f4bc1eefc1608e   ("kconfig: set SYMBOL_AUTO to the symbol marked with defconfig_list")
> bf0bbdcf100322   ("kconfig: Don't leak choice names during parsing")
> 1a90ce36c6eff6   ("kconfig: Update ncurses package names for menuconfig")
> 5ae6fcc4bb82bd   ("kconfig: fix line number in recursive inclusion error message")
> 07a422bb213adb ! ("kbuild: restore autoksyms.h touch to the top Makefile")
> 9a47ceec543bfb   ("kconfig: clean-up reverse dependency help implementation")
> d9119b5925a03b   ("kconfig: Print reverse dependencies in groups")
> f467c5640c29ad   ("kconfig: only write '# CONFIG_FOO is not set' for visible symbols")
> 59a80b5e892dde   ("kconfig: do not call check_conf() for olddefconfig")
> 4bb3a5b085cd6f   ("kconfig: remove unneeded input_mode test in conf()")
> 99f0b6578bab44   ("kconfig: remove redundant input_mode test for check_conf() loop")
> 2aad9b89621386   ("kconfig: hide irrelevant sub-menus for oldconfig")
> 81d2bc2273052e   ("kconfig: invoke oldconfig instead of silentoldconfig from local*config")
> 911a91c39cabcb ! ("kconfig: rename silentoldconfig to syncconfig")
> 2a61625835c7c8 ! ("kconfig: remove redundant streamline_config.pl prerequisite")
> 022a4bf6b59dfd   ("kconfig: tests: add framework for Kconfig unit testing")
> 1903c511905984   ("kconfig: tests: add basic choice tests")
> 49ac3c0c3aa3b7   ("kconfig: tests: test automatic submenu creation")
> b76960c0f6b25d   ("kconfig: tests: test if new symbols in choice are asked")
> 930c429a656fdb   ("kconfig: tests: check unneeded "is not set" with unmet dependency")
> ee236610653ede   ("kconfig: tests: check visibility of tristate choice values in y choice")
> beaaddb625400e   ("kconfig: tests: test defconfig when two choices interact")
> 3e4888c2e3d77d   ("kconfig: tests: test randconfig for choice in choice")
> 29c434f367ea7b   ("kconfig: tests: test if recursive dependencies are detected")
> e2c75e7667c737   ("kconfig: tests: test if recursive inclusion is detected")
> f622f827958162   ("kconfig: warn unmet direct dependency of tristate symbols selected by y")
> f8f69dc0b4e070   ("kconfig: make unmet dependency warnings readable")
> 26561514cc9def   ("kconfig: do not include both curses.h and ncurses.h for nconfig")
> 32a94b8b0c3e5a   ("kconfig: remove duplicated file name and lineno of recursive inclusion")
> 379a8eb8eb1a55   ("kconfig: detect recursive inclusion earlier")
> 18492685e479fd   ("kconfig: use yylineno option instead of manual lineno increments")
> 59889300274569 ! (".gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore")
> 9a8dfb394c0467 ! ("kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile")
> 833e622459432e ! ("genksyms: generate lexer and parser during build instead of shipping")
> b23d1a241f4eb4 ! ("kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically")
> 17baab68d337a0   ("kconfig: extend output of 'listnewconfig'")
> e9781b52d4e0e3 ! ("kbuild: add PYTHON2 and PYTHON3 variables")
>
> The current Kconfig update generates below build-time warnings:
>   YACC    scripts/dtc/dtc-parser.tab.h
> scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
>   YACC    scripts/dtc/dtc-parser.tab.c
> scripts/dtc/dtc-parser.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
>
> This seems to happen because the Kbuild updates apparently didn't make
> room for both "*shipped"-based builds and flex/bison-based builds. A
> similar problem has been reported for genksyms parser in v4.17-rc1
> commit 833e622459432e ("genksyms: generate lexer and parser during build
> instead of shipping"). I have figured out empirically that the warnings
> are healed after updating the in-tree U-boot DTC to upstream v1.4.6-9,
> same as done by Linux v4.17-rc1 commit 9130ba88464032 ("scripts/dtc:
> Update to upstream version v1.4.6-9-gaadd0b65c987"). Whether fixing the
> DTC-related yacc warnings should be done together with the Kconfig
> re-sync, I would like to hear from community.
>
> My testing was limited to:
> - make defconfig all
> - make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- r8a7795_ulcb_defconfig all
> - comparing .config before and after the re-sync
> - running the newly imported Kconfig unit tests as seen below:
>
> $ make testconfig
>
> ============================= test session starts =============================
> scripts/kconfig/tests/auto_submenu/__init__.py::test PASSED             [  7%]
> scripts/kconfig/tests/choice/__init__.py::test_oldask0 PASSED           [ 14%]
> scripts/kconfig/tests/choice/__init__.py::test_oldask1 PASSED           [ 21%]
> scripts/kconfig/tests/choice/__init__.py::test_allyes PASSED            [ 28%]
> scripts/kconfig/tests/choice/__init__.py::test_allmod PASSED            [ 35%]
> scripts/kconfig/tests/choice/__init__.py::test_allno PASSED             [ 42%]
> scripts/kconfig/tests/choice/__init__.py::test_alldef PASSED            [ 50%]
> scripts/kconfig/tests/choice_value_with_m_dep/__init__.py::test PASSED  [ 57%]
> scripts/kconfig/tests/err_recursive_inc/__init__.py::test PASSED        [ 64%]
> scripts/kconfig/tests/inter_choice/__init__.py::test PASSED             [ 71%]
> scripts/kconfig/tests/new_choice_with_dep/__init__.py::test PASSED      [ 78%]
> scripts/kconfig/tests/no_write_if_dep_unmet/__init__.py::test PASSED    [ 85%]
> scripts/kconfig/tests/rand_nested_choice/__init__.py::test PASSED       [ 92%]
> scripts/kconfig/tests/warn_recursive_dep/__init__.py::test PASSED       [100%]
> ========================== 14 passed in 0.34 seconds ==========================
>
> Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> ---
>
> v1->v2:
> * Re-picked v4.16-rc1 commit cedd55d49dee ("kconfig: Remove
>   silentoldconfig from help and docs; fix kconfig/conf's help") with
>   correct conflict resolution in scripts/kconfig/Makefile.
> * Added: Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com
>


Reminder of Tom:

Patchwork is so confused that
it inserted Petr's Tested-by tag to a weird place.
If you take this patch from Patchwork,
please adjust the location of the tag.


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4
  2018-05-16  1:59 ` Masahiro Yamada
@ 2018-05-16  5:09   ` Petr Vorel
  2018-05-16  8:24     ` Eugeniu Rosca
  0 siblings, 1 reply; 31+ messages in thread
From: Petr Vorel @ 2018-05-16  5:09 UTC (permalink / raw)
  To: u-boot

Hi Eugeniu,

> 2018-05-13 2:13 GMT+09:00 Eugeniu Rosca <roscaeugeniu@gmail.com>:
> > Align Kconfig to Linux 4.17-rc4 with minimal impact on non-kconfig files.

> > Previous Kconfig sync was done by commit bf7ab1e70fd762 ("kconfig:
> > re-sync with Linux 4.10") and it achieved almost perfect alignment with
> > a few (intended) exceptions, caused by below U-boot commits:

Maybe it's again something wrong with my patch, but it broke 2 builds in travis:
https://travis-ci.org/pevik/u-boot/builds/379302139

It's this branch (make testconfig works on it):
https://github.com/pevik/u-boot/commits/eugeniu/kconfig.v2.test


Kind regards,
Petr

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4
  2018-05-16  5:09   ` Petr Vorel
@ 2018-05-16  8:24     ` Eugeniu Rosca
  2018-05-16 11:27       ` Eugeniu Rosca
  0 siblings, 1 reply; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-16  8:24 UTC (permalink / raw)
  To: u-boot

Hi Petr,

On Wed, May 16, 2018 at 07:09:05AM +0200, Petr Vorel wrote:
> Hi Eugeniu,
> 
> > 2018-05-13 2:13 GMT+09:00 Eugeniu Rosca <roscaeugeniu@gmail.com>:
> > > Align Kconfig to Linux 4.17-rc4 with minimal impact on non-kconfig files.
> 
> > > Previous Kconfig sync was done by commit bf7ab1e70fd762 ("kconfig:
> > > re-sync with Linux 4.10") and it achieved almost perfect alignment with
> > > a few (intended) exceptions, caused by below U-boot commits:
> 
> Maybe it's again something wrong with my patch, but it broke 2 builds in travis:
> https://travis-ci.org/pevik/u-boot/builds/379302139
> 
> It's this branch (make testconfig works on it):
> https://github.com/pevik/u-boot/commits/eugeniu/kconfig.v2.test

Our branches match, so it's not the root cause this time.
I will start looking into this. Thanks for reporting.
I hope we provide a flawless Kconfig update to the users.

> Kind regards,
> Petr

Best regards,
Eugeniu.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4
  2018-05-16  8:24     ` Eugeniu Rosca
@ 2018-05-16 11:27       ` Eugeniu Rosca
  2018-05-19 12:21         ` Eugeniu Rosca
  0 siblings, 1 reply; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-16 11:27 UTC (permalink / raw)
  To: u-boot

Hi Petr, Masahiro, Simon,

On Wed, May 16, 2018 at 10:24:41AM +0200, Eugeniu Rosca wrote:
> Hi Petr,
> 
> On Wed, May 16, 2018 at 07:09:05AM +0200, Petr Vorel wrote:
> > Hi Eugeniu,
> > 
> > > 2018-05-13 2:13 GMT+09:00 Eugeniu Rosca <roscaeugeniu@gmail.com>:
> > > > Align Kconfig to Linux 4.17-rc4 with minimal impact on non-kconfig files.
> > 
> > > > Previous Kconfig sync was done by commit bf7ab1e70fd762 ("kconfig:
> > > > re-sync with Linux 4.10") and it achieved almost perfect alignment with
> > > > a few (intended) exceptions, caused by below U-boot commits:
> > 
> > Maybe it's again something wrong with my patch, but it broke 2 builds in travis:
> > https://travis-ci.org/pevik/u-boot/builds/379302139
> > 
> > It's this branch (make testconfig works on it):
> > https://github.com/pevik/u-boot/commits/eugeniu/kconfig.v2.test
> 
> Our branches match, so it's not the root cause this time.
> I will start looking into this. Thanks for reporting.
> I hope we provide a flawless Kconfig update to the users.

What I see both in [1] and [2] is failure of `ut dm fdt_translation`
unit test in sandbox/sandbox_flattree environments. I can reproduce
it myself with the delivered patch-set (see [3]), but cannot reproduce
it on u-boot/master.

Doing basic bisecting, I can easily figure out that the issue is
introduced by the last patch in the series, specifically commit
("sandbox: dts: test: Fix wrong aliases property names"). The patch
fixing the issue is shown in [4]. The problem is no more reproduced
afterwards, as seen in [5].

Please, feedback if you are fine with this level of analysis and the
fix itself or maybe I should go deeper with investigation.

Anyway, based on above, the problem seems to be unrelated to the
Kconfig/DTC update. Special thanks to Petr for reporting it.

Best regards,
Eugeniu.

[1] https://travis-ci.org/pevik/u-boot/jobs/379302204
[2] https://travis-ci.org/pevik/u-boot/jobs/379302206

[3] Reproducing the issue seen in [1] and [2] in sandbox:
$ ./u-boot -d arch/sandbox/dts/test.dtb

U-Boot 2018.05-00230-ge8e03803af5b (May 16 2018 - 13:09:51 +0200)

Model: sandbox
DRAM:  128 MiB
MMC:   mmc2: 2 (SD), mmc1: 1 (SD), mmc0: 0 (SD)
In:    serial
Out:   vidconsole
Err:   vidconsole
Model: sandbox
SCSI:  Net:   eth0: eth at 10002000, eth5: eth at 10003000, eth3: sbe5, eth1: eth at 10004000
IDE:   Bus 0: not available  
Hit any key to stop autoboot:  0 
=> ut dm fdt_translation
Test: dm_test_fdt_translation: test-fdt.c
test/dm/test-fdt.c:444, dm_test_fdt_translation(): 0 == uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 0, 1, &dev): Expected 0, got -19
Test: dm_test_fdt_translation: test-fdt.c (flat tree)
test/dm/test-fdt.c:444, dm_test_fdt_translation(): 0 == uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 0, 1, &dev): Expected 0, got -19
Failures: 2
=> 

[4] Patch fixing [3].
diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index 8196844e89a7..66d0df5629a2 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -425,7 +425,7 @@ static const struct udevice_id fdt_dummy_ids[] = {
 };
 
 UCLASS_DRIVER(fdt_dummy) = {
-	.name		= "fdt_dummy",
+	.name		= "fdt-dummy",
 	.id		= UCLASS_TEST_DUMMY,
 	.flags		= DM_UC_FLAG_SEQ_ALIAS,
 };

[5] The issue is healed after applying [4]:
$ ./u-boot -d arch/sandbox/dts/test.dtb

U-Boot 2018.05-00230-ge8e03803af5b-dirty (May 16 2018 - 13:15:13 +0200)

Model: sandbox
DRAM:  128 MiB
MMC:   mmc2: 2 (SD), mmc1: 1 (SD), mmc0: 0 (SD)
In:    serial
Out:   vidconsole
Err:   vidconsole
Model: sandbox
SCSI:  Net:   eth0: eth at 10002000, eth5: eth at 10003000, eth3: sbe5, eth1: eth at 10004000
IDE:   Bus 0: not available  
Hit any key to stop autoboot:  0 
=> ut dm fdt_translation
Test: dm_test_fdt_translation: test-fdt.c
Test: dm_test_fdt_translation: test-fdt.c (flat tree)
Failures: 0
=>

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 3/6] scripts/dtc: Update to upstream version v1.4.5-6-gc1e55a5513e9
  2018-05-16  1:54   ` Masahiro Yamada
@ 2018-05-16 11:51     ` Eugeniu Rosca
  0 siblings, 0 replies; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-16 11:51 UTC (permalink / raw)
  To: u-boot

On Wed, May 16, 2018 at 10:54:04AM +0900, Masahiro Yamada wrote:
> 2018-05-13 2:13 GMT+09:00 Eugeniu Rosca <roscaeugeniu@gmail.com>:
> > From: Rob Herring <robh@kernel.org>
> >
> > Pickup the fix for handling unresolved phandles in overlays.
> >
> > This adds the following commits from upstream:
> >
> > c1e55a5513e9 checks: fix handling of unresolved phandles for dts plugins
> > f8872e29ce06 tests: Avoid 64-bit arithmetic in assembler
> > 48c91c08bcfa libfdt: add stringlist functions to linker script
> >
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > [ Linux commit: e45fe7f788dd1395befe5639149ad8dacfbd94ab ]
> > Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> > ---
> >
> > v1->v2:
> > * Newly pushed
> 
> 
> Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Thanks for the recent reviews!

> 
> -- 
> Best Regards
> Masahiro Yamada

Best regards,
Eugeniu.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4
  2018-05-16 11:27       ` Eugeniu Rosca
@ 2018-05-19 12:21         ` Eugeniu Rosca
  0 siblings, 0 replies; 31+ messages in thread
From: Eugeniu Rosca @ 2018-05-19 12:21 UTC (permalink / raw)
  To: u-boot

Dear reviewers,

Please, have a look at v3 series. TIA!

Best regards,
Eugeniu.

On Wed, May 16, 2018 at 01:27:02PM +0200, Eugeniu Rosca wrote:
> Hi Petr, Masahiro, Simon,
> 
> On Wed, May 16, 2018 at 10:24:41AM +0200, Eugeniu Rosca wrote:
> > Hi Petr,
> > 
> > On Wed, May 16, 2018 at 07:09:05AM +0200, Petr Vorel wrote:
> > > Hi Eugeniu,
> > > 
> > > > 2018-05-13 2:13 GMT+09:00 Eugeniu Rosca <roscaeugeniu@gmail.com>:
> > > > > Align Kconfig to Linux 4.17-rc4 with minimal impact on non-kconfig files.
> > > 
> > > > > Previous Kconfig sync was done by commit bf7ab1e70fd762 ("kconfig:
> > > > > re-sync with Linux 4.10") and it achieved almost perfect alignment with
> > > > > a few (intended) exceptions, caused by below U-boot commits:
> > > 
> > > Maybe it's again something wrong with my patch, but it broke 2 builds in travis:
> > > https://travis-ci.org/pevik/u-boot/builds/379302139
> > > 
> > > It's this branch (make testconfig works on it):
> > > https://github.com/pevik/u-boot/commits/eugeniu/kconfig.v2.test
> > 
> > Our branches match, so it's not the root cause this time.
> > I will start looking into this. Thanks for reporting.
> > I hope we provide a flawless Kconfig update to the users.
> 
> What I see both in [1] and [2] is failure of `ut dm fdt_translation`
> unit test in sandbox/sandbox_flattree environments. I can reproduce
> it myself with the delivered patch-set (see [3]), but cannot reproduce
> it on u-boot/master.
> 
> Doing basic bisecting, I can easily figure out that the issue is
> introduced by the last patch in the series, specifically commit
> ("sandbox: dts: test: Fix wrong aliases property names"). The patch
> fixing the issue is shown in [4]. The problem is no more reproduced
> afterwards, as seen in [5].
> 
> Please, feedback if you are fine with this level of analysis and the
> fix itself or maybe I should go deeper with investigation.
> 
> Anyway, based on above, the problem seems to be unrelated to the
> Kconfig/DTC update. Special thanks to Petr for reporting it.
> 
> Best regards,
> Eugeniu.
> 
> [1] https://travis-ci.org/pevik/u-boot/jobs/379302204
> [2] https://travis-ci.org/pevik/u-boot/jobs/379302206
> 
> [3] Reproducing the issue seen in [1] and [2] in sandbox:
> $ ./u-boot -d arch/sandbox/dts/test.dtb
> 
> U-Boot 2018.05-00230-ge8e03803af5b (May 16 2018 - 13:09:51 +0200)
> 
> Model: sandbox
> DRAM:  128 MiB
> MMC:   mmc2: 2 (SD), mmc1: 1 (SD), mmc0: 0 (SD)
> In:    serial
> Out:   vidconsole
> Err:   vidconsole
> Model: sandbox
> SCSI:  Net:   eth0: eth at 10002000, eth5: eth at 10003000, eth3: sbe5, eth1: eth at 10004000
> IDE:   Bus 0: not available  
> Hit any key to stop autoboot:  0 
> => ut dm fdt_translation
> Test: dm_test_fdt_translation: test-fdt.c
> test/dm/test-fdt.c:444, dm_test_fdt_translation(): 0 == uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 0, 1, &dev): Expected 0, got -19
> Test: dm_test_fdt_translation: test-fdt.c (flat tree)
> test/dm/test-fdt.c:444, dm_test_fdt_translation(): 0 == uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 0, 1, &dev): Expected 0, got -19
> Failures: 2
> => 
> 
> [4] Patch fixing [3].
> diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
> index 8196844e89a7..66d0df5629a2 100644
> --- a/test/dm/test-fdt.c
> +++ b/test/dm/test-fdt.c
> @@ -425,7 +425,7 @@ static const struct udevice_id fdt_dummy_ids[] = {
>  };
>  
>  UCLASS_DRIVER(fdt_dummy) = {
> -	.name		= "fdt_dummy",
> +	.name		= "fdt-dummy",
>  	.id		= UCLASS_TEST_DUMMY,
>  	.flags		= DM_UC_FLAG_SEQ_ALIAS,
>  };
> 
> [5] The issue is healed after applying [4]:
> $ ./u-boot -d arch/sandbox/dts/test.dtb
> 
> U-Boot 2018.05-00230-ge8e03803af5b-dirty (May 16 2018 - 13:15:13 +0200)
> 
> Model: sandbox
> DRAM:  128 MiB
> MMC:   mmc2: 2 (SD), mmc1: 1 (SD), mmc0: 0 (SD)
> In:    serial
> Out:   vidconsole
> Err:   vidconsole
> Model: sandbox
> SCSI:  Net:   eth0: eth at 10002000, eth5: eth at 10003000, eth3: sbe5, eth1: eth at 10004000
> IDE:   Bus 0: not available  
> Hit any key to stop autoboot:  0 
> => ut dm fdt_translation
> Test: dm_test_fdt_translation: test-fdt.c
> Test: dm_test_fdt_translation: test-fdt.c (flat tree)
> Failures: 0
> =>

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2018-05-19 12:21 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-12 17:13 [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4 Eugeniu Rosca
2018-05-12 17:13 ` [U-Boot] [PATCH v2 2/6] board: eets: pdu001: Fix wrong default value in Kconfig Eugeniu Rosca
2018-05-12 17:13 ` [U-Boot] [PATCH v2 3/6] scripts/dtc: Update to upstream version v1.4.5-6-gc1e55a5513e9 Eugeniu Rosca
2018-05-13 22:00   ` Simon Glass
2018-05-16  1:54   ` Masahiro Yamada
2018-05-16 11:51     ` Eugeniu Rosca
2018-05-12 17:13 ` [U-Boot] [PATCH v2 4/6] scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987 Eugeniu Rosca
2018-05-13 22:00   ` Simon Glass
2018-05-13 22:45     ` Eugeniu Rosca
2018-05-14 19:52       ` Simon Glass
2018-05-15 13:46         ` Eugeniu Rosca
2018-05-15 16:05           ` Simon Glass
2018-05-16  1:49   ` Masahiro Yamada
2018-05-12 17:13 ` [U-Boot] [PATCH v2 5/6] scripts/dtc: Re-sync with Linux 4.17-rc4 Eugeniu Rosca
2018-05-15 14:06   ` Eugeniu Rosca
2018-05-15 16:05     ` Simon Glass
2018-05-16  1:48     ` Masahiro Yamada
2018-05-12 17:13 ` [U-Boot] [PATCH v2 6/6] sandbox: dts: test: Fix wrong aliases property names Eugeniu Rosca
2018-05-13 22:00   ` Simon Glass
2018-05-12 18:25 ` [U-Boot] [PATCH v2 1/6] kconfig: re-sync with Linux 4.17-rc4 Petr Vorel
2018-05-12 19:17   ` Eugeniu Rosca
2018-05-12 19:31     ` Petr Vorel
2018-05-12 21:17       ` Eugeniu Rosca
2018-05-13 13:52     ` Masahiro Yamada
2018-05-13 20:43       ` Eugeniu Rosca
2018-05-14 19:35       ` Petr Vorel
2018-05-16  1:59 ` Masahiro Yamada
2018-05-16  5:09   ` Petr Vorel
2018-05-16  8:24     ` Eugeniu Rosca
2018-05-16 11:27       ` Eugeniu Rosca
2018-05-19 12:21         ` Eugeniu Rosca

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.