Skip to contentSkip to conversation

xen: Use __has_include() in xen/percpu.h

PATCH In review Andrew Cooper 3 participants 3 messages Sep 9 – Sep 11 RISC-V

lore
Share & tools
lore
#0 lore raw

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
index 4565baca6a4d..a78a498eb566 100644
@@ -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
index c989a7f89b34..a5c46704ccad 100644
@@ -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
index 86c56251d5d7..d3483699278d 100644
@@ -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
deleted file mode 100644
index 3fdb3a2a0208..000000000000
@@ -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
index 30609f49f0b3..d324671b5b5f 100644
@@ -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