From: Nathan Chancellor <[email protected]>
Date: Mon,  3 Jun 2019 13:49:53 -0700

> Clang warns:
> 
> drivers/net/ethernet/mscc/ocelot_ace.c:335:37: warning: suggest braces
> around initialization of subobject [-Wmissing-braces]
>         struct ocelot_vcap_u64 payload = { 0 };
>                                            ^
>                                            {}
> drivers/net/ethernet/mscc/ocelot_ace.c:336:28: warning: suggest braces
> around initialization of subobject [-Wmissing-braces]
>         struct vcap_data data = { 0 };
>                                   ^
>                                   {}
> drivers/net/ethernet/mscc/ocelot_ace.c:683:37: warning: suggest braces
> around initialization of subobject [-Wmissing-braces]
>         struct ocelot_ace_rule del_ace = { 0 };
>                                            ^
>                                            {}
> drivers/net/ethernet/mscc/ocelot_ace.c:743:28: warning: suggest braces
> around initialization of subobject [-Wmissing-braces]
>         struct vcap_data data = { 0 };
>                                   ^
>                                   {}
> 4 warnings generated.
> 
> One way to fix these warnings is to add additional braces like Clang
> suggests; however, there has been a bit of push back from some
> maintainers[1][2], who just prefer memset as it is unambiguous, doesn't
> depend on a particular compiler version[3], and properly initializes all
> subobjects. Do that here so there are no more warnings.
> 
> [1]: 
> https://lore.kernel.org/lkml/[email protected]/
> [2]: 
> https://lore.kernel.org/lkml/[email protected]/
> [3]: https://lore.kernel.org/lkml/[email protected]/
> 
> Fixes: b596229448dd ("net: mscc: ocelot: Add support for tcam")
> Link: https://github.com/ClangBuiltLinux/linux/issues/505
> Signed-off-by: Nathan Chancellor <[email protected]>

Applied to net-next.

Reply via email to