On Mon, Apr 29, 2019 at 12:35 PM Stephen Hemminger
<step...@networkplumber.org> wrote:
>
> On Mon, 29 Apr 2019 11:46:14 -0700
> Tom Herbert <t...@herbertland.com> wrote:
>
> >  /* Default (unset) values for TLV parameters */
> >  static const struct tlv_proc tlv_default_proc = {
> > -     .params.rx_class = 0,
> > +     .params.r.class = 0,
> > +
> > +     .params.t.preferred_order = 0,
> > +     .params.t.admin_perm = IPV6_TLV_PERM_NO_CHECK,
> > +     .params.t.user_perm = IPV6_TLV_PERM_NONE,
> > +     .params.t.class = 0,
> > +     .params.t.align_mult = (4 - 1), /* Default alignment: 4n + 2 */
> > +     .params.t.align_off = 2,
> > +     .params.t.min_data_len = 0,
> > +     .params.t.max_data_len = 255,
> > +     .params.t.data_len_mult = (1 - 1), /* No default length align */
> > +     .params.t.data_len_off = 0,
> >  };
>
> This looks cleaner if you skip the unnecessary 0 entries
> and also use additional {}.

Hi Stephen,

I sort of like being explict here to list all the fields to make it
easy to use as a template for adding new structures.

Tom

>
> static const struct tlv_proc tlv_default_proc = {
>         .params.t = {
>                 .admin_perm = IPV6_TLV_PERM_NO_CHECK,
>                 .user_perm = IPV6_TLV_PERM_NONE,
>                 .align_mult = 3,  /* Default alignment: 4n + 2 */
>                 .align_off = 2,
>                 .max_data_len = 255,
>         },
> };
>
>

Reply via email to