From fde3298c7bc2b6d90ffc104219f2cb116f71a315 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 3 Sep 2009 17:18:24 -0700 Subject: [PATCH] core: pxe: don't confuse index and data when searching... Don't confuse the index and data when searching the PCI ID table for special idle handling. Signed-off-by: H. Peter Anvin --- core/fs/pxe/idle.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/fs/pxe/idle.c b/core/fs/pxe/idle.c index 73379fe..5393ae1 100644 --- a/core/fs/pxe/idle.c +++ b/core/fs/pxe/idle.c @@ -87,15 +87,16 @@ void pxe_idle_init(void) found = false; while (h >= l) { - uint32_t e = pxe_need_idle_drain[(l+h) >> 1]; + int x = (l+h) >> 1; + uint32_t id = pxe_need_idle_drain[x]; - if (e == dev_id) { + if (id == dev_id) { found = true; break; - } else if (e < dev_id) { - l = e+1; + } else if (id < dev_id) { + l = x+1; } else { - h = e-1; + h = x-1; } } -- 2.7.4