[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTimHpKYMt=UD-rnPk+yZyYUUw2SHs5g1uNr7H-1d@mail.gmail.com>
Date: Mon, 1 Nov 2010 21:04:21 +0200
From: Pekka Enberg <penberg@...nel.org>
To: Tracey Dent <tdent48227@...il.com>
Cc: greg@...ah.com, manningc2@...rix.gen.nz,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 08/29] Staging: yaffs2: yaffs_ecc: Add files
On Mon, Nov 1, 2010 at 8:40 PM, Tracey Dent <tdent48227@...il.com> wrote:
> Adding files to yaffs2 directory.
>
> Signed-off-by: Tracey Dent <tdent48227@...il.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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists