From: Felix Fietkau <n...@openwrt.org>

mtd: block2mtd: Removes PAGE_MASK as a index to partition size

PAGE_MASK is no longer needed with the new term.
This patch keeps the device size aligned with the erase_size.

Signed-off-by: Felix Fietkau <n...@openwrt.org>
Signed-off-by: Rodrigo Freire <rfre...@redhat.com>
Signed-off-by: Herton Krzesinski <her...@redhat.com>
---
V3: Separated on a single patch
--- a/drivers/mtd/devices/block2mtd.c   2014-11-07 17:40:58.688747820 -0200
+++ b/drivers/mtd/devices/block2mtd.c   2014-11-07 17:41:28.054750893 -0200
@@ -291,8 +291,7 @@ static struct block2mtd_dev *add_device(
                goto err_destroy_mutex;
 
        dev->mtd.name = name;
-
-       dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;
+       dev->mtd.size = dev->blkdev->bd_inode->i_size & ~(erase_size - 1);
        dev->mtd.erasesize = erase_size;
        dev->mtd.writesize = 1;
        dev->mtd.writebufsize = PAGE_SIZE;
---
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to