Skip to content

Commit 5f2939d

Browse files
tohojodavem330
authored andcommitted
sch_api: Change signature of qdisc_tree_reduce_backlog() to use ints
There are now several places where qdisc_tree_reduce_backlog() is called with a negative number of packets (to signal an increase in number of packets in the queue). Rather than rely on overflow behaviour, change the function signature to use signed integers to communicate this usage to people reading the code. Signed-off-by: Toke Høiland-Jørgensen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f04d402 commit 5f2939d

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

include/net/sch_generic.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,7 @@ struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
580580
void qdisc_reset(struct Qdisc *qdisc);
581581
void qdisc_put(struct Qdisc *qdisc);
582582
void qdisc_put_unlocked(struct Qdisc *qdisc);
583-
void qdisc_tree_reduce_backlog(struct Qdisc *qdisc, unsigned int n,
584-
unsigned int len);
583+
void qdisc_tree_reduce_backlog(struct Qdisc *qdisc, int n, int len);
585584
#ifdef CONFIG_NET_SCHED
586585
int qdisc_offload_dump_helper(struct Qdisc *q, enum tc_setup_type type,
587586
void *type_data);

net/sched/sch_api.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,7 @@ static u32 qdisc_alloc_handle(struct net_device *dev)
758758
return 0;
759759
}
760760

761-
void qdisc_tree_reduce_backlog(struct Qdisc *sch, unsigned int n,
762-
unsigned int len)
761+
void qdisc_tree_reduce_backlog(struct Qdisc *sch, int n, int len)
763762
{
764763
bool qdisc_is_offloaded = sch->flags & TCQ_F_OFFLOADED;
765764
const struct Qdisc_class_ops *cops;

0 commit comments

Comments
 (0)