]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm/thp: dead code cleanup in Kconfig
authorJulian Braha <julianbraha@gmail.com>
Tue, 31 Mar 2026 07:07:30 +0000 (08:07 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 May 2026 04:04:51 +0000 (21:04 -0700)
There is already an 'if TRANSPARENT_HUGEPAGE' condition wrapping several
config options e.g.  'READ_ONLY_THP_FOR_FS', making the 'depends on'
statement for each of these a duplicate dependency (dead code).

I propose leaving the outer 'if TRANSPARENT_HUGEPAGE...endif' and removing
the individual 'depends on TRANSPARENT_HUGEPAGE' statement from each
option.

This dead code was found by kconfirm, a static analysis tool for Kconfig.

Link: https://lore.kernel.org/20260331070730.33915-1-julianbraha@gmail.com
Signed-off-by: Julian Braha <julianbraha@gmail.com>
Reviewed-by: Lorenzo Stoakes <ljs@kernel.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Liam Howlett <liam@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/Kconfig

index e8bf1e9e6ad9076073d3762aae1acc7cfe6d77fd..e221fa1dc54d0cbecac38ee9edc33d9acf2dd2b5 100644 (file)
@@ -810,7 +810,6 @@ if TRANSPARENT_HUGEPAGE
 
 choice
        prompt "Transparent Hugepage Support sysfs defaults"
-       depends on TRANSPARENT_HUGEPAGE
        default TRANSPARENT_HUGEPAGE_ALWAYS
        help
          Selects the sysfs defaults for Transparent Hugepage Support.
@@ -840,7 +839,6 @@ endchoice
 
 choice
        prompt "Shmem hugepage allocation defaults"
-       depends on TRANSPARENT_HUGEPAGE
        default TRANSPARENT_HUGEPAGE_SHMEM_HUGE_NEVER
        help
          Selects the hugepage allocation policy defaults for
@@ -886,7 +884,6 @@ endchoice
 
 choice
        prompt "Tmpfs hugepage allocation defaults"
-       depends on TRANSPARENT_HUGEPAGE
        default TRANSPARENT_HUGEPAGE_TMPFS_HUGE_NEVER
        help
          Selects the hugepage allocation policy defaults for
@@ -931,7 +928,7 @@ endchoice
 
 config THP_SWAP
        def_bool y
-       depends on TRANSPARENT_HUGEPAGE && ARCH_WANTS_THP_SWAP && SWAP && 64BIT
+       depends on ARCH_WANTS_THP_SWAP && SWAP && 64BIT
        help
          Swap transparent huge pages in one piece, without splitting.
          XXX: For now, swap cluster backing transparent huge page