[PATCH v3 3/3] mtd: block2mtd: Removes PAGE_MASK as a index to partition size

From: Rodrigo Freire
Date: Sun Nov 09 2014 - 07:23:52 EST


From: Felix Fietkau <nbd@xxxxxxxxxxx>

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 <nbd@xxxxxxxxxxx>
Signed-off-by: Rodrigo Freire <rfreire@xxxxxxxxxx>
Signed-off-by: Herton Krzesinski <herton@xxxxxxxxxx>
---
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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/