X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=direct%2Fyaffs_hweight.c;h=89d7f842a7b56e29e44265550ed67905c1a5be7a;hb=refs%2Fheads%2Fclean-up;hp=c00517e3bbf398326221d5b6438b67df70200818;hpb=6648cbf52d6695755941ff8607fd7a0cda542e05;p=yaffs2.git diff --git a/direct/yaffs_hweight.c b/direct/yaffs_hweight.c index c00517e..89d7f84 100644 --- a/direct/yaffs_hweight.c +++ b/direct/yaffs_hweight.c @@ -10,10 +10,10 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - - /* These functions have been renamed to hweightxx to match the - * equivaqlent functions in the Linux kernel. - */ + +/* These functions have been renamed to hweightxx to match the + * equivaqlent functions in the Linux kernel. + */ #include "yaffs_hweight.h" @@ -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 hweight8(x & 0xff) + - hweight8((x >> 8) & 0xff) + - hweight8((x >> 16) & 0xff) + - 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]; }