Re: [PATCH iproute2-next v2 1/4] utils: Introduce and use inet_prefix_reset_flags()

2018-02-12 Thread David Ahern
On 2/11/18 1:02 PM, Serhey Popovych wrote: > Initializing @inet_prefix using C initializers or memset() seems > inefficient and unnecessary: only small part of ->data[] field will be > used to store address corresponding to ->family. > > Instead initialize ->flags with zero and assume no other

Re: [PATCH iproute2-next v2 1/4] utils: Introduce and use inet_prefix_reset_flags()

2018-02-11 Thread David Ahern
On 2/11/18 4:48 PM, Stephen Hemminger wrote: > On Sun, 11 Feb 2018 22:02:30 +0200 > Serhey Popovych wrote: > >> +static inline void inet_prefix_reset_flags(inet_prefix *p) >> +{ >> +p->flags = 0; >> +} > > Just do it. > > Wrapper adds nothing here. > I asked for

Re: [PATCH iproute2-next v2 1/4] utils: Introduce and use inet_prefix_reset_flags()

2018-02-11 Thread Stephen Hemminger
On Sun, 11 Feb 2018 22:02:30 +0200 Serhey Popovych wrote: > +static inline void inet_prefix_reset_flags(inet_prefix *p) > +{ > + p->flags = 0; > +} Just do it. Wrapper adds nothing here.

[PATCH iproute2-next v2 1/4] utils: Introduce and use inet_prefix_reset_flags()

2018-02-11 Thread Serhey Popovych
Initializing @inet_prefix using C initializers or memset() seems inefficient and unnecessary: only small part of ->data[] field will be used to store address corresponding to ->family. Instead initialize ->flags with zero and assume no other fields accessed before checking corresponding bits in