Skip to contentSkip to conversation

selftests: clone3: clone3: add case CLONE3_ARGS_NO_TEST

PATCH In review Anders Roxell 2 participants 2 messages Nov 3, 2021 – Nov 4, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests: clone3: clone3: add case CLONE3_ARGS_NO_TEST

Building selftests/clone3 with clang warns about enumeration not handled in switch case:

clone3.c:54:10: warning: enumeration value 'CLONE3_ARGS_NO_TEST' not handled in switch [-Wswitch]

        switch (test_mode) {
                ^

Add the missing switch case with a comment.

Fixes 17a810699c18 ("selftests: add tests for clone3()")
---
 tools/testing/selftests/clone3/clone3.c | 6 ++++++
 1 file changed, 6 insertions(+)
tools/testing/selftests/clone3/clone3.c +6 -0
index ede5da0c67b4..3fd49f419466 100644
@@ -52,6 +52,12 @@ static int call_clone3(uint64_t flags, size_t size, enum test_mode test_mode)
 		size = sizeof(struct __clone_args);
 
 	switch (test_mode) {
+	case CLONE3_ARGS_NO_TEST:
+		/*
+		 * Uses default 'flags' and 'SIGCHLD'
+		 * assignment.
+		 */
+		break;
 	case CLONE3_ARGS_ALL_0:
 		args.flags = 0;
 		args.exit_signal = 0;
Signature · 1 line
2.33.0
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Anders Roxell

Building selftests/clone3 with clang warns about enumeration not handled in switch case:

clone3.c:54:10: warning: enumeration value 'CLONE3_ARGS_NO_TEST' not handled in switch [-Wswitch]

Quoted 8 lines
        switch (test_mode) {
                ^

Add the missing switch case with a comment.

Fixes 17a810699c18 ("selftests: add tests for clone3()")

---

Fine by me. Thanks!