Commit:     4226b510371efd9cdc628663527d36aee36054a9
Parent:     340ea370c2ce89d1c15fbf785460f2f74314ce58
Author:     Andre Renaud <[EMAIL PROTECTED]>
AuthorDate: Tue Apr 17 13:50:59 2007 -0400
Committer:  David Woodhouse <[EMAIL PROTECTED]>
CommitDate: Tue Apr 17 13:50:59 2007 -0400

    [MTD] [NAND] Casting bug in nand_default_block_markbad
    There is a slight bug in nand_default_block_markbad, where the offset is
    cast to an integer, prior to being shifted. This means that on large
    offsets, it is incorrectly doing a signed shift & losing bits. Fixed
    this by doing the cast after the shift (as is done elsewhere in the code).
    Signed-off-by: Andre Renaud <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
    Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
 drivers/mtd/nand/nand_base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 5b96f1c..ab3b2d1 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -350,7 +350,7 @@ static int nand_default_block_markbad(struct mtd_info *mtd, 
loff_t ofs)
        int block, ret;
        /* Get block number */
-       block = ((int)ofs) >> chip->bbt_erase_shift;
+       block = (int)(ofs >> chip->bbt_erase_shift);
        if (chip->bbt)
                chip->bbt[block >> 2] |= 0x01 << ((block & 0x03) << 1);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to