Skip to contentSkip to conversation

Remove redundant variable/code in __qdisc_run

PATCH Applied Krishna Kumar 2 participants 2 messages Jul 15, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove redundant variable/code in __qdisc_run

Remove redundant variable "work".

---
 net/sched/sch_generic.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/sched/sch_generic.c +1 -3
diff -ruNp org/net/sched/sch_generic.c new/net/sched/sch_generic.c
@@ -190,16 +190,14 @@ static inline int qdisc_restart(struct Q
 void __qdisc_run(struct Qdisc *q)
 {
 	int quota = weight_p;
-	int work = 0;
 
 	while (qdisc_restart(q)) {
-		work++;
 		/*
 		 * Ordered by possible occurrence: Postpone processing if
 		 * 1. we've exceeded packet quota
 		 * 2. another process needs the CPU;
 		 */
-		if (work >= quota || need_resched()) {
+		if (--quota <= 0 || need_resched()) {
 			__netif_schedule(q);
 			break;
 		}