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


Groups > linux.kernel > #1711457 > unrolled thread

[RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning

Started byJohn Stultz <john.stultz@linaro.org>
First post2017-08-14 23:10 +0200
Last post2017-08-17 06:00 +0200
Articles 6 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning John Stultz <john.stultz@linaro.org> - 2017-08-14 23:10 +0200
    Re: [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning Miroslav Lichvar <mlichvar@redhat.com> - 2017-08-15 14:20 +0200
      Re: [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning Shuah Khan <shuahkh@osg.samsung.com> - 2017-08-17 01:10 +0200
        Re: [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning John Stultz <john.stultz@linaro.org> - 2017-08-17 01:20 +0200
          Re: [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning John Stultz <john.stultz@linaro.org> - 2017-08-17 05:40 +0200
            Re: [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning Shuah Khan <shuahkh@osg.samsung.com> - 2017-08-17 06:00 +0200

#1711457 — [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning

FromJohn Stultz <john.stultz@linaro.org>
Date2017-08-14 23:10 +0200
Subject[RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning
Message-ID<ueuMx-IV-7@gated-at.bofh.it>
Fixes the following build warning:
freq-step.c: In function ‘main’:
freq-step.c:271:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

By returning zero at the end of main.

Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Miroslav Lichvar <mlichvar@redhat.com>
Cc: linux-kselftest@vger.kernel.org
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
 tools/testing/selftests/timers/freq-step.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/timers/freq-step.c b/tools/testing/selftests/timers/freq-step.c
index f0d1323..51fcf7c 100644
--- a/tools/testing/selftests/timers/freq-step.c
+++ b/tools/testing/selftests/timers/freq-step.c
@@ -268,4 +268,6 @@ int main(int argc, char **argv)
 		ksft_exit_fail();
 
 	ksft_exit_pass();
+
+	return 0;
 }
-- 
2.7.4

[toc] | [next] | [standalone]


#1712130

FromMiroslav Lichvar <mlichvar@redhat.com>
Date2017-08-15 14:20 +0200
Message-ID<ueIZc-1d4-7@gated-at.bofh.it>
In reply to#1711457
On Mon, Aug 14, 2017 at 02:01:36PM -0700, John Stultz wrote:
> Fixes the following build warning:
> freq-step.c: In function ‘main’:
> freq-step.c:271:1: warning: control reaches end of non-void function [-Wreturn-type]

> @@ -268,4 +268,6 @@ int main(int argc, char **argv)
>  		ksft_exit_fail();
>  
>  	ksft_exit_pass();
> +
> +	return 0;
>  }

It seems most tests use "return ksft_exit_pass();". Would that be
preferred over separate return? I don't have a preference.

Both patches in this set look good to me.

Thanks,

-- 
Miroslav Lichvar

[toc] | [prev] | [next] | [standalone]


#1713404

FromShuah Khan <shuahkh@osg.samsung.com>
Date2017-08-17 01:10 +0200
Message-ID<uffBL-4VU-3@gated-at.bofh.it>
In reply to#1712130
Hi John,

On 08/15/2017 06:11 AM, Miroslav Lichvar wrote:
> On Mon, Aug 14, 2017 at 02:01:36PM -0700, John Stultz wrote:
>> Fixes the following build warning:
>> freq-step.c: In function ‘main’:
>> freq-step.c:271:1: warning: control reaches end of non-void function [-Wreturn-type]
> 
>> @@ -268,4 +268,6 @@ int main(int argc, char **argv)
>>  		ksft_exit_fail();

This needs to be changes as well to return ksft_exit_fail();
>>  
>>  	ksft_exit_pass();
>> +
>> +	return 0;
>>  }
> 
> It seems most tests use "return ksft_exit_pass();". Would that be
> preferred over separate return? I don't have a preference.

Let's go with "return ksft_exit_pass();" 
> 
> Both patches in this set look good to me.
> 
> Thanks,
> 

thanks,
-- Shuah

[toc] | [prev] | [next] | [standalone]


#1713408

FromJohn Stultz <john.stultz@linaro.org>
Date2017-08-17 01:20 +0200
Message-ID<uffLr-4Z5-7@gated-at.bofh.it>
In reply to#1713404
On Wed, Aug 16, 2017 at 4:01 PM, Shuah Khan <shuahkh@osg.samsung.com> wrote:
> Hi John,
>
> On 08/15/2017 06:11 AM, Miroslav Lichvar wrote:
>> On Mon, Aug 14, 2017 at 02:01:36PM -0700, John Stultz wrote:
>>> Fixes the following build warning:
>>> freq-step.c: In function ‘main’:
>>> freq-step.c:271:1: warning: control reaches end of non-void function [-Wreturn-type]
>>
>>> @@ -268,4 +268,6 @@ int main(int argc, char **argv)
>>>              ksft_exit_fail();
>
> This needs to be changes as well to return ksft_exit_fail();
>>>
>>>      ksft_exit_pass();
>>> +
>>> +    return 0;
>>>  }
>>
>> It seems most tests use "return ksft_exit_pass();". Would that be
>> preferred over separate return? I don't have a preference.
>
> Let's go with "return ksft_exit_pass();"

Thanks for the review, I've made both changes and I'll send these out
shortly with the rest of my 4.14 focused queue.

thanks
-john

[toc] | [prev] | [next] | [standalone]


#1713512

FromJohn Stultz <john.stultz@linaro.org>
Date2017-08-17 05:40 +0200
Message-ID<ufjP4-7vK-29@gated-at.bofh.it>
In reply to#1713408
On Wed, Aug 16, 2017 at 4:10 PM, John Stultz <john.stultz@linaro.org> wrote:
> On Wed, Aug 16, 2017 at 4:01 PM, Shuah Khan <shuahkh@osg.samsung.com> wrote:
>> Hi John,
>>
>> On 08/15/2017 06:11 AM, Miroslav Lichvar wrote:
>>> On Mon, Aug 14, 2017 at 02:01:36PM -0700, John Stultz wrote:
>>>> Fixes the following build warning:
>>>> freq-step.c: In function ‘main’:
>>>> freq-step.c:271:1: warning: control reaches end of non-void function [-Wreturn-type]
>>>
>>>> @@ -268,4 +268,6 @@ int main(int argc, char **argv)
>>>>              ksft_exit_fail();
>>
>> This needs to be changes as well to return ksft_exit_fail();
>>>>
>>>>      ksft_exit_pass();
>>>> +
>>>> +    return 0;
>>>>  }
>>>
>>> It seems most tests use "return ksft_exit_pass();". Would that be
>>> preferred over separate return? I don't have a preference.
>>
>> Let's go with "return ksft_exit_pass();"
>
> Thanks for the review, I've made both changes and I'll send these out
> shortly with the rest of my 4.14 focused queue.

Shuah,
  One more question here. I'm noticing that running "make
run_destructive_tests" in the timers dir, the freq-step test returns
ksft_exit_skip, which results in the test returning an exit code of 4,
which causes make to think it failed, halting the testing.

I'm guessing there is some extra logic for how to properly run
extended tests such that the various error codes are handled and a
skip doesn't result in the test stopping?

Any suggestions/pointers?

thanks
-john

[toc] | [prev] | [next] | [standalone]


#1713522

FromShuah Khan <shuahkh@osg.samsung.com>
Date2017-08-17 06:00 +0200
Message-ID<ufk8p-7C3-5@gated-at.bofh.it>
In reply to#1713512
On 08/16/2017 09:31 PM, John Stultz wrote:
> On Wed, Aug 16, 2017 at 4:10 PM, John Stultz <john.stultz@linaro.org> wrote:
>> On Wed, Aug 16, 2017 at 4:01 PM, Shuah Khan <shuahkh@osg.samsung.com> wrote:
>>> Hi John,
>>>
>>> On 08/15/2017 06:11 AM, Miroslav Lichvar wrote:
>>>> On Mon, Aug 14, 2017 at 02:01:36PM -0700, John Stultz wrote:
>>>>> Fixes the following build warning:
>>>>> freq-step.c: In function ‘main’:
>>>>> freq-step.c:271:1: warning: control reaches end of non-void function [-Wreturn-type]
>>>>
>>>>> @@ -268,4 +268,6 @@ int main(int argc, char **argv)
>>>>>              ksft_exit_fail();
>>>
>>> This needs to be changes as well to return ksft_exit_fail();
>>>>>
>>>>>      ksft_exit_pass();
>>>>> +
>>>>> +    return 0;
>>>>>  }
>>>>
>>>> It seems most tests use "return ksft_exit_pass();". Would that be
>>>> preferred over separate return? I don't have a preference.
>>>
>>> Let's go with "return ksft_exit_pass();"
>>
>> Thanks for the review, I've made both changes and I'll send these out
>> shortly with the rest of my 4.14 focused queue.
> 
> Shuah,
>   One more question here. I'm noticing that running "make
> run_destructive_tests" in the timers dir, the freq-step test returns
> ksft_exit_skip, which results in the test returning an exit code of 4,
> which causes make to think it failed, halting the testing.

I think exit code 4 might not be good option. It could be tripping the
make target rules.

> 
> I'm guessing there is some extra logic for how to properly run
> extended tests such that the various error codes are handled and a
> skip doesn't result in the test stopping?
> 
> Any suggestions/pointers?
> 

Skip is really a case of not being able to run the test and it might not
be necessary to differentiate SKIP vs. PASS. I think we can just get rid 
of EXIT_SKIP and use EXIT_PASS. I would rather do that than adding handling
for exit code 4.

I can get that change in for 4.14-rc1 if this can wait or I will try to get
that into 4.13-rc7 possibly.

Also just FYI - I am going to send out patch series for timers test conversion
to TAP13 tomorrow.

thanks,
-- Shuah

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web