diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2017-11-10 15:09:53 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-13 10:33:07 +0900 |
commit | ee9d3429c0e47a57e3e73b638785cafa33773639 (patch) | |
tree | 6f23176112d5eb7752b22a365314490639410396 /net/sched | |
parent | a1b8714593b67d0f783a9d82ed7e5800d02776bb (diff) | |
download | talos-obmc-linux-ee9d3429c0e47a57e3e73b638785cafa33773639.tar.gz talos-obmc-linux-ee9d3429c0e47a57e3e73b638785cafa33773639.zip |
net/sched/sch_red.c: work around gcc-4.4.4 anon union initializer issue
gcc-4.4.4 (at lest) has issues with initializers and anonymous unions:
net/sched/sch_red.c: In function 'red_dump_offload':
net/sched/sch_red.c:282: error: unknown field 'stats' specified in initializer
net/sched/sch_red.c:282: warning: initialization makes integer from pointer without a cast
net/sched/sch_red.c:283: error: unknown field 'stats' specified in initializer
net/sched/sch_red.c:283: warning: initialization makes integer from pointer without a cast
net/sched/sch_red.c: In function 'red_dump_stats':
net/sched/sch_red.c:352: error: unknown field 'xstats' specified in initializer
net/sched/sch_red.c:352: warning: initialization makes integer from pointer without a cast
Work around this.
Fixes: 602f3baf2218 ("net_sch: red: Add offload ability to RED qdisc")
Cc: Nogah Frankel <nogahf@mellanox.com>
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Simon Horman <simon.horman@netronome.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/sch_red.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c index 007dd8ef8aac..7f8ea9e297c3 100644 --- a/net/sched/sch_red.c +++ b/net/sched/sch_red.c @@ -276,11 +276,13 @@ static int red_dump_offload(struct Qdisc *sch, struct tc_red_qopt *opt) { struct net_device *dev = qdisc_dev(sch); struct tc_red_qopt_offload hw_stats = { + .command = TC_RED_STATS, .handle = sch->handle, .parent = sch->parent, - .command = TC_RED_STATS, - .stats.bstats = &sch->bstats, - .stats.qstats = &sch->qstats, + { + .stats.bstats = &sch->bstats, + .stats.qstats = &sch->qstats, + }, }; int err; @@ -346,10 +348,12 @@ static int red_dump_stats(struct Qdisc *sch, struct gnet_dump *d) if (tc_can_offload(dev) && dev->netdev_ops->ndo_setup_tc) { struct red_stats hw_stats = {0}; struct tc_red_qopt_offload hw_stats_request = { + .command = TC_RED_XSTATS, .handle = sch->handle, .parent = sch->parent, - .command = TC_RED_XSTATS, - .xstats = &hw_stats, + { + .xstats = &hw_stats, + }, }; if (!dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_QDISC_RED, |