aboutsummaryrefslogtreecommitdiffstats
path: root/tc/m_gact.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_gact.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_gact.c')
-rw-r--r--tc/m_gact.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/tc/m_gact.c b/tc/m_gact.c
index b22ce191..ea2c9ec8 100644
--- a/tc/m_gact.c
+++ b/tc/m_gact.c
@@ -97,16 +97,13 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p,
char **argv = *argv_p;
int ok = 0;
int action = TC_POLICE_RECLASSIFY;
- struct tc_gact p;
+ struct tc_gact p = { .action = TC_POLICE_RECLASSIFY };
#ifdef CONFIG_GACT_PROB
int rd = 0;
struct tc_gact_p pp;
#endif
struct rtattr *tail;
- memset(&p, 0, sizeof(p));
- p.action = TC_POLICE_RECLASSIFY;
-
if (argc < 0)
return -1;