xen: Use __has_include() in xen/percpu.h
PATCH 1/1 xen: Use __has_include() in xen/percpu.h
Only x86 has an asm/percpu.h. Have the compiler only include it if it's present, rather than symlinking an empty file.
No functional change.
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Teddy Astie <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Julien Grall <[email protected]>
CC: Volodymyr Babchuk <[email protected]>
CC: Bertrand Marquis <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Oleksii Kurochko <[email protected]>
This same pattern can be applied most of the rest of generic-*, and it's high time we purged that logic.
--- xen/arch/arm/include/asm/Makefile | 1 - xen/arch/ppc/include/asm/Makefile | 1 - xen/arch/riscv/include/asm/Makefile | 1 - xen/include/asm-generic/percpu.h | 14 -------------- xen/include/xen/percpu.h | 4 +++- 5 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 xen/include/asm-generic/percpu.h
xen/arch/arm/include/asm/Makefile +0 -1
@@ -5,7 +5,6 @@ generic-y += hardirq.h generic-y += iocap.h generic-y += irq-dt.h generic-y += paging.h -generic-y += percpu.h generic-y += random.h generic-y += softirq.h generic-y += vm_event.h
xen/arch/ppc/include/asm/Makefile +0 -1
@@ -6,7 +6,6 @@ generic-y += hardirq.h generic-y += hypercall.h generic-y += iocap.h generic-y += paging.h -generic-y += percpu.h generic-y += perfc_defn.h generic-y += random.h generic-y += softirq.h
xen/arch/riscv/include/asm/Makefile +0 -1
@@ -6,7 +6,6 @@ generic-y += hardirq.h generic-y += hypercall.h generic-y += iocap.h generic-y += irq-dt.h -generic-y += percpu.h generic-y += random.h generic-y += softirq.h generic-y += vm_event.h
xen/include/asm-generic/percpu.h deleted +0 -14
@@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_GENERIC_PERCPU_H__ -#define __ASM_GENERIC_PERCPU_H__ - -#endif /* __ASM_GENERIC_PERCPU_H__ */ - -/* -* Local variables: -* mode: C -* c-file-style: "BSD" -* c-basic-offset: 4 -* indent-tabs-mode: nil -* End: -*/
xen/include/xen/percpu.h +3 -1
@@ -27,7 +27,9 @@#define get_per_cpu_var (var) (per_cpu__##var) -#include <asm/percpu.h> +#if __has_include(<asm/percpu.h>) +# include <asm/percpu.h> +#endif #ifndef __ASSEMBLER__
base-commit: a2ca4f8b9890899ca89d6116002e7a9c5957d8c6
Signature · 1 line
2.39.5
Quoted 6 lines · Andrew Cooper
Only x86 has an
asm/percpu.h. Have the compiler only include it if it's present, rather than symlinking an empty file.No functional change.
Signed-off-by Andrew Cooper <[email protected]>
Quoted 6 lines · Andrew Cooper
Only x86 has an
asm/percpu.h. Have the compiler only include it if it's present, rather than symlinking an empty file.No functional change.
Signed-off-by Andrew Cooper <[email protected]>
~Michal