]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: clone3: clone3: add case CLONE3_ARGS_NO_TEST
authorAnders Roxell <anders.roxell@linaro.org>
Wed, 3 Nov 2021 20:13:50 +0000 (21:13 +0100)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 10 Dec 2021 23:46:01 +0000 (16:46 -0700)
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()")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/clone3/clone3.c

index 42be3b9258301e87823edfe7284142fca5d49158..076cf4325f7832e535458ec282951cddb38a7d11 100644 (file)
@@ -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;