[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87y2tazs7h.fsf@mpe.ellerman.id.au>
Date: Mon, 10 Feb 2020 20:50:42 +1100
From: Michael Ellerman <mpe@...erman.id.au>
To: Masami Hiramatsu <mhiramat@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH] tools/bootconfig: Fix wrong __VA_ARGS__ usage
Masami Hiramatsu <mhiramat@...nel.org> writes:
> Since printk() wrapper macro uses __VA_ARGS__ without
> "##" prefix, it causes a build error if there is no
> variable arguments (e.g. only fmt is specified.)
> To fix this error, use ##__VA_ARGS__ instead of
> __VAR_ARGS__.
>
> Fixes: 950313ebf79c ("tools: bootconfig: Add bootconfig command")
> Reported-by: Michael Ellerman <mpe@...erman.id.au>
> Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> ---
> tools/bootconfig/include/linux/printk.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/bootconfig/include/linux/printk.h b/tools/bootconfig/include/linux/printk.h
> index 017bcd6912a5..e978a63d3222 100644
> --- a/tools/bootconfig/include/linux/printk.h
> +++ b/tools/bootconfig/include/linux/printk.h
> @@ -7,7 +7,7 @@
> /* controllable printf */
> extern int pr_output;
> #define printk(fmt, ...) \
> - (pr_output ? printf(fmt, __VA_ARGS__) : 0)
> + (pr_output ? printf(fmt, ##__VA_ARGS__) : 0)
>
> #define pr_err printk
> #define pr_warn printk
Tested-by: Michael Ellerman <mpe@...erman.id.au>
cheers
Powered by blists - more mailing lists