[PATCH -next 1/7] mtd: tests: introduce mtd_test module
Akinobu Mita
akinobu.mita at gmail.com
Sun Jul 28 23:15:01 EDT 2013
2013/7/28 Vikram Narayanan <vikram186 at gmail.com>:
> On 28/Jul/2013 10:09 AM, Vikram Narayanan wrote:
>>
>> On 28/Jul/2013 7:51 AM, Akinobu Mita wrote:
>>>
>>> 2013/7/28 Brian Norris <computersforpeace at gmail.com>:
>>>>
>>>> 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>
>>>>
>>>> [* modprobe would solve this problem, but these tests are often
>>>> compiled and run by hand, sometimes on systems without the convenience
>>>> of modprobe ]
>>>>
>>>> We could still accomplish the reduction in (source) code duplication
>>>> by simply including these simple routines in a header, then the code
>>>> would be compiled into each test module. I realize this isn't
>>>> typically the "best" way to share code, but since these are just test
>>>> modules and really don't need to be optimized for code size, I think
>>>> it is worth avoiding the extra step of inserting another module.
>>>
>>>
>>> I understand your concern and I'm going to change this series to move
>>> all these functions into a header file. But I'll wait other opinion
>>> for a while.
>>
>>
>> You can refer this.
>> <http://thread.gmane.org/gmane.linux.drivers.mtd/43932/focus=43941>
>
>
> http://article.gmane.org/gmane.linux.drivers.mtd/43933
Thanks. I noticed that there were a few more places where erase_eraseblock()
could be used in mtd/tests modules. I'll include these in next version
of this patch set.
>> And also Artem's feedback here
>> <http://thread.gmane.org/gmane.linux.drivers.mtd/43932/focus=43941>
>
>
> http://article.gmane.org/gmane.linux.drivers.mtd/44007
I checked all callsites of mtd_erase() in the tree, but there is no places where
we can simply use erase_eraseblock(). If erase_eraseblock() can take
additional arguments (callback and priv), there are only a few places
(in mtdswap.c and ubi/io.c) where we can use it. So I think we don't
need to extend mtdcore.c for now.
More information about the linux-mtd
mailing list