All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 1/1] net/sched/sch_red.c: work around gcc-4.4.4 anon union initializer issue
@ 2017-11-10 23:09 akpm
  2017-11-13  1:34 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2017-11-10 23:09 UTC (permalink / raw)
  To: davem, netdev, akpm, jiri, nogahf, simon.horman

From: Andrew Morton <akpm@linux-foundation.org>
Subject: 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>
---

 net/sched/sch_red.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff -puN net/sched/sch_red.c~net-sched-sch_redc-work-around-gcc-444-anon-union-initializer-issue net/sched/sch_red.c
--- a/net/sched/sch_red.c~net-sched-sch_redc-work-around-gcc-444-anon-union-initializer-issue
+++ a/net/sched/sch_red.c
@@ -276,11 +276,13 @@ static int red_dump_offload(struct Qdisc
 {
 	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 *
 	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,
_

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 1/1] net/sched/sch_red.c: work around gcc-4.4.4 anon union initializer issue
  2017-11-10 23:09 [patch 1/1] net/sched/sch_red.c: work around gcc-4.4.4 anon union initializer issue akpm
@ 2017-11-13  1:34 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-11-13  1:34 UTC (permalink / raw)
  To: akpm; +Cc: netdev, jiri, nogahf, simon.horman

From: akpm@linux-foundation.org
Date: Fri, 10 Nov 2017 15:09:53 -0800

> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-13  1:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-10 23:09 [patch 1/1] net/sched/sch_red.c: work around gcc-4.4.4 anon union initializer issue akpm
2017-11-13  1:34 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.