Re: [PATCH v2] net: codel: fix build errors

From: David Miller
Date: Mon May 14 2012 - 18:00:23 EST


From: Sasha Levin <levinsasha928@xxxxxxxxx>
Date: Mon, 14 May 2012 23:57:06 +0200

> Fix the following build error:
...
> Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx>

Applied, but:

> struct tc_fq_codel_xstats st = {
> .type = TCA_FQ_CODEL_XSTATS_QDISC,
> - .qdisc_stats.maxpacket = q->cstats.maxpacket,
> - .qdisc_stats.drop_overlimit = q->drop_overlimit,
> - .qdisc_stats.ecn_mark = q->cstats.ecn_mark,
> - .qdisc_stats.new_flow_count = q->new_flow_count,
> };
> struct list_head *pos;
>
> + st.qdisc_stats.maxpacket = q->cstats.maxpacket;
> + st.qdisc_stats.drop_overlimit = q->drop_overlimit;
> + st.qdisc_stats.ecn_mark = q->cstats.ecn_mark;
> + st.qdisc_stats.new_flow_count = q->new_flow_count;
> +

This is now a very inefficient initialization of this structure.

GCC is going to fill all the non-explictly-initialized fields with
zero, then we'll write to the same fields again in the st.qdisc*
assignments.

Eric please resolve this, I hate knowing we have code like this :-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/