- patches.suse/slab-handle-memoryless-nodes-v2a.patch: Refresh.
[linux-flexiantxendom0-3.2.10.git] / drivers / mtd / maps / vmu-flash.c
index 1f73297..82afad0 100644 (file)
@@ -612,16 +612,15 @@ static int __devinit vmu_connect(struct maple_device *mdev)
 
        test_flash_data = be32_to_cpu(mdev->devinfo.function);
        /* Need to count how many bits are set - to find out which
-        * function_data element has details of the memory card:
-        * using Brian Kernighan's/Peter Wegner's method */
-       for (c = 0; test_flash_data; c++)
-               test_flash_data &= test_flash_data - 1;
+        * function_data element has details of the memory card
+        */
+       c = hweight_long(test_flash_data);
 
        basic_flash_data = be32_to_cpu(mdev->devinfo.function_data[c - 1]);
 
        card = kmalloc(sizeof(struct memcard), GFP_KERNEL);
        if (!card) {
-               error = ENOMEM;
+               error = -ENOMEM;
                goto fail_nomem;
        }