[1/5] mtd/nand: use ALIGN where possible

Submitted by Sebastian Siewior on Sept. 29, 2010, 5:43 p.m.

Details

Message ID 1285782234-32509-2-git-send-email-bigeasy@linutronix.de
State Accepted
Commit cda320915db00a07e5c4cdfc79806c3b80c0c7f2
Headers show

Commit Message

Sebastian Siewior Sept. 29, 2010, 5:43 p.m.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/mtd/nand/nand_bbt.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index 5fedf4a..a2a4e17 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -737,8 +737,7 @@  static int write_bbt(struct mtd_info *mtd, uint8_t *buf,
 			/* Calc length */
 			len = (size_t) (numblocks >> sft);
 			/* Make it page aligned ! */
-			len = (len + (mtd->writesize - 1)) &
-				~(mtd->writesize - 1);
+			len = ALIGN(len, mtd->writesize);
 			/* Preset the buffer with 0xff */
 			memset(buf, 0xff, len +
 			       (len >> this->page_shift)* mtd->oobsize);