diff options
author | Patrick McHardy <kaber@trash.net> | 2009-09-04 02:41:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-06 05:07:02 -0400 |
commit | 5b9a9ccfad8553dbf7a9b17ba78bad70215ed0e2 (patch) | |
tree | 1454e8121fef6635a615f6766b3fdbff678ae63d /net/sched/sch_prio.c | |
parent | de6d5cdf881353f83006d5f3e28ac4fffd42145e (diff) |
net_sched: remove some unnecessary checks in classful schedulers
The class argument to the ->graft(), ->leaf(), ->dump(), ->dump_stats() all
originate from either ->get() or ->walk() and are always valid.
Remove unnecessary checks.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_prio.c')
-rw-r--r-- | net/sched/sch_prio.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 209a4ca4b98d..0f73c412d04b 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
@@ -262,9 +262,6 @@ static int prio_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, | |||
262 | struct prio_sched_data *q = qdisc_priv(sch); | 262 | struct prio_sched_data *q = qdisc_priv(sch); |
263 | unsigned long band = arg - 1; | 263 | unsigned long band = arg - 1; |
264 | 264 | ||
265 | if (band >= q->bands) | ||
266 | return -EINVAL; | ||
267 | |||
268 | if (new == NULL) | 265 | if (new == NULL) |
269 | new = &noop_qdisc; | 266 | new = &noop_qdisc; |
270 | 267 | ||
@@ -284,9 +281,6 @@ prio_leaf(struct Qdisc *sch, unsigned long arg) | |||
284 | struct prio_sched_data *q = qdisc_priv(sch); | 281 | struct prio_sched_data *q = qdisc_priv(sch); |
285 | unsigned long band = arg - 1; | 282 | unsigned long band = arg - 1; |
286 | 283 | ||
287 | if (band >= q->bands) | ||
288 | return NULL; | ||
289 | |||
290 | return q->queues[band]; | 284 | return q->queues[band]; |
291 | } | 285 | } |
292 | 286 | ||
@@ -316,11 +310,8 @@ static int prio_dump_class(struct Qdisc *sch, unsigned long cl, struct sk_buff * | |||
316 | { | 310 | { |
317 | struct prio_sched_data *q = qdisc_priv(sch); | 311 | struct prio_sched_data *q = qdisc_priv(sch); |
318 | 312 | ||
319 | if (cl - 1 > q->bands) | ||
320 | return -ENOENT; | ||
321 | tcm->tcm_handle |= TC_H_MIN(cl); | 313 | tcm->tcm_handle |= TC_H_MIN(cl); |
322 | if (q->queues[cl-1]) | 314 | tcm->tcm_info = q->queues[cl-1]->handle; |
323 | tcm->tcm_info = q->queues[cl-1]->handle; | ||
324 | return 0; | 315 | return 0; |
325 | } | 316 | } |
326 | 317 | ||