diff options
author | Ingo Molnar <mingo@kernel.org> | 2021-08-28 15:28:08 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2022-03-15 12:56:54 +0100 |
commit | d5b114f63b24b8460fb4b6719d633a40c6c07ad6 (patch) | |
tree | 70864979d3d7c2a062d95ec571b2b450bca757b9 /arch | |
parent | b51ada159348ae7969e2a08faee8106467a4140f (diff) | |
download | tip-d5b114f63b24b8460fb4b6719d633a40c6c07ad6.tar.gz |
headers/deps: x86/mm: Optimize <asm/page_types.h> header dependencies
There's a couple of unrelated includes in this file, remove them:
--------------------------------------------------------------------
| Combined, preprocessed C code size of header, without line markers,
| with comments stripped:
-------------------------
before: | #include <asm/page_types.h> | LOC: 638 | headers: 53 |
after: | #include <asm/page_types.h> | LOC: 195 | headers: 27 |
Also remove a couple of __init annotations that relied on getting their
<linux/init.h> inclusion from <asm/page_types.h>: the __init attributes
are not needed for prototypes, and we don't want to include the full
<linux/init.h> header just to get them.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/fixmap.h | 20 | ||||
-rw-r--r-- | arch/x86/include/asm/page_types.h | 3 | ||||
-rw-r--r-- | arch/x86/include/asm/paravirt.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/pgtable_types.h | 12 | ||||
-rw-r--r-- | arch/x86/include/asm/setup.h | 8 |
5 files changed, 20 insertions, 25 deletions
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h index 8f48573f636e18..d6d94dfae26bbe 100644 --- a/arch/x86/include/asm/fixmap.h +++ b/arch/x86/include/asm/fixmap.h @@ -32,15 +32,15 @@ #define FIXMAP_PMD_TOP 507 #ifndef __ASSEMBLY__ +#include <linux/threads.h> #include <linux/math.h> #include <linux/kernel.h> #include <asm/apicdef.h> #include <asm/page.h> #include <asm/pgtable_types.h> -#ifdef CONFIG_X86_32 -#include <linux/threads.h> -#else -#include <uapi/asm/vsyscall.h> + +#ifdef CONFIG_X86_64 +# include <uapi/asm/vsyscall.h> #endif /* @@ -180,14 +180,10 @@ static inline void __set_fixmap(enum fixed_addresses idx, * Early memremap routines used for in-place encryption. The mappings created * by these routines are intended to be used as temporary mappings. */ -void __init *early_memremap_encrypted(resource_size_t phys_addr, - unsigned long size); -void __init *early_memremap_encrypted_wp(resource_size_t phys_addr, - unsigned long size); -void __init *early_memremap_decrypted(resource_size_t phys_addr, - unsigned long size); -void __init *early_memremap_decrypted_wp(resource_size_t phys_addr, - unsigned long size); +void *early_memremap_encrypted (resource_size_t phys_addr, unsigned long size); +void *early_memremap_encrypted_wp(resource_size_t phys_addr, unsigned long size); +void *early_memremap_decrypted (resource_size_t phys_addr, unsigned long size); +void *early_memremap_decrypted_wp(resource_size_t phys_addr, unsigned long size); #include <asm-generic/fixmap.h> diff --git a/arch/x86/include/asm/page_types.h b/arch/x86/include/asm/page_types.h index b9f812eaa0b076..f01f2f081166ec 100644 --- a/arch/x86/include/asm/page_types.h +++ b/arch/x86/include/asm/page_types.h @@ -2,9 +2,8 @@ #ifndef _ASM_X86_PAGE_DEFS_H #define _ASM_X86_PAGE_DEFS_H -#include <linux/const.h> #include <linux/types.h> -#include <linux/mem_encrypt.h> +#include <uapi/linux/const.h> /* PAGE_SHIFT determines the page size */ #define PAGE_SHIFT 12 diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h index 93957392164076..93da26fe078299 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h @@ -46,7 +46,7 @@ static inline u64 paravirt_steal_clock(int cpu) } #ifdef CONFIG_PARAVIRT_SPINLOCKS -void __init paravirt_set_cap(void); +void paravirt_set_cap(void); #endif /* The paravirtualized I/O functions */ diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index 40497a9020c6eb..0fbd6c05e29d35 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -565,12 +565,12 @@ extern pte_t *lookup_address_in_mm(struct mm_struct *mm, unsigned long address, unsigned int *level); extern pmd_t *lookup_pmd_address(unsigned long address); extern phys_addr_t slow_virt_to_phys(void *__address); -extern int __init kernel_map_pages_in_pgd(pgd_t *pgd, u64 pfn, - unsigned long address, - unsigned numpages, - unsigned long page_flags); -extern int __init kernel_unmap_pages_in_pgd(pgd_t *pgd, unsigned long address, - unsigned long numpages); +extern int kernel_map_pages_in_pgd(pgd_t *pgd, u64 pfn, + unsigned long address, + unsigned numpages, + unsigned long page_flags); +extern int kernel_unmap_pages_in_pgd(pgd_t *pgd, unsigned long address, + unsigned long numpages); #endif /* !__ASSEMBLY__ */ #endif /* _ASM_X86_PGTABLE_DEFS_H */ diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h index bad6accd2eb000..6180b8e077f154 100644 --- a/arch/x86/include/asm/setup.h +++ b/arch/x86/include/asm/setup.h @@ -52,7 +52,7 @@ extern unsigned long __startup_64(unsigned long physaddr, struct boot_params *bp extern unsigned long __startup_secondary_64(void); extern void startup_64_setup_env(unsigned long physbase); extern void early_setup_idt(void); -extern void __init do_early_exception(struct pt_regs *regs, int trapnr); +extern void do_early_exception(struct pt_regs *regs, int trapnr); #ifdef CONFIG_X86_INTEL_MID extern void x86_intel_mid_early_setup(void); @@ -134,11 +134,11 @@ void *extend_brk(size_t size, size_t align); extern void probe_roms(void); #ifdef __i386__ -asmlinkage void __init i386_start_kernel(void); +asmlinkage void i386_start_kernel(void); #else -asmlinkage void __init x86_64_start_kernel(char *real_mode); -asmlinkage void __init x86_64_start_reservations(char *real_mode_data); +asmlinkage void x86_64_start_kernel(char *real_mode); +asmlinkage void x86_64_start_reservations(char *real_mode_data); #endif /* __i386__ */ #endif /* _SETUP */ |