summaryrefslogtreecommitdiffstats
path: root/mm/page_ext.c
diff options
context:
space:
mode:
authorTing Liu <liuting.0x7c00@bytedance.com>2022-01-14 14:09:28 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2022-01-15 16:30:31 +0200
commitcab0a7c115546a4865fb7439558af9077a569574 (patch)
tree103efc6cd003f560fcffbd2e7cbf9a56eeb54c70 /mm/page_ext.c
parent0b8f0d870020dbd7037bfacbb73a9b3213470f90 (diff)
downloadlinux-stable-cab0a7c115546a4865fb7439558af9077a569574.tar.gz
linux-stable-cab0a7c115546a4865fb7439558af9077a569574.tar.bz2
linux-stable-cab0a7c115546a4865fb7439558af9077a569574.zip
mm: make some vars and functions static or __init
"page_idle_ops" as a global var, but its scope of use within this document. So it should be static. "page_ext_ops" is a var used in the kernel initial phase. And other functions are aslo used in the kernel initial phase. So they should be __init or __initdata to reclaim memory. Link: https://lkml.kernel.org/r/20211217095023.67293-1-liuting.0x7c00@bytedance.com Signed-off-by: Ting Liu <liuting.0x7c00@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_ext.c')
-rw-r--r--mm/page_ext.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/page_ext.c b/mm/page_ext.c
index bee3240604dc..2e66d934d63f 100644
--- a/mm/page_ext.c
+++ b/mm/page_ext.c
@@ -64,12 +64,12 @@ static bool need_page_idle(void)
{
return true;
}
-struct page_ext_operations page_idle_ops = {
+static struct page_ext_operations page_idle_ops __initdata = {
.need = need_page_idle,
};
#endif
-static struct page_ext_operations *page_ext_ops[] = {
+static struct page_ext_operations *page_ext_ops[] __initdata = {
#ifdef CONFIG_PAGE_OWNER
&page_owner_ops,
#endif