Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: harness: rename __constructor_order for clarification

Now, __constructor_order is boolean; 1 for forward-order systems,
0 for backward-order systems while parsing __LIST_APPEND().

Change it into a bool variable, and rename it for clarification.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Masahiro Yamada and committed by
Shuah Khan
2c082b62 2a6b6c9a

+4 -6
+4 -6
tools/testing/selftests/kselftest_harness.h
··· 818 818 item->prev = item; \ 819 819 return; \ 820 820 } \ 821 - if (__constructor_order == _CONSTRUCTOR_ORDER_FORWARD) { \ 821 + if (__constructor_order_forward) { \ 822 822 item->next = NULL; \ 823 823 item->prev = head->prev; \ 824 824 item->prev->next = item; \ ··· 882 882 } 883 883 884 884 static struct __fixture_metadata *__fixture_list = &_fixture_global; 885 - static int __constructor_order; 886 - 887 - #define _CONSTRUCTOR_ORDER_FORWARD 1 885 + static bool __constructor_order_forward; 888 886 889 887 static inline void __register_fixture(struct __fixture_metadata *f) 890 888 { ··· 933 935 * list so tests are run in source declaration order. 934 936 * https://gcc.gnu.org/onlinedocs/gccint/Initialization.html 935 937 * However, it seems not all toolchains do this correctly, so use 936 - * __constructor_order to detect which direction is called first 938 + * __constructor_order_foward to detect which direction is called first 937 939 * and adjust list building logic to get things running in the right 938 940 * direction. 939 941 */ ··· 1328 1330 1329 1331 static void __attribute__((constructor)) __constructor_order_first(void) 1330 1332 { 1331 - __constructor_order = _CONSTRUCTOR_ORDER_FORWARD; 1333 + __constructor_order_forward = true; 1332 1334 } 1333 1335 1334 1336 #endif /* __KSELFTEST_HARNESS_H */