netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/1] net/sched/sch_prio.c: work around gcc-4.4.4 union initializer issues
@ 2018-01-19  0:30 akpm
  2018-01-19  2:11 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2018-01-19  0:30 UTC (permalink / raw)
  To: davem, netdev, akpm, jiri, nogahf, yuvalm

From: Andrew Morton <akpm@linux-foundation.org>
Subject: net/sched/sch_prio.c: work around gcc-4.4.4 union initializer issues

gcc-4.4.4 has problems witn anon union initializers.  Work around this.

net/sched/sch_prio.c: In function 'prio_dump_offload':
net/sched/sch_prio.c:260: error: unknown field 'stats' specified in initializer
net/sched/sch_prio.c:260: warning: initialization makes integer from pointer without a cast
net/sched/sch_prio.c:261: error: unknown field 'stats' specified in initializer
net/sched/sch_prio.c:261: warning: initialization makes integer from pointer without a cast

Fixes: 7fdb61b44c0c95 ("net: sch: prio: Add offload ability to PRIO qdisc")
Cc: Nogah Frankel <nogahf@mellanox.com>
Cc: Yuval Mintz <yuvalm@mellanox.com>
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 net/sched/sch_prio.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff -puN net/sched/sch_prio.c~net-sched-sch_prioc-work-around-gcc-444-union-initializer-issues net/sched/sch_prio.c
--- a/net/sched/sch_prio.c~net-sched-sch_prioc-work-around-gcc-444-union-initializer-issues
+++ a/net/sched/sch_prio.c
@@ -254,11 +254,15 @@ static int prio_dump_offload(struct Qdis
 {
 	struct net_device *dev = qdisc_dev(sch);
 	struct tc_prio_qopt_offload hw_stats = {
+		.command = TC_PRIO_STATS,
 		.handle = sch->handle,
 		.parent = sch->parent,
-		.command = TC_PRIO_STATS,
-		.stats.bstats = &sch->bstats,
-		.stats.qstats = &sch->qstats,
+		{
+			.stats = {
+				.bstats = &sch->bstats,
+				.qstats = &sch->qstats,
+			},
+		},
 	};
 	int err;
 
_

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

* Re: [patch 1/1] net/sched/sch_prio.c: work around gcc-4.4.4 union initializer issues
  2018-01-19  0:30 [patch 1/1] net/sched/sch_prio.c: work around gcc-4.4.4 union initializer issues akpm
@ 2018-01-19  2:11 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-01-19  2:11 UTC (permalink / raw)
  To: akpm; +Cc: netdev, jiri, nogahf, yuvalm

From: akpm@linux-foundation.org
Date: Thu, 18 Jan 2018 16:30:49 -0800

> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: net/sched/sch_prio.c: work around gcc-4.4.4 union initializer issues
> 
> gcc-4.4.4 has problems witn anon union initializers.  Work around this.
> 
> net/sched/sch_prio.c: In function 'prio_dump_offload':
> net/sched/sch_prio.c:260: error: unknown field 'stats' specified in initializer
> net/sched/sch_prio.c:260: warning: initialization makes integer from pointer without a cast
> net/sched/sch_prio.c:261: error: unknown field 'stats' specified in initializer
> net/sched/sch_prio.c:261: warning: initialization makes integer from pointer without a cast
> 
> Fixes: 7fdb61b44c0c95 ("net: sch: prio: Add offload ability to PRIO qdisc")
> Cc: Nogah Frankel <nogahf@mellanox.com>
> Cc: Yuval Mintz <yuvalm@mellanox.com>
> Cc: Jiri Pirko <jiri@mellanox.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Applied, thanks Andrew.

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

end of thread, other threads:[~2018-01-19  2:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-19  0:30 [patch 1/1] net/sched/sch_prio.c: work around gcc-4.4.4 union initializer issues akpm
2018-01-19  2:11 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).