Commit cdef5119 authored by Christian Borntraeger's avatar Christian Borntraeger Committed by Paolo Bonzini

KVM: fix sparse warning in include/trace/events/kvm.h

sparse complains about
include/trace/events/kvm.h:163:1: error: directive in argument list
include/trace/events/kvm.h:167:1: error: directive in argument list
include/trace/events/kvm.h:169:1: error: directive in argument list
and sparse is right. Preprocessing directives in an argument of a
macro are undefined behaviour as of C99 6.10.3p11.

Lets use an indirection to fix this.
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent ec6f34e5
...@@ -146,6 +146,14 @@ TRACE_EVENT(kvm_msi_set_irq, ...@@ -146,6 +146,14 @@ TRACE_EVENT(kvm_msi_set_irq,
#if defined(CONFIG_HAVE_KVM_IRQFD) #if defined(CONFIG_HAVE_KVM_IRQFD)
#ifdef kvm_irqchips
#define kvm_ack_irq_string "irqchip %s pin %u"
#define kvm_ack_irq_parm __print_symbolic(__entry->irqchip, kvm_irqchips), __entry->pin
#else
#define kvm_ack_irq_string "irqchip %d pin %u"
#define kvm_ack_irq_parm __entry->irqchip, __entry->pin
#endif
TRACE_EVENT(kvm_ack_irq, TRACE_EVENT(kvm_ack_irq,
TP_PROTO(unsigned int irqchip, unsigned int pin), TP_PROTO(unsigned int irqchip, unsigned int pin),
TP_ARGS(irqchip, pin), TP_ARGS(irqchip, pin),
...@@ -160,13 +168,7 @@ TRACE_EVENT(kvm_ack_irq, ...@@ -160,13 +168,7 @@ TRACE_EVENT(kvm_ack_irq,
__entry->pin = pin; __entry->pin = pin;
), ),
#ifdef kvm_irqchips TP_printk(kvm_ack_irq_string, kvm_ack_irq_parm)
TP_printk("irqchip %s pin %u",
__print_symbolic(__entry->irqchip, kvm_irqchips),
__entry->pin)
#else
TP_printk("irqchip %d pin %u", __entry->irqchip, __entry->pin)
#endif
); );
#endif /* defined(CONFIG_HAVE_KVM_IRQFD) */ #endif /* defined(CONFIG_HAVE_KVM_IRQFD) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment