Re: [PATCH v2] powerpc/setup_64: fix -Wempty-body warnings
From: Qian Cai
Date: Thu Jun 27 2019 - 15:52:51 EST
Ping.
On Wed, 2019-06-05 at 16:53 -0400, Qian Cai wrote:
> At the beginning of setup_64.c, it has,
>
> Â #ifdef DEBUG
> Â #define DBG(fmt...) udbg_printf(fmt)
> Â #else
> Â #define DBG(fmt...)
> Â #endif
>
> where DBG() could be compiled away, and generate warnings,
>
> arch/powerpc/kernel/setup_64.c: In function 'initialize_cache_info':
> arch/powerpc/kernel/setup_64.c:579:49: warning: suggest braces around
> empty body in an 'if' statement [-Wempty-body]
> ÂÂÂÂDBG("Argh, can't find dcache properties !\n");
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ^
> arch/powerpc/kernel/setup_64.c:582:49: warning: suggest braces around
> empty body in an 'if' statement [-Wempty-body]
> ÂÂÂÂDBG("Argh, can't find icache properties !\n");
>
> Suggested-by: Tyrel Datwyler <tyreld@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Qian Cai <cai@xxxxxx>
> ---
>
> v2: fix it by using a NOP while loop.
>
> Âarch/powerpc/kernel/setup_64.c | 2 +-
> Â1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
> index 44b4c432a273..bed4ae8d338c 100644
> --- a/arch/powerpc/kernel/setup_64.c
> +++ b/arch/powerpc/kernel/setup_64.c
> @@ -71,7 +71,7 @@
> Â#ifdef DEBUG
> Â#define DBG(fmt...) udbg_printf(fmt)
> Â#else
> -#define DBG(fmt...)
> +#define DBG(fmt...) do { } while (0)
> Â#endif
> Â
> Âint spinning_secondaries;