X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Fyaffs_hweight.c;h=89d7f842a7b56e29e44265550ed67905c1a5be7a;hp=7e2c250a598138d59a904af52d94c0d02c61fa51;hb=8151c9a6c035743c7d12229eaab73e6f5adb9c39;hpb=b295567b94e6d4014938e42e978306a13b330bb3 diff --git a/direct/yaffs_hweight.c b/direct/yaffs_hweight.c index 7e2c250..89d7f84 100644 --- a/direct/yaffs_hweight.c +++ b/direct/yaffs_hweight.c @@ -38,16 +38,15 @@ static const char yaffs_count_bits_table[256] = { int yaffs_hweight8(u8 x) { - int ret_val; - ret_val = yaffs_count_bits_table[x]; - return ret_val; + return yaffs_count_bits_table[x]; } int yaffs_hweight32(u32 x) { - return yaffs_hweight8(x & 0xff) + - yaffs_hweight8((x >> 8) & 0xff) + - yaffs_hweight8((x >> 16) & 0xff) + - yaffs_hweight8((x >> 24) & 0xff); + return + yaffs_count_bits_table[x & 0xff] + + yaffs_count_bits_table[(x>>8) & 0xff] + + yaffs_count_bits_table[(x>>16) & 0xff] + + yaffs_count_bits_table[(x>>24) & 0xff]; }