]> git.baikalelectronics.ru Git - uboot.git/commit
spl: nand: sunxi: fix second case of modulo by zero error
authorMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 28 Feb 2018 19:51:45 +0000 (20:51 +0100)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Tue, 3 Apr 2018 10:10:55 +0000 (12:10 +0200)
commitb59b03fd31293b06bd11d6da8216388c577e0ad4
tree7e25350441ac7648cc159064c15e1cec164d504a
parentbc935c964e418052e7eab36b8d4390e3736b644e
spl: nand: sunxi: fix second case of modulo by zero error

In the nand_read_buffer() step, the seed is calculated by doing a modulo
by conf->nseeds which is always zero when not using the randomizer (most
of SLC NANDs).

This situation turns out to lead to a run time freeze with certain
toolchains.

Derive this seed only when the randomizer is enabled (and conf->nseeds
logically not zero), exactly like what has been done before with an
identical situation, see commit 92f55ab86039 ("nand: sunxi: Fix modulo
by zero error").

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
drivers/mtd/nand/sunxi_nand_spl.c