]> xenbits.xensource.com Git - xtf.git/commitdiff
Introduce and use __maybe_unused
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 22 Mar 2018 11:50:50 +0000 (11:50 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Sat, 7 Apr 2018 19:56:40 +0000 (20:56 +0100)
This allows for the 32bit ifdefary of ex_pf_user to be dropped without
suffering a warning in the 64bit build, while still allowing LTO to drop the
function.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Doxyfile
arch/x86/pv/traps.c
include/xtf/compiler.h

index afb55e98fbe1eec0e90a36b42aaf616b8f5bd3b0..75f2b3412ab54f07df2af897bfd48375748b2b31 100644 (file)
--- a/Doxyfile
+++ b/Doxyfile
@@ -2032,6 +2032,7 @@ PREDEFINED             = __alias(x)= \
                          __page_aligned_bss \
                          __page_aligned_data \
                          __printf(x,y)= \
+                         __maybe_unused \
                          __noinline \
                          __noreturn \
                          __used \
index ca0b9a3c12a3946b231b90f2e663dc0da74ba0d9..bbc9377f64572788cea1daf071749a69ae927cf4 100644 (file)
@@ -73,8 +73,8 @@ int xtf_set_idte(unsigned int vector, struct xtf_idte *idte)
     return hypercall_set_trap_table(ti);
 }
 
-#ifdef __i386__
-static bool ex_pf_user(struct cpu_regs *regs, const struct extable_entry *ex)
+static bool __maybe_unused ex_pf_user(struct cpu_regs *regs,
+                                      const struct extable_entry *ex)
 {
     if ( regs->entry_vector == X86_EXC_PF && read_cr2() == 0xfff )
     {
@@ -86,7 +86,6 @@ static bool ex_pf_user(struct cpu_regs *regs, const struct extable_entry *ex)
 
     return false;
 }
-#endif
 
 void arch_init_traps(void)
 {
index b148687b029e5ff5e4dec419fca5b39c17fa1b2a..2cc7d22e861b0078a559918a205f51555168b8b4 100644 (file)
@@ -10,6 +10,7 @@
 #define __noreturn            __attribute__((__noreturn__))
 #define __packed              __attribute__((__packed__))
 #define __printf(f, v)        __attribute__((__format__(__printf__, f, v)))
+#define __maybe_unused        __attribute__((__unused__))
 #define __used                __attribute__((__used__))
 #define __weak                __attribute__((__weak__))