From: Phil Sutter <phil@nwl.cc>
To: David Ahern <dsa@cumulusnetworks.com>
Cc: Stephen Hemminger <shemming@brocade.com>,
Daniel Borkmann <daniel@iogearbox.net>,
Nicolas Dichtel <nicolas.dichtel@6wind.com>,
Julien Floret <julien.floret@6wind.com>,
David Laight <David.Laight@ACULAB.COM>,
netdev@vger.kernel.org
Subject: Re: [iproute PATCH v4 2/5] Use C99 style initializers everywhere
Date: Fri, 15 Jul 2016 17:36:02 +0200 [thread overview]
Message-ID: <20160715153602.GG15034@orbyte.nwl.cc> (raw)
In-Reply-To: <2cd2d490-addc-e864-bce9-4526b409b908@cumulusnetworks.com>
On Fri, Jul 15, 2016 at 09:33:24AM -0600, David Ahern wrote:
> On 7/13/16 12:47 PM, Phil Sutter wrote:
> > This big patch was compiled by vimgrepping for memset calls and changing
> > to C99 initializer if applicable. One notable exception is the
> > initialization of union bpf_attr in tc/tc_bpf.c: changing it would break
> > for older gcc versions (at least <=3.4.6).
> >
> > Calls to memset for struct rtattr pointer fields for parse_rtattr*()
> > were just dropped since they are not needed.
> >
> > The changes here allowed the compiler to discover some unused variables,
> > so get rid of them, too.
> >
> > Signed-off-by: Phil Sutter <phil@nwl.cc>
> > ---
> > Changes since v3:
> > - Use empty instead of zero initializer.
> > Changes since v2:
> > - Flatten initializers.
> > - Leave a final comma in place.
> > - Fix checkpatch warnings.
> > - Initialize nlmsg_seq in the declaration, too.
> > - Use C99-style init in tc_bpf.c to get rid of the memset().
> > Changes since v1:
> > - Dropped former changes to tc/tc_bpf.c as they are incompatible to older
> > gcc versions (at least <=3.4.6).
> > ---
> > bridge/fdb.c | 25 ++++++-------
> > bridge/link.c | 14 +++----
> > bridge/mdb.c | 17 ++++-----
> > bridge/vlan.c | 17 ++++-----
> > genl/ctrl.c | 44 +++++++++-------------
> > ip/ip6tunnel.c | 10 ++---
> > ip/ipaddress.c | 31 +++++++---------
> > ip/ipaddrlabel.c | 21 ++++-------
> > ip/iplink.c | 61 +++++++++++++-----------------
> > ip/iplink_can.c | 4 +-
> > ip/ipmaddr.c | 25 ++++---------
> > ip/ipmroute.c | 8 +---
> > ip/ipneigh.c | 30 ++++++---------
> > ip/ipnetconf.c | 10 ++---
> > ip/ipnetns.c | 39 +++++++++-----------
> > ip/ipntable.c | 25 ++++---------
> > ip/iproute.c | 78 ++++++++++++++-------------------------
> > ip/iprule.c | 22 +++++------
> > ip/iptoken.c | 19 ++++------
> > ip/iptunnel.c | 31 +++++-----------
> > ip/ipxfrm.c | 26 ++++---------
> > ip/link_gre.c | 18 ++++-----
> > ip/link_gre6.c | 18 ++++-----
> > ip/link_ip6tnl.c | 25 +++++--------
> > ip/link_iptnl.c | 22 +++++------
> > ip/link_vti.c | 18 ++++-----
> > ip/link_vti6.c | 18 ++++-----
> > ip/xfrm_policy.c | 99 ++++++++++++++++++++-----------------------------
> > ip/xfrm_state.c | 110 +++++++++++++++++++++++--------------------------------
> > lib/libnetlink.c | 77 ++++++++++++++------------------------
> > lib/ll_map.c | 1 -
> > misc/arpd.c | 64 ++++++++++++++------------------
> > misc/ss.c | 37 +++++++------------
> > tc/e_bpf.c | 7 +---
> > tc/em_cmp.c | 4 +-
> > tc/em_ipset.c | 4 +-
> > tc/em_meta.c | 4 +-
> > tc/em_nbyte.c | 4 +-
> > tc/em_u32.c | 4 +-
> > tc/f_flow.c | 3 --
> > tc/f_flower.c | 3 +-
> > tc/f_fw.c | 6 +--
> > tc/f_route.c | 3 --
> > tc/f_rsvp.c | 6 +--
> > tc/f_u32.c | 12 ++----
> > tc/m_bpf.c | 5 +--
> > tc/m_csum.c | 4 +-
> > tc/m_ematch.c | 4 +-
> > tc/m_gact.c | 5 +--
> > tc/m_ife.c | 5 +--
> > tc/m_mirred.c | 7 +---
> > tc/m_nat.c | 4 +-
> > tc/m_pedit.c | 8 +---
> > tc/m_police.c | 5 +--
> > tc/q_atm.c | 3 +-
> > tc/q_cbq.c | 22 +++--------
> > tc/q_choke.c | 4 +-
> > tc/q_codel.c | 3 +-
> > tc/q_dsmark.c | 1 -
> > tc/q_fifo.c | 4 +-
> > tc/q_fq_codel.c | 3 +-
> > tc/q_hfsc.c | 13 ++-----
> > tc/q_htb.c | 15 +++-----
> > tc/q_netem.c | 16 +++-----
> > tc/q_red.c | 4 +-
> > tc/q_sfb.c | 17 ++++-----
> > tc/q_sfq.c | 4 +-
> > tc/q_tbf.c | 4 +-
> > tc/tc_bpf.c | 54 ++++++++++-----------------
> > tc/tc_class.c | 31 ++++++----------
> > tc/tc_exec.c | 3 +-
> > tc/tc_filter.c | 33 ++++++-----------
> > tc/tc_qdisc.c | 33 ++++++-----------
> > tc/tc_stab.c | 4 +-
> > tc/tc_util.c | 3 +-
> > 75 files changed, 532 insertions(+), 913 deletions(-)
>
>
> Really good cleanup. Thanks for taking the time to do it.
Thanks! And thanks for reviewing it.
Cheers, Phil
next prev parent reply other threads:[~2016-07-15 15:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-13 18:47 [iproute PATCH v4 0/5] Big C99 style initializer rework Phil Sutter
2016-07-13 18:47 ` [iproute PATCH v4 1/5] tc: m_action: Improve conversion to C99 style initializers Phil Sutter
2016-07-15 15:32 ` David Ahern
2016-07-13 18:47 ` [iproute PATCH v4 2/5] Use C99 style initializers everywhere Phil Sutter
2016-07-15 15:33 ` David Ahern
2016-07-15 15:36 ` Phil Sutter [this message]
2016-07-13 18:47 ` [iproute PATCH v4 3/5] Replace malloc && memset by calloc Phil Sutter
2016-07-15 15:33 ` David Ahern
2016-07-13 18:47 ` [iproute PATCH v4 4/5] No need to initialize rtattr fields before parsing Phil Sutter
2016-07-15 15:33 ` David Ahern
2016-07-13 18:47 ` [iproute PATCH v4 5/5] Makefile: Allow to override CC Phil Sutter
2016-07-15 15:33 ` David Ahern
2016-07-15 13:25 ` [iproute PATCH v4 0/5] Big C99 style initializer rework Nicolas Dichtel
2016-07-15 18:45 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160715153602.GG15034@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=David.Laight@ACULAB.COM \
--cc=daniel@iogearbox.net \
--cc=dsa@cumulusnetworks.com \
--cc=julien.floret@6wind.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=shemming@brocade.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.