* [PATCH] arch/Kconfig: fix dead conditions by removing dead options
@ 2026-07-29 21:05 Julian Braha
2026-07-31 10:41 ` Arnd Bergmann
2026-08-03 3:50 ` Jinjie Ruan
0 siblings, 2 replies; 4+ messages in thread
From: Julian Braha @ 2026-07-29 21:05 UTC (permalink / raw)
To: arnd
Cc: tglx, xur, kees, peterz, thomas.weissschuh, ruanjinjie, gourry,
lukas.bulwahn, ryan.roberts, jani.nikula, linux-kernel,
Julian Braha
These two 'int' options:
ARCH_MMAP_RND_BITS_DEFAULT
ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
are used directly as conditions for defaults. 'int' options should not be
used as conditions, because they will always evaluate to false.
Let's remove these options, because they are not used anywhere else.
This dead code was found by kconfirm, a static analysis tool for Kconfig.
Signed-off-by: Julian Braha <julianbraha@gmail.com>
---
arch/Kconfig | 8 --------
1 file changed, 8 deletions(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index 89ee0d1a3775..ad14831af348 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -1235,13 +1235,9 @@ config ARCH_MMAP_RND_BITS_MIN
config ARCH_MMAP_RND_BITS_MAX
int
-config ARCH_MMAP_RND_BITS_DEFAULT
- int
-
config ARCH_MMAP_RND_BITS
int "Number of bits to use for ASLR of mmap base address" if EXPERT
range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
- default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
default ARCH_MMAP_RND_BITS_MIN
depends on HAVE_ARCH_MMAP_RND_BITS
help
@@ -1269,13 +1265,9 @@ config ARCH_MMAP_RND_COMPAT_BITS_MIN
config ARCH_MMAP_RND_COMPAT_BITS_MAX
int
-config ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
- int
-
config ARCH_MMAP_RND_COMPAT_BITS
int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
- default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
default ARCH_MMAP_RND_COMPAT_BITS_MIN
depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
help
--
2.55.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] arch/Kconfig: fix dead conditions by removing dead options
2026-07-29 21:05 [PATCH] arch/Kconfig: fix dead conditions by removing dead options Julian Braha
@ 2026-07-31 10:41 ` Arnd Bergmann
2026-08-21 10:13 ` Julian Braha
2026-08-03 3:50 ` Jinjie Ruan
1 sibling, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2026-07-31 10:41 UTC (permalink / raw)
To: Julian Braha
Cc: Thomas Gleixner, Rong Xu, Kees Cook, Peter Zijlstra,
Thomas Weißschuh, Ruan Jinjie, gourry, Lukas Bulwahn,
Ryan Roberts, Jani Nikula, linux-kernel
On Wed, Jul 29, 2026, at 23:05, Julian Braha wrote:
> These two 'int' options:
>
> ARCH_MMAP_RND_BITS_DEFAULT
> ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
>
> are used directly as conditions for defaults. 'int' options should not be
> used as conditions, because they will always evaluate to false.
>
> Let's remove these options, because they are not used anywhere else.
>
> This dead code was found by kconfirm, a static analysis tool for Kconfig.
>
> Signed-off-by: Julian Braha <julianbraha@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] arch/Kconfig: fix dead conditions by removing dead options
2026-07-29 21:05 [PATCH] arch/Kconfig: fix dead conditions by removing dead options Julian Braha
2026-07-31 10:41 ` Arnd Bergmann
@ 2026-08-03 3:50 ` Jinjie Ruan
1 sibling, 0 replies; 4+ messages in thread
From: Jinjie Ruan @ 2026-08-03 3:50 UTC (permalink / raw)
To: Julian Braha, arnd
Cc: tglx, xur, kees, peterz, thomas.weissschuh, gourry, lukas.bulwahn,
ryan.roberts, jani.nikula, linux-kernel
在 2026/7/30 5:05, Julian Braha 写道:
> These two 'int' options:
>
> ARCH_MMAP_RND_BITS_DEFAULT
> ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
>
> are used directly as conditions for defaults. 'int' options should not be
> used as conditions, because they will always evaluate to false.
>
> Let's remove these options, because they are not used anywhere else.
>
> This dead code was found by kconfirm, a static analysis tool for Kconfig.
>
> Signed-off-by: Julian Braha <julianbraha@gmail.com>
> ---
> arch/Kconfig | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/arch/Kconfig b/arch/Kconfig
> index 89ee0d1a3775..ad14831af348 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -1235,13 +1235,9 @@ config ARCH_MMAP_RND_BITS_MIN
> config ARCH_MMAP_RND_BITS_MAX
> int
>
> -config ARCH_MMAP_RND_BITS_DEFAULT
> - int
> -
> config ARCH_MMAP_RND_BITS
> int "Number of bits to use for ASLR of mmap base address" if EXPERT
> range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
> - default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
> default ARCH_MMAP_RND_BITS_MIN
> depends on HAVE_ARCH_MMAP_RND_BITS
> help
> @@ -1269,13 +1265,9 @@ config ARCH_MMAP_RND_COMPAT_BITS_MIN
> config ARCH_MMAP_RND_COMPAT_BITS_MAX
> int
>
> -config ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
> - int
> -
> config ARCH_MMAP_RND_COMPAT_BITS
> int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
> range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
> - default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com>
> default ARCH_MMAP_RND_COMPAT_BITS_MIN
> depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
> help
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] arch/Kconfig: fix dead conditions by removing dead options
2026-07-31 10:41 ` Arnd Bergmann
@ 2026-08-21 10:13 ` Julian Braha
0 siblings, 0 replies; 4+ messages in thread
From: Julian Braha @ 2026-08-21 10:13 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Thomas Gleixner, Rong Xu, Kees Cook, Peter Zijlstra,
Thomas Weißschuh, Ruan Jinjie, gourry, Lukas Bulwahn,
Ryan Roberts, Jani Nikula, linux-kernel
On 7/31/26 11:41, Arnd Bergmann wrote:
> On Wed, Jul 29, 2026, at 23:05, Julian Braha wrote:
>> These two 'int' options:
>>
>> ARCH_MMAP_RND_BITS_DEFAULT
>> ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
>>
>> are used directly as conditions for defaults. 'int' options should not be
>> used as conditions, because they will always evaluate to false.
>>
>> Let's remove these options, because they are not used anywhere else.
>>
>> This dead code was found by kconfirm, a static analysis tool for Kconfig.
>>
>> Signed-off-by: Julian Braha <julianbraha@gmail.com>
> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Sorry to bother, but whose tree would this patch go into?
I'd like to add some type checking into Kconfig, but I need to wait
until this patch is merged before making this a hard error.
- Julian Braha
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-21 10:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-29 21:05 [PATCH] arch/Kconfig: fix dead conditions by removing dead options Julian Braha
2026-07-31 10:41 ` Arnd Bergmann
2026-08-21 10:13 ` Julian Braha
2026-08-03 3:50 ` Jinjie Ruan
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.