arch/Kconfig: fix dead conditions by removing dead options
PATCH 1/1 arch/Kconfig: fix dead conditions by removing dead options
These two 'int' options:
ARCH_MMAP_RND_BITS_DEFAULTARCH_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.
--- arch/Kconfig | 8 -------- 1 file changed, 8 deletions(-)
arch/Kconfig +0 -8
@@ -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
Signature · 1 line
2.55.0
Quoted 5 lines · Julian Braha
These two 'int' options:
ARCH_MMAP_RND_BITS_DEFAULTARCH_MMAP_RND_COMPAT_BITS_DEFAULT
Quoted 8 lines
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 <[email protected]>
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines · Julian Braha
These two 'int' options:
ARCH_MMAP_RND_BITS_DEFAULTARCH_MMAP_RND_COMPAT_BITS_DEFAULTare used directly as conditions for defaults. 'int' options should not be used as conditions, because they will always evaluate to false.
Quoted 6 lines
Quoted 5 lines
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 <[email protected]>Reviewed-by Arnd Bergmann <[email protected]>
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
Quoted 36 lines · Julian Braha
These two 'int' options:
ARCH_MMAP_RND_BITS_DEFAULTARCH_MMAP_RND_COMPAT_BITS_DEFAULTare 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 <[email protected]>--- arch/Kconfig | 8 -------- 1 file changed, 8 deletions(-)arch/Kconfig +0
-4@@ -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
arch/Kconfig config ARCH_MMAP_RND_COMPAT_BITS_MIN · line 1278
Quoted 10 lines
arch/Kconfig +0
-4@@ -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
Quoted 3 lines
arch/Kconfig +0
-0default ARCH_MMAP_RND_COMPAT_BITS_MIN depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS help