Re: [trivial PATCH] um virtio: Neaten vu_err macro definition

From: Joe Perches
Date: Sat Apr 11 2020 - 12:39:25 EST


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__)