Stephen Hemminger
2019-Mar-29 15:15 UTC
[PATCH net v4] failover: allow name change on IFF_UP slave interfaces
On Thu, 28 Mar 2019 19:47:27 -0400 Si-Wei Liu <si-wei.liu at oracle.com> wrote:> + if (unlikely(dev->flags & IFF_UP)) { > + struct netdev_notifier_change_info change_info; > + > + change_info.flags_changed = 0;Simpler to use structure initialization, which also avoid any chance of unititialized fields. struct netdev_notifier_change_info change_info = { .flags_changed = 0 };
Jiri Pirko
2019-Mar-29 15:34 UTC
[PATCH net v4] failover: allow name change on IFF_UP slave interfaces
Fri, Mar 29, 2019 at 04:15:12PM CET, stephen at networkplumber.org wrote:>On Thu, 28 Mar 2019 19:47:27 -0400 >Si-Wei Liu <si-wei.liu at oracle.com> wrote: > >> + if (unlikely(dev->flags & IFF_UP)) { >> + struct netdev_notifier_change_info change_info; >> + >> + change_info.flags_changed = 0; > >Simpler to use structure initialization, which also avoid any chance >of unititialized fields. > > struct netdev_notifier_change_info change_info > = { .flags_changed = 0 };In fact, you can do just: struct netdev_notifier_change_info change_info = {}; to achieve the same.