Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751797AbdFIPmv (ORCPT ); Fri, 9 Jun 2017 11:42:51 -0400 Received: from resqmta-po-01v.sys.comcast.net ([96.114.154.160]:52514 "EHLO resqmta-po-01v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751534AbdFIPmu (ORCPT ); Fri, 9 Jun 2017 11:42:50 -0400 Reply-To: shuah@kernel.org Subject: Re: [PATCH] selftests: kselftest_harness: fix compile warnings To: Shuah Khan , keescook@chromium.org, luto@amacapital.net, wad@chromium.org Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan , Shuah Khan References: <20170607175731.18147-1-shuahkh@osg.samsung.com> From: Shuah Khan Message-ID: <045e092f-f912-967d-0ba4-d0a9f3a89919@kernel.org> Date: Fri, 9 Jun 2017 09:42:48 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170607175731.18147-1-shuahkh@osg.samsung.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfHQrloA3YoM6YzUDt31/hddZ48EC/g4QqP45sVmXP9E3Sk7GAhRWfBveRp9fOuXxZe0caIX5+Xa4CAVC+0nKPo5rtuWOgCQNwMMHvYItQiIrzHl/yPQP qYPPmwOITroGde0Uxk3iT6uEtDJsYwY4zWx0U3rhYeuFwcGfS1agtIYjEAgXi/NMvGzN43NyUHGpyAGSpKK7/C/XW56BEQe5jn0C2/eepVG1Ikqc7ce0PTPi jdvXvF4LLbB8QxATavF6jXpjad47CoumAUG5xPu3KItl4E250SJ0NlVWy3PU524O9InVn2O9daoCuiIv4QCqMxNT7LYH2WZrOebhbkZwgV54Nz8A6PSdjtVo xsp+vdYsBed3QFS7OGGXkXkCe/Ol6A== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2047 Lines: 55 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 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 */ \ >