diff mbox

Remove redundant variable/code in __qdisc_run

Message ID 20110715091621.23013.37893.sendpatchset@krkumar2.in.ibm.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Krishna Kumar July 15, 2011, 9:16 a.m. UTC
Remove redundant variable "work".

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---
 net/sched/sch_generic.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller July 15, 2011, 3:09 p.m. UTC | #1
From: Krishna Kumar <krkumar2@in.ibm.com>
Date: Fri, 15 Jul 2011 14:46:21 +0530

> Remove redundant variable "work".
> 
> Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff -ruNp org/net/sched/sch_generic.c new/net/sched/sch_generic.c
--- org/net/sched/sch_generic.c	2011-06-27 16:16:07.000000000 +0530
+++ new/net/sched/sch_generic.c	2011-07-13 10:58:39.000000000 +0530
@@ -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;
 		}