linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH 1/2] kselftests: timers: freq-step: Define ADJ_SETOFFSET if device has older kernel headers
@ 2017-08-14 21:01 John Stultz
  2017-08-14 21:01 ` [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning John Stultz
  0 siblings, 1 reply; 7+ messages in thread
From: John Stultz @ 2017-08-14 21:01 UTC (permalink / raw)
  To: lkml
  Cc: John Stultz, Shuah Khan, Thomas Gleixner, Stephen Boyd,
	Miroslav Lichvar, linux-kselftest

On some systems, the kernel headers haven't been updated to include
ADJ_SETOFFSET, so define it in the test if needed.

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 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/timers/freq-step.c b/tools/testing/selftests/timers/freq-step.c
index 22312eb..f0d1323 100644
--- a/tools/testing/selftests/timers/freq-step.c
+++ b/tools/testing/selftests/timers/freq-step.c
@@ -33,6 +33,10 @@
 #define MAX_FREQ_ERROR 10e-6
 #define MAX_STDDEV 1000e-9
 
+#ifndef ADJ_SETOFFSET
+  #define ADJ_SETOFFSET 0x0100
+#endif
+
 struct sample {
 	double offset;
 	double time;
-- 
2.7.4

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

* [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning
  2017-08-14 21:01 [RFC][PATCH 1/2] kselftests: timers: freq-step: Define ADJ_SETOFFSET if device has older kernel headers John Stultz
@ 2017-08-14 21:01 ` John Stultz
  2017-08-15 12:11   ` Miroslav Lichvar
  0 siblings, 1 reply; 7+ messages in thread
From: John Stultz @ 2017-08-14 21:01 UTC (permalink / raw)
  To: lkml
  Cc: John Stultz, Shuah Khan, Thomas Gleixner, Stephen Boyd,
	Miroslav Lichvar, linux-kselftest

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

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

* Re: [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning
  2017-08-14 21:01 ` [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning John Stultz
@ 2017-08-15 12:11   ` Miroslav Lichvar
  2017-08-16 23:01     ` Shuah Khan
  0 siblings, 1 reply; 7+ messages in thread
From: Miroslav Lichvar @ 2017-08-15 12:11 UTC (permalink / raw)
  To: John Stultz
  Cc: lkml, Shuah Khan, Thomas Gleixner, Stephen Boyd, linux-kselftest

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

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

* Re: [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning
  2017-08-15 12:11   ` Miroslav Lichvar
@ 2017-08-16 23:01     ` Shuah Khan
  2017-08-16 23:10       ` John Stultz
  0 siblings, 1 reply; 7+ messages in thread
From: Shuah Khan @ 2017-08-16 23:01 UTC (permalink / raw)
  To: Miroslav Lichvar, John Stultz
  Cc: lkml, Thomas Gleixner, Stephen Boyd, linux-kselftest, Shuah Khan,
	Shuah Khan

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

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

* Re: [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning
  2017-08-16 23:01     ` Shuah Khan
@ 2017-08-16 23:10       ` John Stultz
  2017-08-17  3:31         ` John Stultz
  0 siblings, 1 reply; 7+ messages in thread
From: John Stultz @ 2017-08-16 23:10 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Miroslav Lichvar, lkml, Thomas Gleixner, Stephen Boyd,
	linux-kselftest, Shuah Khan

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

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

* Re: [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning
  2017-08-16 23:10       ` John Stultz
@ 2017-08-17  3:31         ` John Stultz
  2017-08-17  3:53           ` Shuah Khan
  0 siblings, 1 reply; 7+ messages in thread
From: John Stultz @ 2017-08-17  3:31 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Miroslav Lichvar, lkml, Thomas Gleixner, Stephen Boyd,
	linux-kselftest, Shuah Khan

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

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

* Re: [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning
  2017-08-17  3:31         ` John Stultz
@ 2017-08-17  3:53           ` Shuah Khan
  0 siblings, 0 replies; 7+ messages in thread
From: Shuah Khan @ 2017-08-17  3:53 UTC (permalink / raw)
  To: John Stultz
  Cc: Miroslav Lichvar, lkml, Thomas Gleixner, Stephen Boyd,
	linux-kselftest, Shuah Khan, Shuah Khan

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

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

end of thread, other threads:[~2017-08-17  3:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-14 21:01 [RFC][PATCH 1/2] kselftests: timers: freq-step: Define ADJ_SETOFFSET if device has older kernel headers John Stultz
2017-08-14 21:01 ` [RFC][PATCH 2/2] selftests: timers: freq-step: Fix build warning John Stultz
2017-08-15 12:11   ` Miroslav Lichvar
2017-08-16 23:01     ` Shuah Khan
2017-08-16 23:10       ` John Stultz
2017-08-17  3:31         ` John Stultz
2017-08-17  3:53           ` Shuah Khan

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).