[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <16239d86d8177e70f15aab5e7dca61758a749fb0.camel@perches.com>
Date: Sat, 11 Apr 2020 09:37:10 -0700
From: Joe Perches <joe@...ches.com>
To: Jeff Dike <jdike@...toit.com>, Richard Weinberger <richard@....at>,
Anton Ivanov <anton.ivanov@...bridgegreys.com>
Cc: Erel Geron <erelx.geron@...el.com>, linux-um@...ts.infradead.org,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [trivial PATCH] um virtio: Neaten vu_err macro definition
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__)
Powered by blists - more mailing lists