summaryrefslogtreecommitdiff
path: root/arch/powerpc
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@csgroup.eu>2020-09-27 09:16:24 +0000
committerMichael Ellerman <mpe@ellerman.id.au>2020-12-04 01:01:16 +1100
commit4fe0e3c1724e397845df75f64059bcea4ff590e8 (patch)
tree3626432513762cefe4d569941b19f45e603286e1 /arch/powerpc
parent3cf63825413c9eed2dae06070464efb27381bdac (diff)
powerpc/vdso: Remove unnecessary ifdefs in vdso_pagelist initialization
No need of all those #ifdefs around the pagelist initialisation, use IS_ENABLED(), GCC will kick out unused static variables. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/f9333432e329b1fcbbbf846cb1cd4a1c4127a60b.1601197618.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/vdso.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index d129d7ee006d..a24f6a583fac 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -53,15 +53,12 @@ static struct page **vdso32_pagelist;
unsigned long vdso32_sigtramp;
unsigned long vdso32_rt_sigtramp;
-#ifdef CONFIG_VDSO32
extern char vdso32_start, vdso32_end;
-#endif
-
-#ifdef CONFIG_PPC64
extern char vdso64_start, vdso64_end;
static void *vdso64_kbase = &vdso64_start;
static unsigned int vdso64_pages;
static struct page **vdso64_pagelist;
+#ifdef CONFIG_PPC64
unsigned long vdso64_rt_sigtramp;
#endif /* CONFIG_PPC64 */
@@ -136,7 +133,6 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
if (!vdso_ready)
return 0;
-#ifdef CONFIG_PPC64
if (is_32bit_task()) {
vdso_pagelist = vdso32_pagelist;
vdso_pages = vdso32_pages;
@@ -151,11 +147,6 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
*/
vdso_base = 0;
}
-#else
- vdso_pagelist = vdso32_pagelist;
- vdso_pages = vdso32_pages;
- vdso_base = VDSO32_MBASE;
-#endif
current->mm->context.vdso_base = 0;
@@ -614,9 +605,7 @@ static __init int vdso_setup(void)
struct lib64_elfinfo v64;
v32.hdr = vdso32_kbase;
-#ifdef CONFIG_PPC64
v64.hdr = vdso64_kbase;
-#endif
if (vdso_do_find_sections(&v32, &v64))
return -1;
@@ -722,16 +711,14 @@ static int __init vdso_init(void)
vdso_data->icache_block_size = ppc64_caches.l1i.block_size;
vdso_data->dcache_log_block_size = ppc64_caches.l1d.log_block_size;
vdso_data->icache_log_block_size = ppc64_caches.l1i.log_block_size;
+#endif /* CONFIG_PPC64 */
/*
* Calculate the size of the 64 bits vDSO
*/
vdso64_pages = (&vdso64_end - &vdso64_start) >> PAGE_SHIFT;
DBG("vdso64_kbase: %p, 0x%x pages\n", vdso64_kbase, vdso64_pages);
-#endif /* CONFIG_PPC64 */
-
-#ifdef CONFIG_VDSO32
vdso32_kbase = &vdso32_start;
/*
@@ -739,8 +726,6 @@ static int __init vdso_init(void)
*/
vdso32_pages = (&vdso32_end - &vdso32_start) >> PAGE_SHIFT;
DBG("vdso32_kbase: %p, 0x%x pages\n", vdso32_kbase, vdso32_pages);
-#endif
-
vdso_setup_syscall_map();
@@ -751,19 +736,15 @@ static int __init vdso_init(void)
if (vdso_setup()) {
printk(KERN_ERR "vDSO setup failure, not enabled !\n");
vdso32_pages = 0;
-#ifdef CONFIG_PPC64
vdso64_pages = 0;
-#endif
return 0;
}
-#ifdef CONFIG_VDSO32
- vdso32_pagelist = vdso_setup_pages(&vdso32_start, &vdso32_end);
-#endif
+ if (IS_ENABLED(CONFIG_VDSO32))
+ vdso32_pagelist = vdso_setup_pages(&vdso32_start, &vdso32_end);
-#ifdef CONFIG_PPC64
- vdso64_pagelist = vdso_setup_pages(&vdso64_start, &vdso64_end);
-#endif /* CONFIG_PPC64 */
+ if (IS_ENABLED(CONFIG_PPC64))
+ vdso64_pagelist = vdso_setup_pages(&vdso64_start, &vdso64_end);
smp_wmb();
vdso_ready = 1;