Re: [RESEND PATCH] s390: fix dead defaults for S390_MODULES_SANITY_TEST and S390_UNWIND_SELFTEST
From: Julian Braha
Date: Wed Apr 29 2026 - 17:39:27 EST
On Wed, 29 Apr 2026, Alexander Gordeev <agordeev@xxxxxxxxxxxxx> wrote:
> This tool is still in development, right?
You can find the latest release (v0.7) outside the tree here:
https://github.com/julianbraha/kconfirm
And there's also a recent RFC to move it into the tree here:
https://lore.kernel.org/all/20260427174429.779474-1-julianbraha@xxxxxxxxx/
> Anyway, I do not quite get what do you mean with the dead code.
> Could you please elaborate?
Sure! In kconfig, default statements are evaluated in the order
they appear (top --> bottom). This means that if you have an
unconditional default statement at the top, e.g. 'default n', then all
of the default statements that follow it will never be evaluated - in
other words, they are dead code.
In the case of this code in particular, the 'def_tristate n' at the top
does two things:
1. declares the type of the config option as a tristate,
2. sets the default value to 'n' unconditionally.
So, the 'default KUNIT_ALL_TESTS' statement that follows is dead code.
See also this sentence from the "Menu attributes" section of the kconfig
docs:
"If multiple default values are visible, only the first defined one is
active."
Source:
https://docs.kernel.org/kbuild/kconfig-language.html
- Julian Braha