[PATCH -next v2 02/10] mtd: tests: rename sources in order to link a helper object

Akinobu Mita akinobu.mita at gmail.com
Sat Aug 31 20:51:03 EDT 2013


2013/8/31 David Woodhouse <dwmw2 at infradead.org>:
> On Fri, 2013-08-30 at 09:24 -0700, Brian Norris wrote:
>> We actually had the discussion (in multiple threads?) that because a
>> separate module would complicate the process for running the test
>> modules, it is preferable to copy the small helper code into each
>> module. That is, we don't want to do this:
>>
>> insmod mtd_test.ko
>> insmod mtd_<actualtest>.ko dev=X ...
>
> So use modprobe instead :)
>
>> However, this is still fairly trivial, so if you think there are good
>> reasons to provide separate modules, I do not object to separate modules.
>
> Even if you can't use modprobe, once mtd_test.ko is loaded it's going to
> stay loaded and you can just forget about it and do your various tests.
>
> Unless you're actually making changes to the code within mtd_test.ko
> itself, of course. In which case you really *don't* want to have eight
> different copies of it built in to eight different modules. I know that
> making changes to that code is going to be relatively infrequent, but we
> probably shouldn't make it suck *this* much :)

Brian, even if we have a separate mtd_test.ko module and we want to
run a custom mtd test module which may also make some changes within
mtd_test.c, we can just build it as we currently do by adding the
following lines in Makefile.

        obj-$(CONFIG_MTD_TESTS) += mtd_mytest.o
        mtd_mytest-objs := mytest.o mtd_test.o

You need to ignore the warnings like "'mtdtest_write' exported twice",
but you can install a custom test module without the extra step of
inserting another module as far as you don't insert mtd_test.ko.

So I'm going to prepare the patch that makes it a separate module.



More information about the linux-mtd mailing list