Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1660051 > unrolled thread

[PATCH] selftests: kselftest_harness: fix compile warnings

Started byShuah Khan <shuahkh@osg.samsung.com>
First post2017-06-07 20:00 +0200
Last post2017-06-09 17:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] selftests: kselftest_harness: fix compile warnings Shuah Khan <shuahkh@osg.samsung.com> - 2017-06-07 20:00 +0200
    Re: [PATCH] selftests: kselftest_harness: fix compile warnings Shuah Khan <shuah@kernel.org> - 2017-06-09 17:50 +0200

#1660051 — [PATCH] selftests: kselftest_harness: fix compile warnings

FromShuah Khan <shuahkh@osg.samsung.com>
Date2017-06-07 20:00 +0200
Subject[PATCH] selftests: kselftest_harness: fix compile warnings
Message-ID<tPNpo-1jw-11@gated-at.bofh.it>
Fix the following compile warns. checkpatch wants trailing statements
on next line.

gcc -Wl,-no-as-needed -Wall -lpthread seccomp_bpf.c -o
/lkml/linux-kselftest/tools/testing/selftests/seccomp/seccomp_bpf
In file included from seccomp_bpf.c:40:0:
seccomp_bpf.c: In function ‘change_syscall’:
../kselftest_harness.h:558:2: warning: this ‘for’ clause does not
guard... [-Wmisleading-indentation]
  for (; _metadata->trigger;  _metadata->trigger = __bail(_assert))
  ^
../kselftest_harness.h:574:14: note: in expansion of macro
‘OPTIONAL_HANDLER’
 } while (0); OPTIONAL_HANDLER(_assert)
              ^~~~~~~~~~~~~~~~
../kselftest_harness.h:440:2: note: in expansion of macro ‘__EXPECT’
  __EXPECT(expected, seen, ==, 0)
  ^~~~~~~~
seccomp_bpf.c:1313:2: note: in expansion of macro ‘EXPECT_EQ’
  EXPECT_EQ(0, ret);
  ^~~~~~~~~
seccomp_bpf.c:1317:2: note: ...this statement, but the latter is
misleadingly indented as if it is guarded by the ‘for’
  {
  ^
make: Leaving directory
'/lkml/linux-kselftest/tools/testing/selftests/seccomp'

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 tools/testing/selftests/kselftest_harness.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
index c56f72e07cd7..432245faeab3 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -555,7 +555,8 @@
  * return while still providing an optional block to the API consumer.
  */
 #define OPTIONAL_HANDLER(_assert) \
-	for (; _metadata->trigger;  _metadata->trigger = __bail(_assert))
+	for (; _metadata->trigger;  _metadata->trigger = __bail(_assert)) \
+		;
 
 #define __EXPECT(_expected, _seen, _t, _assert) do { \
 	/* Avoid multiple evaluation of the cases */ \
-- 
2.11.0

[toc] | [next] | [standalone]


#1662570

FromShuah Khan <shuah@kernel.org>
Date2017-06-09 17:50 +0200
Message-ID<tQukH-3nk-33@gated-at.bofh.it>
In reply to#1660051
On 06/07/2017 11:57 AM, Shuah Khan wrote:
> Fix the following compile warns. checkpatch wants trailing statements
> on next line.
> 
> gcc -Wl,-no-as-needed -Wall -lpthread seccomp_bpf.c -o
> /lkml/linux-kselftest/tools/testing/selftests/seccomp/seccomp_bpf
> In file included from seccomp_bpf.c:40:0:
> seccomp_bpf.c: In function ‘change_syscall’:
> ../kselftest_harness.h:558:2: warning: this ‘for’ clause does not
> guard... [-Wmisleading-indentation]
>   for (; _metadata->trigger;  _metadata->trigger = __bail(_assert))
>   ^
> ../kselftest_harness.h:574:14: note: in expansion of macro
> ‘OPTIONAL_HANDLER’
>  } while (0); OPTIONAL_HANDLER(_assert)
>               ^~~~~~~~~~~~~~~~
> ../kselftest_harness.h:440:2: note: in expansion of macro ‘__EXPECT’
>   __EXPECT(expected, seen, ==, 0)
>   ^~~~~~~~
> seccomp_bpf.c:1313:2: note: in expansion of macro ‘EXPECT_EQ’
>   EXPECT_EQ(0, ret);
>   ^~~~~~~~~
> seccomp_bpf.c:1317:2: note: ...this statement, but the latter is
> misleadingly indented as if it is guarded by the ‘for’
>   {
>   ^
> make: Leaving directory
> '/lkml/linux-kselftest/tools/testing/selftests/seccomp'
> 
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>

Applied to linux-kselftest next for 4.13-rc1

thanks,
-- Shuah

> ---
>  tools/testing/selftests/kselftest_harness.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
> index c56f72e07cd7..432245faeab3 100644
> --- a/tools/testing/selftests/kselftest_harness.h
> +++ b/tools/testing/selftests/kselftest_harness.h
> @@ -555,7 +555,8 @@
>   * return while still providing an optional block to the API consumer.
>   */
>  #define OPTIONAL_HANDLER(_assert) \
> -	for (; _metadata->trigger;  _metadata->trigger = __bail(_assert))
> +	for (; _metadata->trigger;  _metadata->trigger = __bail(_assert)) \
> +		;
>  
>  #define __EXPECT(_expected, _seen, _t, _assert) do { \
>  	/* Avoid multiple evaluation of the cases */ \
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web