From: David Ward Date: Thu, 13 Sep 2012 05:22:33 +0000 (+0000) Subject: net_sched: gred: eliminate redundant DP prio comparisons X-Git-Tag: upstream/snapshot3+hdmi~6711^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c22e464022f935b0cbd8724b1d99d800d49518a9;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git net_sched: gred: eliminate redundant DP prio comparisons Each pair of DPs only needs to be compared once when searching for a non-unique prio value. Signed-off-by: David Ward Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index fca73cd..e19d4eb 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c @@ -102,9 +102,8 @@ static inline int gred_wred_mode_check(struct Qdisc *sch) if (q == NULL) continue; - for (n = 0; n < table->DPs; n++) - if (table->tab[n] && table->tab[n] != q && - table->tab[n]->prio == q->prio) + for (n = i + 1; n < table->DPs; n++) + if (table->tab[n] && table->tab[n]->prio == q->prio) return 1; }