summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKiryl Shutsemau (Meta) <kas@kernel.org>2026-08-18 12:50:26 +0100
committerAndrew Morton <akpm@linux-foundation.org>2026-08-24 18:43:26 -0700
commitdd1638dfbb1c48f13cfb4f4f4e55e6570e25384b (patch)
tree31e5270e1b335c3c1b270725eb17315e7efa39ff /include
parent9add2cc22de6c56881eabd9f1bd6c85bf98157d0 (diff)
downloadlinux-stable-dd1638dfbb1c48f13cfb4f4f4e55e6570e25384b.tar.gz
linux-stable-dd1638dfbb1c48f13cfb4f4f4e55e6570e25384b.zip
mm: include swap.h in swapops.h
swapops.h uses MAX_SWAPFILES_SHIFT, SWP_MIGRATION_READ and SWP_PTE_MARKER, all of which swap.h defines, but does not include swap.h. It compiles only where the translation unit pulled swap.h in first. leafops.h includes swapops.h on the line above swap.h, so a file whose include list reaches leafops.h before swap.h gets: In file included from include/linux/leafops.h:11: include/linux/swapops.h:88:21: error: use of undeclared identifier 'MAX_SWAPFILES_SHIFT' A header that uses a definition has to include the header that provides it. Link: https://lore.kernel.org/20260818115026.656406-1-kirill@shutemov.name Signed-off-by: Kiryl Shutsemau (Meta) <kas@kernel.org> Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202608181757.mza9RRj7-lkp@intel.com/ Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org> Reviewed-by: Barry Song <baohua@kernel.org> Cc: Baoquan He <baoquan.he@linux.dev> Cc: Chris Li <chrisl@kernel.org> Cc: Kairui Song <kasong@tencent.com> Cc: Kemeng Shi <shikemeng@huaweicloud.com> Cc: Nhat Pham <nphamcs@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/swapops.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/swapops.h b/include/linux/swapops.h
index 1f3ff3b93e16..e7d0d529f3e0 100644
--- a/include/linux/swapops.h
+++ b/include/linux/swapops.h
@@ -5,6 +5,7 @@
#include <linux/radix-tree.h>
#include <linux/bug.h>
#include <linux/mm_types.h>
+#include <linux/swap.h>
#ifdef CONFIG_MMU