From: Sebastian Andrzej Siewior Date: Wed, 29 Sep 2010 17:43:50 +0000 (+0200) Subject: mtd: nand: use ALIGN where possible X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=cda320915db00a07e5c4cdfc79806c3b80c0c7f2;p=openwrt%2Fstaging%2Fblogic.git mtd: nand: use ALIGN where possible Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 5fedf4a74f16..a2a4e179a355 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);