[LTP] [PATCH] lib: do_setup(): Check for supported arch first

Petr Vorel pvorel@suse.cz
Tue Apr 29 23:22:53 CEST 2025


Hi Cyril,

> This commit moves the check for supported architecture before the check
> for test function existence. This allows us do ifdef out the run
> function pointer initialization and properly TCONF on unsupported
> platform.

LGTM. Ideally could you also convert some test (as example which others
can follow - like they do for docparse fixes).

Reviewed-by: Petr Vorel <pvorel@suse.cz>

> Example usage:

>  #include "tst_test.h"

>  #ifdef __x86_64__
I would personally did not bother with #ifdef, but it's true it makes resulted
binary smaller (for non-intel arch).

Kind regards,
Petr

>  static void run(void)
>  {
> 	...
>  }
>  #endif

>  struct tst_test test = {
>  #ifdef __x86_64__

> 	.run = run,
>  #endif
> 	.supported_archs = {"x86_64", NULL},
>  }


More information about the ltp mailing list