aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2009-11-20 00:56:07 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-11-20 05:31:23 -0500
commit782e5711d61b2cda45dea447badba3ab07c236f0 (patch)
tree3b3916786274f09ec5e1cbeab4c564e6990caff6 /drivers/mtd/maps
parent8ce110ac19bc88b82e3feacfbb3a2ee08a07fe22 (diff)
mtd: vmu-flash: Use hweight_long
Use hweight_long instead of Brian Kernighan's/Peter Wegner's method Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r--drivers/mtd/maps/vmu-flash.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mtd/maps/vmu-flash.c b/drivers/mtd/maps/vmu-flash.c
index 1f73297e7776..1008462c3f7c 100644
--- a/drivers/mtd/maps/vmu-flash.c
+++ b/drivers/mtd/maps/vmu-flash.c
@@ -612,10 +612,9 @@ static int __devinit vmu_connect(struct maple_device *mdev)
612 612
613 test_flash_data = be32_to_cpu(mdev->devinfo.function); 613 test_flash_data = be32_to_cpu(mdev->devinfo.function);
614 /* Need to count how many bits are set - to find out which 614 /* Need to count how many bits are set - to find out which
615 * function_data element has details of the memory card: 615 * function_data element has details of the memory card
616 * using Brian Kernighan's/Peter Wegner's method */ 616 */
617 for (c = 0; test_flash_data; c++) 617 c = hweight_long(test_flash_data);
618 test_flash_data &= test_flash_data - 1;
619 618
620 basic_flash_data = be32_to_cpu(mdev->devinfo.function_data[c - 1]); 619 basic_flash_data = be32_to_cpu(mdev->devinfo.function_data[c - 1]);
621 620