Merge branches 'battery-2.6.34', 'bugzilla-10805', 'bugzilla-14668', 'bugzilla-531916...
[safe/jmp/linux-2.6] / drivers / platform / x86 / sony-laptop.c
index cc7172e..5a3d851 100644 (file)
@@ -1204,9 +1204,12 @@ static void sony_nc_rfkill_setup(struct acpi_device *device)
        /* the buffer is filled with magic numbers describing the devices
         * available, 0xff terminates the enumeration
         */
-       while ((dev_code = *(device_enum->buffer.pointer + i)) != 0xff &&
-                       i < device_enum->buffer.length) {
-               i++;
+       for (i = 0; i < device_enum->buffer.length; i++) {
+
+               dev_code = *(device_enum->buffer.pointer + i);
+               if (dev_code == 0xff)
+                       break;
+
                dprintk("Radio devices, looking at 0x%.2x\n", dev_code);
 
                if (dev_code == 0 && !sony_rfkill_devices[SONY_WIFI])