aboutsummaryrefslogtreecommitdiffstats
path: root/tc/m_mirred.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2016-07-18 16:48:42 +0200
committerStephen Hemminger <shemming@brocade.com>2016-07-20 12:05:24 -0700
commitd17b136f7d7dd6ed7ea518e4f068d3de735e8756 (patch)
tree822b758ac6ee3ab064c6b55f7d6e2adc5067b771 /tc/m_mirred.c
parentd892aaf7400ac410864ab03b48891e34206b1307 (diff)
downloadplatform_external_iproute2-d17b136f7d7dd6ed7ea518e4f068d3de735e8756.tar.gz
platform_external_iproute2-d17b136f7d7dd6ed7ea518e4f068d3de735e8756.tar.bz2
platform_external_iproute2-d17b136f7d7dd6ed7ea518e4f068d3de735e8756.zip
Use C99 style initializers everywhere
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> Acked-by: David Ahern <dsa@cumulusnetworks.com>
Diffstat (limited to 'tc/m_mirred.c')
-rw-r--r--tc/m_mirred.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/tc/m_mirred.c b/tc/m_mirred.c
index 64aad4d2..0066905a 100644
--- a/tc/m_mirred.c
+++ b/tc/m_mirred.c
@@ -69,12 +69,9 @@ parse_egress(struct action_util *a, int *argc_p, char ***argv_p,
int argc = *argc_p;
char **argv = *argv_p;
int ok = 0, iok = 0, mirror = 0, redir = 0;
- struct tc_mirred p;
+ struct tc_mirred p = {};
struct rtattr *tail;
- char d[16];
-
- memset(d, 0, sizeof(d)-1);
- memset(&p, 0, sizeof(struct tc_mirred));
+ char d[16] = {};
while (argc > 0) {