lkml.org 
[lkml]   [2010]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 08/29] Staging: yaffs2: yaffs_ecc: Add files
From
On Mon, Nov 1, 2010 at 8:40 PM, Tracey Dent <tdent48227@gmail.com> wrote:
> Adding files to yaffs2 directory.
>
> Signed-off-by: Tracey Dent <tdent48227@gmail.com>
> ---
>  drivers/staging/yaffs2/yaffs_ecc.c |  323 ++++++++++++++++++++++++++++++++++++
>  drivers/staging/yaffs2/yaffs_ecc.h |   44 +++++
>  2 files changed, 367 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/staging/yaffs2/yaffs_ecc.c
>  create mode 100644 drivers/staging/yaffs2/yaffs_ecc.h
>
> +
> +/* 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;
> +}

Looks like bitmap_weight() to me.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-11-01 20:07    [W:0.220 / U:4.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site