[LTP] [PATCH v2 1/2] lib: Fix kernel module detection on BusyBox

Joerg Vehlow lkml@jv-coder.de
Wed Jan 20 12:22:08 CET 2021


Hi,

On 1/19/2021 8:41 AM, Petr Vorel wrote:
> Hi,
>
>> diff --git a/lib/tst_kernel.c b/lib/tst_kernel.c
> ...
>> -int tst_check_driver(const char *name)
>> +#ifndef __ANDROID__
>> +# define MODULES_DIR "/lib/modules"
>> +#else
>> +# define MODULES_DIR "/system/lib/modules"
>> +#endif
> OK, MODULES_DIR is not needed now as I kept Android skipped (unless somebody
> contributes code or share algorithm for Android).
I don't get this comment. MODULES_DIR is used in both code paths in 
tst_search_driver.
But you don't call it from tst_check_driver only if it is not android.
If tst_search_driver is supposed to be a new public interface, it should 
be added to the header,
otherwise it should be marked static.

Jörg


More information about the ltp mailing list