lkml.org 
[lkml]   [2010]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH 06/29] Staging: yaffs2: yaffs_bitmap: 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_bitmap.c |  105 +++++++++++++++++++++++++++++++++
    >  drivers/staging/yaffs2/yaffs_bitmap.h |   33 ++++++++++
    >  2 files changed, 138 insertions(+), 0 deletions(-)
    >  create mode 100644 drivers/staging/yaffs2/yaffs_bitmap.c
    >  create mode 100644 drivers/staging/yaffs2/yaffs_bitmap.h
    >
    > diff --git a/drivers/staging/yaffs2/yaffs_bitmap.c b/drivers/staging/yaffs2/yaffs_bitmap.c
    > new file mode 100644
    > index 0000000..85c8c1d
    > --- /dev/null
    > +++ b/drivers/staging/yaffs2/yaffs_bitmap.c
    > @@ -0,0 +1,105 @@
    > +/*
    > + * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
    > + *
    > + * Copyright (C) 2002-2010 Aleph One Ltd.
    > + *   for Toby Churchill Ltd and Brightstar Engineering
    > + *
    > + * Created by Charles Manning <charles@aleph1.co.uk>
    > + *
    > + * This program is free software; you can redistribute it and/or modify
    > + * it under the terms of the GNU General Public License version 2 as
    > + * published by the Free Software Foundation.
    > + */
    > +
    > +#include "yaffs_bitmap.h"
    > +#include "yaffs_trace.h"
    > +/*
    > + * Chunk bitmap manipulations
    > + */
    > +
    > +static Y_INLINE __u8 *yaffs_block_bits(yaffs_dev_t *dev, int blk)
    > +{
    > +       if (blk < dev->internal_start_block || blk > dev->internal_end_block) {
    > +               T(YAFFS_TRACE_ERROR,
    > +                       (TSTR("**>> yaffs: BlockBits block %d is not valid" TENDSTR),
    > +                       blk));
    > +               YBUG();
    > +       }
    > +       return dev->chunk_bits +
    > +               (dev->chunk_bit_stride * (blk - dev->internal_start_block));
    > +}

    We have <linux/bitmap.h>. You should probably use it.
    --
    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:05    [W:0.028 / U:62.160 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site