net: sched: using TCQ_MIN_PRIO_BANDS in prio_tune()
authorZhengchao Shao <shaozhengchao@huawei.com>
Fri, 26 Aug 2022 04:10:35 +0000 (12:10 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 30 Aug 2022 10:43:29 +0000 (12:43 +0200)
Using TCQ_MIN_PRIO_BANDS instead of magic number in prio_tune().

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Link: https://lore.kernel.org/r/20220826041035.80129-1-shaozhengchao@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/sched/sch_prio.c

index c03a11dd990f40de7a0e31d39e48c4825a9d55f3..298794c04836fc73fc1d3df6b9a7ea1f4acf70d3 100644 (file)
@@ -185,7 +185,7 @@ static int prio_tune(struct Qdisc *sch, struct nlattr *opt,
                return -EINVAL;
        qopt = nla_data(opt);
 
-       if (qopt->bands > TCQ_PRIO_BANDS || qopt->bands < 2)
+       if (qopt->bands > TCQ_PRIO_BANDS || qopt->bands < TCQ_MIN_PRIO_BANDS)
                return -EINVAL;
 
        for (i = 0; i <= TC_PRIO_MAX; i++) {