* [Qemu-devel] checkpatch.pl false positive
@ 2014-09-12 10:35 Gerd Hoffmann
2014-09-12 10:36 ` Peter Maydell
0 siblings, 1 reply; 2+ messages in thread
From: Gerd Hoffmann @ 2014-09-12 10:35 UTC (permalink / raw)
To: qemu-devel
Hi,
Hooked up checkpatch to my testbuild-patch-series script.
Catched some issues, now trapped into what I think is a false positive:
ERROR: Macros with complex values should be enclosed in parenthesis
#995: FILE: include/hw/virtio/virtio-gpu.h:99:
+#define DEFINE_VIRTIO_GPU_PCI_PROPERTIES(_state) \
+ DEFINE_PROP_BIT("ioeventfd", _state, flags, \
+ VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, false), \
+ DEFINE_PROP_UINT32("vectors", _state, nvectors, 4)
enclosing into parenthesis just isn't going to fly here as this is an
array snipped, not some piece of code we could wrap into the usual
"{ $code } while (0)".
cheers,
Gerd
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] checkpatch.pl false positive
2014-09-12 10:35 [Qemu-devel] checkpatch.pl false positive Gerd Hoffmann
@ 2014-09-12 10:36 ` Peter Maydell
0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2014-09-12 10:36 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
On 12 September 2014 11:35, Gerd Hoffmann <kraxel@redhat.com> wrote:
> Hi,
>
> Hooked up checkpatch to my testbuild-patch-series script.
> Catched some issues, now trapped into what I think is a false positive:
>
> ERROR: Macros with complex values should be enclosed in parenthesis
> #995: FILE: include/hw/virtio/virtio-gpu.h:99:
> +#define DEFINE_VIRTIO_GPU_PCI_PROPERTIES(_state) \
> + DEFINE_PROP_BIT("ioeventfd", _state, flags, \
> + VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, false), \
> + DEFINE_PROP_UINT32("vectors", _state, nvectors, 4)
>
> enclosing into parenthesis just isn't going to fly here as this is an
> array snipped, not some piece of code we could wrap into the usual
> "{ $code } while (0)".
Yes, I think we should just expect that checkpatch is sometimes
going to get confused by complex macros. It's never going to
be 100% accurate.
-- PMM
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-12 10:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-12 10:35 [Qemu-devel] checkpatch.pl false positive Gerd Hoffmann
2014-09-12 10:36 ` Peter Maydell
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.