From: Phil Sutter <phil@nwl.cc>
To: Stephen Hemminger <shemming@brocade.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
David Ahern <dsa@cumulusnetworks.com>,
Nicolas Dichtel <nicolas.dichtel@6wind.com>,
Julien Floret <julien.floret@6wind.com>,
David Laight <David.Laight@ACULAB.COM>,
netdev@vger.kernel.org
Subject: [iproute PATCH v4 4/5] No need to initialize rtattr fields before parsing
Date: Wed, 13 Jul 2016 20:47:18 +0200 [thread overview]
Message-ID: <1468435639-6892-5-git-send-email-phil@nwl.cc> (raw)
In-Reply-To: <1468435639-6892-1-git-send-email-phil@nwl.cc>
Since parse_rtattr_flags() calls memset already, there is no need for
callers to do so themselves.
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
ip/ipaddress.c | 2 +-
tc/tc_class.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index cfcebe76af399..60862c5700330 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -449,7 +449,7 @@ static void print_num(FILE *fp, unsigned int width, uint64_t count)
static void print_vf_stats64(FILE *fp, struct rtattr *vfstats)
{
- struct rtattr *vf[IFLA_VF_STATS_MAX + 1] = {};
+ struct rtattr *vf[IFLA_VF_STATS_MAX + 1];
if (vfstats->rta_type != IFLA_VF_STATS) {
fprintf(stderr, "BUG: rta type is %d\n", vfstats->rta_type);
diff --git a/tc/tc_class.c b/tc/tc_class.c
index 1690ec1bbfad8..f3864d22f3c4d 100644
--- a/tc/tc_class.c
+++ b/tc/tc_class.c
@@ -219,7 +219,7 @@ static void graph_cls_show(FILE *fp, char *buf, struct hlist_head *root_list,
{
struct hlist_node *n, *tmp_cls;
char cls_id_str[256] = {};
- struct rtattr *tb[TCA_MAX + 1] = {};
+ struct rtattr *tb[TCA_MAX + 1];
struct qdisc_util *q;
char str[100] = {};
@@ -304,7 +304,7 @@ int print_class(const struct sockaddr_nl *who,
FILE *fp = (FILE *)arg;
struct tcmsg *t = NLMSG_DATA(n);
int len = n->nlmsg_len;
- struct rtattr *tb[TCA_MAX + 1] = {};
+ struct rtattr *tb[TCA_MAX + 1];
struct qdisc_util *q;
char abuf[256];
--
2.8.2
next prev parent reply other threads:[~2016-07-13 18:48 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
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 ` Phil Sutter [this message]
2016-07-15 15:33 ` [iproute PATCH v4 4/5] No need to initialize rtattr fields before parsing 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=1468435639-6892-5-git-send-email-phil@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).