From: Seth Forshee Date: Tue, 26 Oct 2021 18:37:21 +0000 (-0500) Subject: net: sch: simplify condtion for selecting mini_Qdisc_pair buffer X-Git-Tag: v6.6.17~8953^2~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=85c0c3eb9a6657887e3f7c5140e38f529c815ee0;p=platform%2Fkernel%2Flinux-rpi.git net: sch: simplify condtion for selecting mini_Qdisc_pair buffer The only valid values for a miniq pointer are NULL or a pointer to miniq1 or miniq2, so testing for miniq_old != &miniq1 is functionally equivalent to testing that it is NULL or equal to &miniq2. Suggested-by: Jakub Kicinski Signed-off-by: Seth Forshee Link: https://lore.kernel.org/r/20211026183721.137930-1-seth@forshee.me Signed-off-by: Jakub Kicinski --- diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 24899efc..3b0f620 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -1500,7 +1500,7 @@ void mini_qdisc_pair_swap(struct mini_Qdisc_pair *miniqp, if (!tp_head) { RCU_INIT_POINTER(*miniqp->p_miniq, NULL); } else { - miniq = !miniq_old || miniq_old == &miniqp->miniq2 ? + miniq = miniq_old != &miniqp->miniq1 ? &miniqp->miniq1 : &miniqp->miniq2; /* We need to make sure that readers won't see the miniq