[PATCH -next 1/7] mtd: tests: introduce mtd_test module
Akinobu Mita
akinobu.mita at gmail.com
Sat Aug 3 03:55:43 EDT 2013
2013/8/2 Artem Bityutskiy <dedekind1 at gmail.com>:
> On Sat, 2013-07-27 at 12:27 -0700, Brian Norris wrote:
>> > These functions will be used for reducing code duplication among
>> > mtd/tests modules later.
>>
>> I like this idea. There is definitely too much code duplication.
>>
>> However, there is an important tradeoff here: now to run these (very
>> simple) tests, we have a two-step process*:
>>
>> insmod mtd_test.ko
>> insmod mtd_<actualtest>.ko dev=<MTD>
>
> The helpers do not have to be in a separate module. Here is a short
> patch demonstrating how we could put all the helpers to a single .c file
> and then just link it to the tests.
>
> It renames mtd_oobtest.c to oobtest.c, and this part of the patch is
> omitted. Do it by hand if you want to try this patch:
>
> $ mv drivers/mtd/tests/mtd_oobtest.c drivers/mtd/tests/oobtest.c
>
> Note, I do realize that the code will actually be copied to every test
> module, but I think it is fine for our small test infrastructure.
I took this idea. I have finished rewriting this patch series and
testing with nandsim using badblocks module parameter. I'll send
next version later on.
More information about the linux-mtd
mailing list