* [trivial PATCH] um virtio: Neaten vu_err macro definition
@ 2020-04-11 16:28 Joe Perches
2020-04-11 16:37 ` Joe Perches
0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2020-04-11 16:28 UTC (permalink / raw)
To: Jeff Dike, Richard Weinberger, Anton Ivanov
Cc: Erel Geron, linux-um, linux-kernel
Defining a macro with ... and __VA_ARGS__ (without ##) can cause
compilation errors if a macro use does not have additional args.
Add ## to __VA_ARGS__ in the macro definition.
Signed-off-by: Joe Perches <joe@perches.com>
---
arch/um/drivers/virtio_uml.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c
index be54d3..351aee5 100644
--- a/arch/um/drivers/virtio_uml.c
+++ b/arch/um/drivers/virtio_uml.c
@@ -74,7 +74,7 @@ struct virtio_uml_vq_info {
extern unsigned long long physmem_size, highmem;
-#define vu_err(vu_dev, ...) dev_err(&(vu_dev)->pdev->dev, __VA_ARGS__)
+#define vu_err(vu_dev, ...) dev_err(&(vu_dev)->pdev->dev, ##__VA_ARGS__)
/* Vhost-user protocol */
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [trivial PATCH] um virtio: Neaten vu_err macro definition
2020-04-11 16:28 [trivial PATCH] um virtio: Neaten vu_err macro definition Joe Perches
@ 2020-04-11 16:37 ` Joe Perches
0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2020-04-11 16:37 UTC (permalink / raw)
To: Jeff Dike, Richard Weinberger, Anton Ivanov
Cc: Erel Geron, linux-um, linux-kernel
On Sat, 2020-04-11 at 09:28 -0700, Joe Perches wrote:
> Defining a macro with ... and __VA_ARGS__ (without ##) can cause
> compilation errors if a macro use does not have additional args.
>
> Add ## to __VA_ARGS__ in the macro definition.
[]
> diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c
[]
> @@ -74,7 +74,7 @@ struct virtio_uml_vq_info {
>
> extern unsigned long long physmem_size, highmem;
>
> -#define vu_err(vu_dev, ...) dev_err(&(vu_dev)->pdev->dev, __VA_ARGS__)
> +#define vu_err(vu_dev, ...) dev_err(&(vu_dev)->pdev->dev, ##__VA_ARGS__)
Ignore this. Caffeine-free so far this morning.
It _might_ be better as:
#define vu_err(vu_dev, fmt, ...) dev_err(&(vu_dev)->pdev->dev, fmt, ##__VA_ARGS__)
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-11 16:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-11 16:28 [trivial PATCH] um virtio: Neaten vu_err macro definition Joe Perches
2020-04-11 16:37 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox