core: pxe: don't confuse index and data when searching...
authorH. Peter Anvin <hpa@zytor.com>
Fri, 4 Sep 2009 00:18:24 +0000 (17:18 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 4 Sep 2009 00:19:36 +0000 (17:19 -0700)
Don't confuse the index and data when searching the PCI ID table for
special idle handling.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/fs/pxe/idle.c

index 73379fe..5393ae1 100644 (file)
@@ -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;
        }
     }