diff mbox series

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

Message ID 20201008121929.1270-1-shipujin.t@gmail.com (mailing list archive)
State Not Applicable
Headers show
Series [1/2] net: smc: fix missing brace warning for old compilers | expand

Commit Message

Pujin Shi Oct. 8, 2020, 12:19 p.m. UTC
For older versions of gcc, the array = {0}; will cause warnings:

net/smc/smc_llc.c: In function 'smc_llc_send_link_delete_all':
net/smc/smc_llc.c:1317:9: warning: missing braces around initializer [-Wmissing-braces]
  struct smc_llc_msg_del_link delllc = {0};
         ^
net/smc/smc_llc.c:1317:9: warning: (near initialization for 'delllc.hd') [-Wmissing-braces]

1 warnings generated

Fixes: f3811fd7bc97 ("net/smc: send DELETE_LINK, ALL message and wait for send to complete")
Signed-off-by: Pujin Shi <shipujin.t@gmail.com>
---
 net/smc/smc_llc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Karsten Graul Oct. 9, 2020, 6:03 p.m. UTC | #1
On Thu,  8 Oct 2020 20:19:28 +0800
Pujin Shi <shipujin.t@gmail.com> wrote:

> For older versions of gcc, the array = {0}; will cause warnings:
> 
> net/smc/smc_llc.c: In function 'smc_llc_send_link_delete_all':
> net/smc/smc_llc.c:1317:9: warning: missing braces around initializer [-Wmissing-braces]
>   struct smc_llc_msg_del_link delllc = {0};
>          ^
> net/smc/smc_llc.c:1317:9: warning: (near initialization for 'delllc.hd') [-Wmissing-braces]
> 
> 1 warnings generated
> 

Acked-by: Karsten Graul <kgraul@linux.ibm.com>
Jakub Kicinski Oct. 10, 2020, 5:37 p.m. UTC | #2
On Thu,  8 Oct 2020 20:19:28 +0800 Pujin Shi wrote:
> For older versions of gcc, the array = {0}; will cause warnings:
> 
> net/smc/smc_llc.c: In function 'smc_llc_send_link_delete_all':
> net/smc/smc_llc.c:1317:9: warning: missing braces around initializer [-Wmissing-braces]
>   struct smc_llc_msg_del_link delllc = {0};
>          ^
> net/smc/smc_llc.c:1317:9: warning: (near initialization for 'delllc.hd') [-Wmissing-braces]
> 
> 1 warnings generated
> 
> Fixes: f3811fd7bc97 ("net/smc: send DELETE_LINK, ALL message and wait for send to complete")
> Signed-off-by: Pujin Shi <shipujin.t@gmail.com>

Applied both, thanks!
diff mbox series

Patch

diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c
index 2db967f2fb50..d09d9d2d0bfd 100644
--- a/net/smc/smc_llc.c
+++ b/net/smc/smc_llc.c
@@ -1314,7 +1314,7 @@  static void smc_llc_process_cli_delete_link(struct smc_link_group *lgr)
  */
 void smc_llc_send_link_delete_all(struct smc_link_group *lgr, bool ord, u32 rsn)
 {
-	struct smc_llc_msg_del_link delllc = {0};
+	struct smc_llc_msg_del_link delllc = {};
 	int i;
 
 	delllc.hd.common.type = SMC_LLC_DELETE_LINK;