diff options
author | Charles Manning <cdhmanning@gmail.com> | 2010-12-10 15:58:57 +1300 |
---|---|---|
committer | Charles Manning <cdhmanning@gmail.com> | 2010-12-10 15:58:57 +1300 |
commit | d223baa0fa5644b48c2626f8d42b05ac45b1daf6 (patch) | |
tree | dfee9414bec38622dcb1c8070f6a915dac425541 /yaffs_bitmap.c | |
parent | 5062df7307f71d3374da87a7c69102dc3f09da28 (diff) | |
parent | 7620f7d1207e72dc6b3c58bc452000b9ec82b57b (diff) |
Merge branch 'mainlining'
Diffstat (limited to 'yaffs_bitmap.c')
-rw-r--r-- | yaffs_bitmap.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/yaffs_bitmap.c b/yaffs_bitmap.c index 6be9d26..7df42cd 100644 --- a/yaffs_bitmap.c +++ b/yaffs_bitmap.c @@ -90,15 +90,9 @@ int yaffs_count_chunk_bits(struct yaffs_dev *dev, int blk) u8 *blk_bits = yaffs_block_bits(dev, blk); int i; int n = 0; - for (i = 0; i < dev->chunk_bit_stride; i++) { - u8 x = *blk_bits; - while (x) { - if (x & 1) - n++; - x >>= 1; - } - blk_bits++; - } + for (i = 0; i < dev->chunk_bit_stride; i++, blk_bits++) + n += hweight8(*blk_bits); + return n; } |