WSL2-Linux-Kernel/drivers/mtd/tests
Akinobu Mita be54f8f1c7 mtd: mtd_oobtest: generate consistent data for verification
mtd_oobtest writes OOB, read it back and verify.  The verification is
not correctly done if oobsize is not multiple of 4.  Although the data
to be written and the data to be compared are generated by several
prandom_byte_state() calls starting with the same seed, these two are
generated with the different size and different number of calls.

Due to the implementation of prandom_byte_state() if the size on each
call is not multiple of 4, the resulting data is not always same.

This fixes it by just calling prandom_byte_state() once and using
correct range instead of calling it multiple times for each.

Reported-by: George Cherian <george.cherian@ti.com>
Reported-by: Lothar Waßmann <LW@KARO-electronics.de>
Tested-by: Lothar Waßmann <LW@KARO-electronics.de>
Cc: George Cherian <george.cherian@ti.com>
Cc: Lothar Waßmann <LW@KARO-electronics.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2014-04-17 22:22:03 -07:00
..
Makefile mtd: tests: rename sources in order to link a helper object 2013-08-30 21:34:06 +01:00
mtd_nandecctest.c mtd: tests: mtd_nandecctest: Use IS_ENABLED() macro 2014-01-03 11:22:21 -08:00
mtd_test.c mtd: delete non-required instances of include <linux/init.h> 2014-03-10 22:42:22 -07:00
mtd_test.h mtd: tests: introduce helper functions 2013-08-30 21:28:22 +01:00
nandbiterrs.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00
oobtest.c mtd: mtd_oobtest: generate consistent data for verification 2014-04-17 22:22:03 -07:00
pagetest.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00
readtest.c mtd: tests: incorporate error message for mtdtest_read() 2013-08-30 21:36:05 +01:00
speedtest.c mtd: tests: incorporate error message for mtdtest_write() 2013-08-30 21:36:06 +01:00
stresstest.c mtd: tests: incorporate error message for mtdtest_write() 2013-08-30 21:36:06 +01:00
subpagetest.c mtd: nand: add a helper to detect the nand type 2013-10-27 16:27:06 -07:00
torturetest.c mtd: mtd_torturetest: use mtd_test helpers 2013-08-30 21:34:24 +01:00