Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: nand: sunxi: use mtd_div_by_ws() helper

Suggested-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

+1 -1
+1 -1
drivers/mtd/nand/sunxi_nand.c
··· 624 624 static u16 sunxi_nfc_randomizer_state(struct mtd_info *mtd, int page, bool ecc) 625 625 { 626 626 const u16 *seeds = sunxi_nfc_randomizer_page_seeds; 627 - int mod = mtd->erasesize / mtd->writesize; 627 + int mod = mtd_div_by_ws(mtd->erasesize, mtd); 628 628 629 629 if (mod > ARRAY_SIZE(sunxi_nfc_randomizer_page_seeds)) 630 630 mod = ARRAY_SIZE(sunxi_nfc_randomizer_page_seeds);