From: Akinobu Mita Date: Fri, 7 Mar 2014 15:24:10 +0000 (+0900) Subject: mtd: mtd_oobtest: generate consistent data for verification X-Git-Tag: omap-for-v3.16/fixes-against-rc1~57^2~42 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be54f8f1c76890f4b6163715aed5a3d0a7309dc2;p=pandora-kernel.git 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 Reported-by: Lothar Waßmann Tested-by: Lothar Waßmann Cc: George Cherian Cc: Lothar Waßmann Cc: David Woodhouse Cc: Lee Jones Cc: linux-mtd@lists.infradead.org Signed-off-by: Akinobu Mita Signed-off-by: Brian Norris --- Reading git-diff-tree failed