From: Charles Manning Date: Fri, 10 Dec 2010 02:58:57 +0000 (+1300) Subject: Merge branch 'mainlining' X-Git-Tag: linux-mainline-patchset-4~11 X-Git-Url: http://aleph1.co.uk/gitweb/?a=commitdiff_plain;ds=sidebyside;h=d223baa0fa5644b48c2626f8d42b05ac45b1daf6;hp=-c;p=yaffs2.git Merge branch 'mainlining' --- d223baa0fa5644b48c2626f8d42b05ac45b1daf6 diff --combined yaffs_bitmap.c index 6be9d26,b254266..7df42cd --- a/yaffs_bitmap.c +++ b/yaffs_bitmap.c @@@ -17,12 -17,12 +17,12 @@@ * Chunk bitmap manipulations */ -static Y_INLINE u8 *yaffs_block_bits(struct yaffs_dev *dev, int blk) +static inline u8 *yaffs_block_bits(struct yaffs_dev *dev, int blk) { if (blk < dev->internal_start_block || blk > dev->internal_end_block) { - T(YAFFS_TRACE_ERROR, - (TSTR("**>> yaffs: BlockBits block %d is not valid" TENDSTR), - blk)); + yaffs_trace(YAFFS_TRACE_ERROR, + "BlockBits block %d is not valid", + blk); YBUG(); } return dev->chunk_bits + @@@ -33,9 -33,9 +33,9 @@@ void yaffs_verify_chunk_bit_id(struct y { if (blk < dev->internal_start_block || blk > dev->internal_end_block || chunk < 0 || chunk >= dev->param.chunks_per_block) { - T(YAFFS_TRACE_ERROR, - (TSTR("**>> yaffs: Chunk Id (%d:%d) invalid" TENDSTR), - blk, chunk)); + yaffs_trace(YAFFS_TRACE_ERROR, + "Chunk Id (%d:%d) invalid", + blk, chunk); YBUG(); } } @@@ -90,15 -90,9 +90,9 @@@ int yaffs_count_chunk_bits(struct yaffs 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; }