]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mtd: mtd_nandecctest: ensure alignment requirement for bitops
authorAkinobu Mita <akinobu.mita@gmail.com>
Mon, 3 Sep 2012 13:00:01 +0000 (22:00 +0900)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tue, 4 Sep 2012 10:14:13 +0000 (13:14 +0300)
commit44e42b93c6b84934b8e08013ecad02ec283fb638
tree5412f9e438ed47dbc6308fade435fffabe350d99
parent5b51e7059eb2f76764ac37b0b3365ab871872816
mtd: mtd_nandecctest: ensure alignment requirement for bitops

Currently the data blocks which is used to test single bit error
correction is allocated statically and injecting single bit error is
implemented by using __change_bit() which must operate on the memory
aligned to the size of an "unsigned long".  But there is no such
guarantee for statically allocated array.

This fix the issue by allocating the data block dynamically by
kmalloc().  It also allocate the ecc code dynamically instead of
allocating statically on stack.

The reason to allocate the ecc code dynamically is that later change
will add tests which inject bit errors into the ecc code by bitops.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/tests/mtd_nandecctest.c