CONFIG_BT_FIXED_PASSKEY, bt_passkey_set() and BT_PASSKEY_INVALID were
deprecated in commit 82cfb5a056 ("Bluetooth: Host: Deprecate
BT_FIXED_PASSKEY"), released in Zephyr 4.3, in favour of the app_passkey
callback gated on CONFIG_BT_APP_PASSKEY. Two releases have passed, so
remove them.
The replacement covers what the option did: an application that returns a
constant from bt_conn_auth_cb.app_passkey gets a fixed passkey, and one
that returns BT_PASSKEY_RAND gets a Host generated one, which is what
BT_PASSKEY_INVALID was used to fall back to.
DISPLAY_FIXED() could only ever be true with a fixed passkey configured,
so the four conditions using it reduce to the JUST_WORKS test they were
already OR'd with. Likewise the two branches in get_io_capa() that
upgraded the reported capability when a fixed passkey was set collapse to
the values they already returned otherwise; the CONFIG_BT_APP_PASSKEY
block above them covers that case for the replacement API. Behaviour is
therefore unchanged for anyone not enabling the removed option.
Drop the accompanying build warning and the hardened.csv entry, both of
which existed only to steer users away from the option.
Fixes: #36005
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Assisted-by: Claude:claude-opus-5
Cover the quoted-string exemption (single and double quotes) and that
comments and 'help' body text stay subject to the limit, with a macro
in help text still exempt. Keep the '$(...)' case on an unquoted line
so it exercises the macro branch independently of the quote branch.
Assisted-by: Claude Code:claude-opus-4.8
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
A long quoted value (e.g. a path) or '$(...)' macro cannot be brought
under the 100-column limit: kconfiglib joins backslash continuations by
raw concatenation, so splitting the value injects the continuation's
leading whitespace into it. Exempt lines containing a quoted string
(single or double) too, not just macros. Comments and 'help' text are
re-wrappable prose and stay subject to the limit (a macro cited in help
text stays exempt, as it still cannot be split).
Assisted-by: Claude Code:claude-opus-4.8
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
dt_*_has_prop() functions from kconfigfunctions.py always the same
value ("y", aside dt_compat_any_not_has_prop() that always return "n")
when used with a boolean property defined the node DT bindings
since such property is always found whatever it is set to True or False.
Using such functions on boolean properties is not accurate and could
corrupt the target configuration.
When testing a DT boolean property, one should:
- use dt_node_bool_prop() instead of dt_node_has_prop(),
- use dt_nodelabel_bool_prop() instead of dt_nodelabel_has_prop(),
- use dt_compat_all_has_prop() with valid value parameter,
- use dt_compat_any_has_prop() with valid value parameter,
- not use dt_compat_any_not_has_prop().
This change makes configuration build stage to emit a warning message
upon such a wrong usage of these helper functions.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Add pytest unit tests for the CMake and Kconfig style checkers: one
flagged and one clean snippet per rule, asserting the exact set of rules
raised. Snippets are passed as strings, so no fixture files are committed
(which the compliance checks would otherwise scan). Both suites run in
the Scripts tests workflow.
Assisted-by: Claude Code:claude-opus-4.8
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
The if-blank and decl-blank checks assumed single-line statements, so a
backslash-continued 'if' condition produced false positives: the blank
required after 'if' was checked at the keyword line (a continuation
line), and the block-opener exemption for declarations tested that
continuation line instead of the opener keyword.
Follow continuations to the statement's start and end in both checks.
Also require the continuation backslash to be the final character, since
a backslash before trailing whitespace escapes it rather than continuing
the line.
Assisted-by: Claude Code:claude-opus-4.8
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Currently the testsuite does not execute succesfully on Windows due to
various issues including path separator mismatch, shell command
incompatibility, and lack of proper symlink support. Fix these issues to
allow running the testsuite on Windows. Note that the compatibility
and symlink tests are skipped due to basic incompatibility.
Signed-off-by: Graham Roff <grahamr@qti.qualcomm.com>
(cherry picked from kconfiglib commit b8535af53f0650a69e52db4bf8585c09d55852e7)
Extend the "depends on" syntax to support conditional dependencies
using "depends on A if B". While functionally equivalent to "depends
on !B || A", "depends on A if B" is much more readable.
This change is implemented by converting the "A if B" syntax into the
"!B || A" syntax during "depends on" token processing.
Signed-off-by: Graham Roff <grahamr@qti.qualcomm.com>
(cherry picked from kconfiglib commit d13e125024ec1c8e573aacd463765d028515503e)
A follow-up to b96a5ad562deffa697d966c29546650aae645f48 where we stopped
having CI run tests on Python 2.x. This actually drops the few remaining
Python 2.x compatibility bits as Python 2.x has EOL'd a long time ago.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
(cherry picked from kconfiglib commit 24aef157aead07f813f874f43ee471b057e622cb)
Signed-off-by: Graham Roff <grahamr@qti.qualcomm.com>
The partition MTD path is required to correctly check if two partitions
overlap with each other.
Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
A comment directly above a top-level 'if' documents the conditional
block, so anchor the required blank line before the comment rather than
between the comment and the 'if'.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Assisted-by: Claude Code:claude-opus-4.8
Add scripts/kconfig/kconfig_style.py, a dependency-free checker for the
Kconfig formatting rules from the style guidelines (line length,
indentation, blank lines, comment spacing and final newline).
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Assisted-by: Claude Code:claude-opus-4.8
Add a custom Kconfig preprocessor option to obtain the highest IRQn on a
controller. This can be useful to compute CONFIG_NUM_IRQS automatically at
build time.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The TEST_SHELL config was removed in commit be0dff6844
("test: remove TEST_SHELL") a while ago.
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
The config options have been renamed in commit 8dc3f85622
("hwmv2: Introduce Hardware model version 2 and convert devices"),
therefore update them in the hardend file.
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
For Windows, if the build dir is under same drive with zephyr base, the
generated link shall be relative url like posix style.
If they are in different drive, url is meaningless. So just use raw link
format so that some editors can directly jump to.
Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
add dt_node_array_prop_has_val function and
extend dt_nodelabel_array_prop_has_val to be
used with string-arrays.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Fixes this function so that it returns the unit address of the
node, without having to rely on odd tricks to locate various parent
nodes and check that they have reg addresses and perform additions
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Add the dt_compat_all_has_prop
kconfig preprocessor function, simillar to
dt_compat_any_has_prop.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Add support for arrays and string-arrays to
dt_compat_any_has_prop
kconfig preprocessor function.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The commit 125d0daaa1 added 'loc' to the sym.ranges tuples and fixed
kconfiglib.py but guiconfig.py is left untouched. This make menuconfig to
die with:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python3.13/tkinter/__init__.py", line 2077, in __call__
return self.func(*args)
~~~~~~~~~^^^^^^^
File ".../scripts/kconfig/guiconfig.py", line 917, in _tree_double_click
return _tree_enter(event)
File ".../scripts/kconfig/guiconfig.py", line 942, in _tree_enter
_change_node(node, tree.winfo_toplevel())
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../scripts/kconfig/guiconfig.py", line 1125, in _change_node
s = _set_val_dialog(node, parent)
File ".../scripts/kconfig/guiconfig.py", line 1219, in _set_val_dialog
range_info = _range_info(sym)
File ".../scripts/kconfig/guiconfig.py", line 1339, in _range_info
for low, high, cond in sym.ranges:
^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 3)
This commit ignores the last element in the tuples.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
The commit 125d0daaa1 added 'loc' to the sym.ranges tuples and fixed
kconfiglib.py but menuconfig.py is left untouched. This make menuconfig to
die with:
Traceback (most recent call last):
File ".../scripts/kconfig/menuconfig.py", line 3284, in <module>
_main()
~~~~~^^
File ".../scripts/kconfig/menuconfig.py", line 663, in _main
menuconfig(standard_kconfig(__doc__))
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../scripts/kconfig/menuconfig.py", line 732, in menuconfig
print(curses.wrapper(_menuconfig))
~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/usr/lib/python3.13/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File ".../scripts/kconfig/menuconfig.py", line 872, in _menuconfig
_change_node(sel_node)
~~~~~~~~~~~~^^^^^^^^^^
File ".../scripts/kconfig/menuconfig.py", line 1586, in _change_node
s, _range_info(sc))
~~~~~~~~~~~^^^^
File ".../scripts/kconfig/menuconfig.py", line 3119, in _range_info
for low, high, cond in sym.ranges:
^^^^^^^^^^^^^^^
ValueError: too many values to unpack (expected 3)
This commit ignores the last element in the tuples.
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
The new 'traceconfig' target generates a Markdown file listing all
configuration symbols, their values, and where those values originated
(user assignment, default, selection, implication, or unset).
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Collect and save trace data for all symbols in the merged configuration.
This includes information about where each symbol was defined or
assigned, which can be useful for debugging complex Kconfig setups.
The trace data includes the following information for each symbol:
- Name
- Visibility
- Type
- Value
- Kind and location of value origin (as defined in kconfiglib)
The trace data is saved for later use in two formats: a binary pickle
file and a human-readable JSON file.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Track information about what caused a value to be set in the 'origin'
property of Symbol. 'imply' and 'select' dependencies do not have a
location associated with them, so in those cases the location is
a string representation of the dependency expression. For defaults and
user values, the location in the Kconfig file is stored.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Store the location (filename and line number) where a 'select', 'imply',
'range' or 'default' was added to a Symbol or Choice.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
The 'user_loc' stores the location (filename and line number) where a
symbol or choice was last set via a direct user selection.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Replace filename and linenr parameters to _warn() with a single loc
element, which is a constant (filename, linenr) tuple that can be more
efficiently passed and stored.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Replace 'filename' and 'linenr' usages with a single 'loc' attribute,
which is a (filename, linenr) tuple. This simplifies code dealing with
locations, and makes it explicitly constant. The original attributes are
now provided via properties for compatibility.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
dt_nodelabel_int_prop did not check if the property existed on the node
before accessing it, which would result in a build-time crash (and thus
build error) if used on a node which lacked the requested property.
Fix by using the common _node_int_prop() helper which handles all edge
cases properly.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Make use of `tabulate` to pretty print the results of the hardening tool
instead of custom formatting.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Filter duplicate entries in `kconf.kconfig_filenames` before calling
`os.path.realpath`.
Before (current code), all entries in `kconf.kconfig_filenames` go
through `os.path.realpath`. Including all duplicate entries.
With the proposed change, the duplicate entries are removed before
calling `os.path.realpath`.
Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
Fixing a couple cases of a programming error where a file is not closed
in case of an exception, which was causing resource leak warnings in
some cases when encountering a kconfig error.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Add a new promptless Kconfig symbol (INSECURE). This symbols must
be selected by any setting which is used to enable an insecure
feature.
Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
Add dt_compat_enabled_num Kconfig helper function for counting the number
of compatible nodes with status okay.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This is an X86 specific option and should not appear as generic debug
option.
Fixeszephyrproject-rtos/zephyr#52929
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Functions like `add` and `sub` can only return base 10 integers, which
means they can't really be used to define Kconfig symbols of type `hex`.
For the same reason, there already exist pairs of devicetree functions
named e.g., `dt_node_reg_addr_(int|hex)` after different return types.
Introduce `add_hex`, `sub_hex`, and friends.
To avoid confusion, it should be possible for those new functions to
accept arguments in base 16 as well. It's actually easier to let all
arithmetic functions take their inputs in "any" base, by leveraging
Python's built-in: `int(..., base=0)`.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Adds a function which can be used to get the integer value of a
devicetree property in Kconfig from a nodelabel
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This driver was deprecated and must be removed by Zephyr version
4.1 according to lifecycle/release guidelines.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Add preprocessor function that returns 'y' if any enabled node with
compat does NOT have a certain property. This is different from using
dt_compat_any_has_prop to check that they ALL don't have the property.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>