Commit 85c0c3eb authored by Seth Forshee's avatar Seth Forshee Committed by Jakub Kicinski

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: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSeth Forshee <sforshee@digitalocean.com>
Link: https://lore.kernel.org/r/20211026183721.137930-1-seth@forshee.meSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 26746382
...@@ -1500,7 +1500,7 @@ void mini_qdisc_pair_swap(struct mini_Qdisc_pair *miniqp, ...@@ -1500,7 +1500,7 @@ void mini_qdisc_pair_swap(struct mini_Qdisc_pair *miniqp,
if (!tp_head) { if (!tp_head) {
RCU_INIT_POINTER(*miniqp->p_miniq, NULL); RCU_INIT_POINTER(*miniqp->p_miniq, NULL);
} else { } else {
miniq = !miniq_old || miniq_old == &miniqp->miniq2 ? miniq = miniq_old != &miniqp->miniq1 ?
&miniqp->miniq1 : &miniqp->miniq2; &miniqp->miniq1 : &miniqp->miniq2;
/* We need to make sure that readers won't see the miniq /* We need to make sure that readers won't see the miniq
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment