Skip to content

Commit

Permalink
net: sch: simplify condtion for selecting mini_Qdisc_pair buffer
Browse files Browse the repository at this point in the history
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 <kuba@kernel.org>
Signed-off-by: Seth Forshee <sforshee@digitalocean.com>
Link: https://lore.kernel.org/r/20211026183721.137930-1-seth@forshee.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Seth Forshee authored and Jakub Kicinski committed Oct 28, 2021
1 parent 2674638 commit 85c0c3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/sch_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 85c0c3e

Please sign in to comment.