diff mbox series

[1/2] x86/oprofile: fix oprofile for clang build

Message ID 20210423094343.5850-2-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show
Series x86/clang: build fixes | expand

Commit Message

Roger Pau Monné April 23, 2021, 9:43 a.m. UTC
Clang complains with:

backtrace.c:46:19: error: unused function 'is_32bit_vcpu' [-Werror,-Wunused-function]
static inline int is_32bit_vcpu(struct vcpu *vcpu)
                  ^

Fix this by guarding the function with CONFIG_COMPAT, as it's only
caller is also doing so.

Fixes: d23d792478d ('x86: avoid building COMPAT code when !HVM && !PV32')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/oprofile/backtrace.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jan Beulich April 23, 2021, 9:45 a.m. UTC | #1
On 23.04.2021 11:43, Roger Pau Monne wrote:
> Clang complains with:
> 
> backtrace.c:46:19: error: unused function 'is_32bit_vcpu' [-Werror,-Wunused-function]
> static inline int is_32bit_vcpu(struct vcpu *vcpu)
>                   ^
> 
> Fix this by guarding the function with CONFIG_COMPAT, as it's only
> caller is also doing so.
> 
> Fixes: d23d792478d ('x86: avoid building COMPAT code when !HVM && !PV32')
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

See my "x86/oprof: fix !HVM && !PV32 build" from the 16th.

Jan
diff mbox series

Patch

diff --git a/xen/arch/x86/oprofile/backtrace.c b/xen/arch/x86/oprofile/backtrace.c
index 929bf51a408..bd5d1b0f6ce 100644
--- a/xen/arch/x86/oprofile/backtrace.c
+++ b/xen/arch/x86/oprofile/backtrace.c
@@ -43,6 +43,7 @@  dump_hypervisor_backtrace(struct vcpu *vcpu, const struct frame_head *head,
     return head->ebp;
 }
 
+#ifdef CONFIG_COMPAT
 static inline int is_32bit_vcpu(struct vcpu *vcpu)
 {
     if (is_hvm_vcpu(vcpu))
@@ -50,6 +51,7 @@  static inline int is_32bit_vcpu(struct vcpu *vcpu)
     else
         return is_pv_32bit_vcpu(vcpu);
 }
+#endif
 
 static struct frame_head *
 dump_guest_backtrace(struct vcpu *vcpu, const struct frame_head *head,