Skip to content

Commit

Permalink
net/sched/sch_red.c: work around gcc-4.4.4 anon union initializer issue
Browse files Browse the repository at this point in the history
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: 602f3ba ("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>
  • Loading branch information
Andrew Morton authored and David S. Miller committed Nov 13, 2017
1 parent a1b8714 commit ee9d342
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions net/sched/sch_red.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ee9d342

Please sign in to comment.