lib: use braces instead of NULL for struct arrary ending
PATCH 1/1 lib: use braces instead of NULL for struct arrary ending
Reported-by Yang Xu <[email protected]>
Signed-off-by Li Wang <[email protected]>
--- doc/c-test-api.txt | 2 +- include/tst_test.h | 6 +++--- lib/newlib_tests/test19.c | 2 +- lib/newlib_tests/test20.c | 2 +- testcases/cve/icmp_rate_limit01.c | 2 +- testcases/kernel/containers/userns/userns08.c | 2 +- testcases/kernel/mem/ksm/ksm01.c | 2 +- testcases/kernel/mem/ksm/ksm02.c | 2 +- testcases/kernel/mem/ksm/ksm03.c | 2 +- testcases/kernel/mem/ksm/ksm04.c | 2 +- testcases/kernel/mem/ksm/ksm05.c | 2 +- testcases/kernel/mem/ksm/ksm06.c | 2 +- testcases/kernel/syscalls/add_key/add_key05.c | 2 +- testcases/kernel/syscalls/bind/bind06.c | 2 +- testcases/kernel/syscalls/madvise/madvise08.c | 2 +- testcases/kernel/syscalls/migrate_pages/migrate_pages02.c | 2 +- testcases/kernel/syscalls/sendto/sendto03.c | 2 +- testcases/kernel/syscalls/setsockopt/setsockopt05.c | 2 +- testcases/kernel/syscalls/setsockopt/setsockopt06.c | 2 +- testcases/kernel/syscalls/setsockopt/setsockopt07.c | 2 +- testcases/kernel/syscalls/setsockopt/setsockopt08.c | 2 +- testcases/kernel/syscalls/setsockopt/setsockopt09.c | 2 +- 22 files changed, 24 insertions(+), 24 deletions(-)
doc/c-test-api.txt +1 -1
@@ -1582,7 +1582,7 @@ Pathnames can be optionally prefixed to specify how strictly (during ------------------------------------------------------------------------------- static const struct tst_path_val save_restore[] = { {"/proc/sys/kernel/core_pattern", NULL}, - NULL, + {} }; static void setup(void)
include/tst_test.h +3 -3
@@ -256,7 +256,7 @@ struct tst_test {const char *const *needs_drivers;/* -* NULL terminated array of (/proc, /sys) files to save +* {NULL, NULL} terminated array of (/proc, /sys) files to save * before setup and restore after cleanup */ const struct tst_path_val *save_restore;
@@ -268,12 +268,12 @@ struct tst_test {const char *const *needs_kconfigs;/* -* NULL-terminated array to be allocated buffers. +* {NULL, NULL} terminated array to be allocated buffers. */ struct tst_buffers *bufs;/* -* NULL-terminated array of capability settings +* {NULL, NULL} terminated array of capability settings */ struct tst_cap *caps;
lib/newlib_tests/test19.c +1 -1
@@ -27,6 +27,6 @@ static struct tst_test test = { {"?/proc/nonexistent", NULL}, {"!/proc/sys/kernel/numa_balancing", NULL}, {"/proc/sys/kernel/core_pattern", NULL}, - NULL, + {} }, };
lib/newlib_tests/test20.c +1 -1
@@ -38,6 +38,6 @@ static struct tst_test test = { .request_hugepages = 2, .save_restore = (const struct tst_path_val []) { {"!/proc/sys/kernel/numa_balancing" ,"0" }, -NULL , + {} }, };
testcases/cve/icmp_rate_limit01.c +1 -1
@@ -270,7 +270,7 @@ static struct tst_test test = { }, .save_restore = (const struct tst_path_val[]) { {"?/proc/sys/user/max_user_namespaces" ,NULL }, -NULL , + {} }, .tags = (const struct tst_tag []) { {"linux-git" ,"b38e7819cae9" },
testcases/kernel/containers/userns/userns08.c +1 -1
@@ -136,7 +136,7 @@ static struct tst_test test = { }, .save_restore = (const struct tst_path_val[]) { {"?/proc/sys/user/max_user_namespaces" ,NULL }, -NULL , + {} }, .tags = (const struct tst_tag []) { {"linux-git" ,"d2f007dbe7e4" },
testcases/kernel/mem/ksm/ksm01.c +1 -1
@@ -84,7 +84,7 @@ static struct tst_test test = { {"!/sys/kernel/mm/ksm/sleep_millisecs", NULL}, {"?/sys/kernel/mm/ksm/max_page_sharing", NULL}, {"?/sys/kernel/mm/ksm/merge_across_nodes", "1"}, - NULL, + {} }, .needs_kconfigs = (const char *const[]){ "CONFIG_KSM=y",
testcases/kernel/mem/ksm/ksm02.c +1 -1
@@ -102,7 +102,7 @@ static struct tst_test test = { {"!/sys/kernel/mm/ksm/sleep_millisecs", NULL}, {"?/sys/kernel/mm/ksm/max_page_sharing", NULL}, {"?/sys/kernel/mm/ksm/merge_across_nodes", "1"}, - NULL, + {} }, .needs_kconfigs = (const char *const[]){ "CONFIG_KSM=y",
testcases/kernel/mem/ksm/ksm03.c +1 -1
@@ -87,7 +87,7 @@ static struct tst_test test = { {"!/sys/kernel/mm/ksm/sleep_millisecs", NULL}, {"?/sys/kernel/mm/ksm/max_page_sharing", NULL}, {"?/sys/kernel/mm/ksm/merge_across_nodes", "1"}, - NULL, + {} }, .needs_kconfigs = (const char *const[]){ "CONFIG_KSM=y",
testcases/kernel/mem/ksm/ksm04.c +1 -1
@@ -104,7 +104,7 @@ static struct tst_test test = { {"!/sys/kernel/mm/ksm/sleep_millisecs", NULL}, {"?/sys/kernel/mm/ksm/max_page_sharing", NULL}, {"?/sys/kernel/mm/ksm/merge_across_nodes", "1"}, - NULL, + {} }, .needs_kconfigs = (const char *const[]){ "CONFIG_KSM=y",
testcases/kernel/mem/ksm/ksm05.c +1 -1
@@ -90,7 +90,7 @@ static struct tst_test test = { .min_kver = "2.6.32", .save_restore = (const struct tst_path_val []) { {"!/sys/kernel/mm/ksm/run" ,"1" }, -NULL , + {} }, .needs_kconfigs = (const char *const []){"CONFIG_KSM=y" ,
testcases/kernel/mem/ksm/ksm06.c +1 -1
@@ -141,7 +141,7 @@ static struct tst_test test = { {"!/sys/kernel/mm/ksm/run", NULL}, {"!/sys/kernel/mm/ksm/sleep_millisecs", NULL}, {"/sys/kernel/mm/ksm/merge_across_nodes", NULL}, - NULL, + {} }, .needs_kconfigs = (const char *const[]){ "CONFIG_KSM=y",
testcases/kernel/syscalls/add_key/add_key05.c +1 -1
@@ -218,7 +218,7 @@ static struct tst_test test = { {"?/proc/sys/kernel/keys/gc_delay", "1"}, {"?/proc/sys/kernel/keys/maxkeys", "200"}, {"?/proc/sys/kernel/keys/maxbytes", "20000"}, - NULL, + {} }, .bufs = (struct tst_buffers []) { {&user_buf, .size = 64},
testcases/kernel/syscalls/bind/bind06.c +1 -1
@@ -111,7 +111,7 @@ static struct tst_test test = { }, .save_restore = (const struct tst_path_val[]) { {"?/proc/sys/user/max_user_namespaces" ,NULL }, -NULL , + {} }, .tags = (const struct tst_tag []) { {"linux-git" ,"15fe076edea7" },
testcases/kernel/syscalls/madvise/madvise08.c +1 -1
@@ -215,6 +215,6 @@ static struct tst_test test = { .forks_child = 1, .save_restore = (const struct tst_path_val []) { {CORE_PATTERN ,NULL }, -NULL , + {} }, };
testcases/kernel/syscalls/migrate_pages/migrate_pages02.c +1 -1
@@ -328,7 +328,7 @@ static struct tst_test test = { .setup = setup, .save_restore = (const struct tst_path_val []) { {"?/proc/sys/kernel/numa_balancing" ,"0" }, -NULL , + {} }, };#else
testcases/kernel/syscalls/sendto/sendto03.c +1 -1
@@ -219,7 +219,7 @@ static struct tst_test test = { }, .save_restore = (const struct tst_path_val[]) { {"?/proc/sys/user/max_user_namespaces" ,NULL }, -NULL , + {} }, .tags = (const struct tst_tag []) { {"linux-git" ,"bcc5364bdcfe" },
testcases/kernel/syscalls/setsockopt/setsockopt05.c +1 -1
@@ -103,7 +103,7 @@ static struct tst_test test = { }, .save_restore = (const struct tst_path_val[]) { {"?/proc/sys/user/max_user_namespaces" ,NULL }, -NULL , + {} }, .tags = (const struct tst_tag []) { {"linux-git" ,"85f1bd9a7b5a" },
testcases/kernel/syscalls/setsockopt/setsockopt06.c +1 -1
@@ -131,7 +131,7 @@ static struct tst_test test = { }, .save_restore = (const struct tst_path_val[]) { {"?/proc/sys/user/max_user_namespaces" ,NULL }, -NULL , + {} }, .tags = (const struct tst_tag []) { {"linux-git" ,"84ac7260236a" },
testcases/kernel/syscalls/setsockopt/setsockopt07.c +1 -1
@@ -143,7 +143,7 @@ static struct tst_test test = { }, .save_restore = (const struct tst_path_val[]) { {"?/proc/sys/user/max_user_namespaces" ,NULL }, -NULL , + {} }, .tags = (const struct tst_tag []) { {"linux-git" ,"c27927e372f0" },
testcases/kernel/syscalls/setsockopt/setsockopt08.c +1 -1
@@ -160,7 +160,7 @@ static struct tst_test test = { }, .save_restore = (const struct tst_path_val[]) { {"?/proc/sys/user/max_user_namespaces" ,NULL }, -NULL , + {} }, .tags = (const struct tst_tag []) { {"linux-git" ,"b29c457a6511" },
testcases/kernel/syscalls/setsockopt/setsockopt09.c +1 -1
@@ -107,7 +107,7 @@ static struct tst_test test = { }, .save_restore = (const struct tst_path_val[]) { {"?/proc/sys/user/max_user_namespaces" ,NULL }, -NULL , + {} }, .tags = (const struct tst_tag []) { {"linux-git" ,"ec6af094ea28" },
Signature · 5 lines
2.31.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Li
Looks good to me,
Reviewed-by Yang Xu <[email protected]>
Best Regards
Yang Xu
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Li Wang
AppliedQuoted 5 lines · On Thu, Mar 10, 2022 at 6:09 PM [email protected] <…
Hi Li
Looks good to me,
Reviewed-by Yang Xu <[email protected]>
Merged, thanks!
Signature · 2 lines
Regards, Li Wang
Signature · 2 lines
-- Mailing list info: https://lists.linux.it/listinfo/ltp