From: Paolo Bonzini <pbonzini@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: KVM <kvm@vger.kernel.org>
Subject: Re: [PATCH/RFC] KVM: fix sparse warning in include/trace/events/kvm.h
Date: Mon, 19 Jan 2015 11:07:11 +0100 [thread overview]
Message-ID: <54BCD74F.4020406@redhat.com> (raw)
In-Reply-To: <1421331679-38118-1-git-send-email-borntraeger@de.ibm.com>
On 15/01/2015 15:21, Christian Borntraeger wrote:
> 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: Christian Borntraeger <borntraeger@de.ibm.com>
Applied to kvm/master, thanks.
Paolo
> ---
> include/trace/events/kvm.h | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
> index 6edf1f2..86b399c 100644
> --- a/include/trace/events/kvm.h
> +++ b/include/trace/events/kvm.h
> @@ -146,6 +146,14 @@ TRACE_EVENT(kvm_msi_set_irq,
>
> #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,
> TP_PROTO(unsigned int irqchip, unsigned int pin),
> TP_ARGS(irqchip, pin),
> @@ -160,13 +168,7 @@ TRACE_EVENT(kvm_ack_irq,
> __entry->pin = pin;
> ),
>
> -#ifdef kvm_irqchips
> - 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
> + TP_printk(kvm_ack_irq_string, kvm_ack_irq_parm)
> );
>
> #endif /* defined(CONFIG_HAVE_KVM_IRQFD) */
>
prev parent reply other threads:[~2015-01-19 10:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-15 14:21 [PATCH/RFC] KVM: fix sparse warning in include/trace/events/kvm.h Christian Borntraeger
2015-01-19 8:54 ` Christian Borntraeger
2015-01-19 14:46 ` Marcelo Tosatti
2015-01-19 10:07 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54BCD74F.4020406@redhat.com \
--to=pbonzini@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.