From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by huchra.bufferbloat.net (Postfix, from userid 1000) id 1771321F09F; Sat, 5 May 2012 04:34:33 -0700 (PDT) From: =?UTF-8?q?Dave=20T=C3=A4ht?= To: codel@lists.bufferbloat.net Date: Sat, 5 May 2012 04:34:31 -0700 Message-Id: <1336217671-20384-1-git-send-email-dave.taht@bufferbloat.net> X-Mailer: git-send-email 1.7.1 Cc: =?UTF-8?q?Dave=20T=C3=A4ht?= Subject: [Codel] [PATCH 2/2] Clamp interval to 32 bits X-BeenThere: codel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: CoDel AQM discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 May 2012 11:34:33 -0000 --- net/sched/sch_codel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/sch_codel.c b/net/sched/sch_codel.c index 636f505..d26db8c 100644 --- a/net/sched/sch_codel.c +++ b/net/sched/sch_codel.c @@ -88,10 +88,10 @@ static unsigned int states; * return interval/sqrt(x) with good precision */ -static u32 calc(u64 interval, unsigned long x) +static u32 calc(u32 _interval, unsigned long x) { - /* scale for 16 bits precision */ - while (x < (1UL << 30)) { + u64 interval = _interval; + while (x < (1UL << (BITS_PER_LONG - 2))) { x <<= 2; interval <<= 1; } -- 1.7.9.5