Messages in this thread | | | Date | Wed, 03 Nov 2010 10:05:13 -0700 | From | David Daney <> | Subject | Re: [PATCH 4/9] Add yaffs ecc, mtd access and nand abstraction code |
| |
On 11/03/2010 09:53 AM, cdhmanning@gmail.com wrote: > From: Charles Manning<cdhmanning@gmail.com> [...] > --- /dev/null > +++ b/fs/yaffs2/yaffs_ecc.c [...] > + > +/* Count the bits in an unsigned char or a U32 */ > + > +static int yaffs_count_bits(unsigned char x) > +{ > + int r = 0; > + while (x) { > + if (x& 1) > + r++; > + x>>= 1; > + } > + return r; > +} > + > +static int yaffs_count_bits32(unsigned x) > +{ > + int r = 0; > + while (x) { > + if (x& 1) > + r++; > + x>>= 1; > + } > + return r; > +} > +
These two can probably be replaced with the standard hweight32() and hweight8().
David Daney
| |