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: remove unneeded __constructor_order_last()

__constructor_order_last() is unneeded.

If __constructor_order_last() is not called on backward-order systems,
__constructor_order will remain 0 instead of being set to
_CONSTRUCTOR_ORDER_BACKWARD (= -1).

__LIST_APPEND() will still take the 'else' branch, so there is no
difference in the behavior.

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
2a6b6c9a f0a1ffa6

+1 -28
-6
tools/testing/selftests/drivers/s390x/uvdevice/test_uvdevice.c
··· 257 257 att_inval_addr_test(&self->uvio_attest.meas_addr, _metadata, self); 258 258 } 259 259 260 - static void __attribute__((constructor)) __constructor_order_last(void) 261 - { 262 - if (!__constructor_order) 263 - __constructor_order = _CONSTRUCTOR_ORDER_BACKWARD; 264 - } 265 - 266 260 int main(int argc, char **argv) 267 261 { 268 262 int fd = open(UV_PATH, O_ACCMODE);
-6
tools/testing/selftests/hid/hid_bpf.c
··· 1331 1331 return 0; 1332 1332 } 1333 1333 1334 - static void __attribute__((constructor)) __constructor_order_last(void) 1335 - { 1336 - if (!__constructor_order) 1337 - __constructor_order = _CONSTRUCTOR_ORDER_BACKWARD; 1338 - } 1339 - 1340 1334 int main(int argc, char **argv) 1341 1335 { 1342 1336 /* Use libbpf 1.0 API mode */
+1 -9
tools/testing/selftests/kselftest_harness.h
··· 488 488 * Use once to append a main() to the test file. 489 489 */ 490 490 #define TEST_HARNESS_MAIN \ 491 - static void __attribute__((constructor)) \ 492 - __constructor_order_last(void) \ 493 - { \ 494 - if (!__constructor_order) \ 495 - __constructor_order = _CONSTRUCTOR_ORDER_BACKWARD; \ 496 - } \ 497 491 int main(int argc, char **argv) { \ 498 492 return test_harness_run(argc, argv); \ 499 493 } ··· 885 891 static int __constructor_order; 886 892 887 893 #define _CONSTRUCTOR_ORDER_FORWARD 1 888 - #define _CONSTRUCTOR_ORDER_BACKWARD -1 889 894 890 895 static inline void __register_fixture(struct __fixture_metadata *f) 891 896 { ··· 1330 1337 1331 1338 static void __attribute__((constructor)) __constructor_order_first(void) 1332 1339 { 1333 - if (!__constructor_order) 1334 - __constructor_order = _CONSTRUCTOR_ORDER_FORWARD; 1340 + __constructor_order = _CONSTRUCTOR_ORDER_FORWARD; 1335 1341 } 1336 1342 1337 1343 #endif /* __KSELFTEST_HARNESS_H */
-7
tools/testing/selftests/rtc/rtctest.c
··· 410 410 ASSERT_EQ(new, secs); 411 411 } 412 412 413 - static void __attribute__((constructor)) 414 - __constructor_order_last(void) 415 - { 416 - if (!__constructor_order) 417 - __constructor_order = _CONSTRUCTOR_ORDER_BACKWARD; 418 - } 419 - 420 413 int main(int argc, char **argv) 421 414 { 422 415 switch (argc) {