]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
runtime constants: move list of constants to vmlinux.lds.h
authorJann Horn <jannh@google.com>
Tue, 30 Jul 2024 20:15:16 +0000 (22:15 +0200)
committerArnd Bergmann <arnd@arndb.de>
Mon, 19 Aug 2024 07:48:14 +0000 (09:48 +0200)
Refactor the list of constant variables into a macro.
This should make it easier to add more constants in the future.

Signed-off-by: Jann Horn <jannh@google.com>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm64/kernel/vmlinux.lds.S
arch/s390/kernel/vmlinux.lds.S
arch/x86/kernel/vmlinux.lds.S
include/asm-generic/vmlinux.lds.h

index 55a8e310ea12c6254b5860ad761b29471a6c3cdf..58d89d997d050fc1d9a897bba8f3d12429953c28 100644 (file)
@@ -264,8 +264,7 @@ SECTIONS
                EXIT_DATA
        }
 
-       RUNTIME_CONST(shift, d_hash_shift)
-       RUNTIME_CONST(ptr, dentry_hashtable)
+       RUNTIME_CONST_VARIABLES
 
        PERCPU_SECTION(L1_CACHE_BYTES)
        HYPERVISOR_PERCPU_SECTION
index e67cd409b8587117925e2c0d1e4e8ec7eb126ea0..5e2e445969757c3a059ab003d2612b4414aa62c2 100644 (file)
@@ -191,8 +191,7 @@ SECTIONS
        . = ALIGN(PAGE_SIZE);
        INIT_DATA_SECTION(0x100)
 
-       RUNTIME_CONST(shift, d_hash_shift)
-       RUNTIME_CONST(ptr, dentry_hashtable)
+       RUNTIME_CONST_VARIABLES
 
        PERCPU_SECTION(0x100)
 
index 6e73403e874fc6609e4af24076f0c36460694d67..6726be89b7a663a1554f8f4b297bba65b4ebdf61 100644 (file)
@@ -357,8 +357,7 @@ SECTIONS
        PERCPU_SECTION(INTERNODE_CACHE_BYTES)
 #endif
 
-       RUNTIME_CONST(shift, d_hash_shift)
-       RUNTIME_CONST(ptr, dentry_hashtable)
+       RUNTIME_CONST_VARIABLES
 
        . = ALIGN(PAGE_SIZE);
 
index 1ae44793132a8d9a6349aff7dd51299f50cf820e..2157d8802351931cbd8bff239805331495b69de1 100644 (file)
 
 #define RUNTIME_CONST(t,x) NAMED_SECTION(runtime_##t##_##x)
 
+#define RUNTIME_CONST_VARIABLES                                                \
+               RUNTIME_CONST(shift, d_hash_shift)                      \
+               RUNTIME_CONST(ptr, dentry_hashtable)
+
 /* Alignment must be consistent with (kunit_suite *) in include/kunit/test.h */
 #define KUNIT_TABLE()                                                  \
                . = ALIGN(8);                                           \