Re: [PATCH] arch/Kconfig: fix dead conditions by removing dead options
From: Jinjie Ruan
Date: Sun Aug 02 2026 - 23:51:53 EST
在 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@xxxxxxxxx>
> ---
> 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@xxxxxxxxxx>
> default ARCH_MMAP_RND_COMPAT_BITS_MIN
> depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
> help