linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests: clone3: clone3: add case CLONE3_ARGS_NO_TEST
@ 2021-11-03 20:13 Anders Roxell
  2021-11-04 13:36 ` Christian Brauner
  0 siblings, 1 reply; 2+ messages in thread
From: Anders Roxell @ 2021-11-03 20:13 UTC (permalink / raw)
  To: christian, shuah
  Cc: nathan, ndesaulniers, linux-kernel, linux-kselftest, llvm, 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]
        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>
---
 tools/testing/selftests/clone3/clone3.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/testing/selftests/clone3/clone3.c b/tools/testing/selftests/clone3/clone3.c
index ede5da0c67b4..3fd49f419466 100644
--- a/tools/testing/selftests/clone3/clone3.c
+++ b/tools/testing/selftests/clone3/clone3.c
@@ -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;
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests: clone3: clone3: add case CLONE3_ARGS_NO_TEST
  2021-11-03 20:13 [PATCH] selftests: clone3: clone3: add case CLONE3_ARGS_NO_TEST Anders Roxell
@ 2021-11-04 13:36 ` Christian Brauner
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2021-11-04 13:36 UTC (permalink / raw)
  To: Anders Roxell
  Cc: christian, shuah, nathan, ndesaulniers, linux-kernel,
	linux-kselftest, llvm

On Wed, Nov 03, 2021 at 09:13:50PM +0100, Anders Roxell wrote:
> 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>
> ---

Fine by me. Thanks!
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-04 13:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 20:13 [PATCH] selftests: clone3: clone3: add case CLONE3_ARGS_NO_TEST Anders Roxell
2021-11-04 13:36 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).