Re: [PATCH 2/2] net: smc: fix missing brace warning for old compilers

From: Karsten Graul
Date: Fri Oct 09 2020 - 14:04:20 EST


On Thu, 8 Oct 2020 20:19:29 +0800
Pujin Shi <shipujin.t@xxxxxxxxx> wrote:

> For older versions of gcc, the array = {0}; will cause warnings:
>
> net/smc/smc_llc.c: In function 'smc_llc_add_link_local':
> net/smc/smc_llc.c:1212:9: warning: missing braces around initializer [-Wmissing-braces]
> struct smc_llc_msg_add_link add_llc = {0};
> ^
> net/smc/smc_llc.c:1212:9: warning: (near initialization for 'add_llc.hd') [-Wmissing-braces]
> net/smc/smc_llc.c: In function 'smc_llc_srv_delete_link_local':
> net/smc/smc_llc.c:1245:9: warning: missing braces around initializer [-Wmissing-braces]
> struct smc_llc_msg_del_link del_llc = {0};
> ^
> net/smc/smc_llc.c:1245:9: warning: (near initialization for 'del_llc.hd') [-Wmissing-braces]
>
> 2 warnings generated
>

Acked-by: Karsten Graul <kgraul@xxxxxxxxxxxxx>

--
Karsten