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


Groups > linux.kernel > #1718490 > unrolled thread

[PATCH] selftests/timers: make loop consistent with array size

Started byBenjamin Gaignard <benjamin.gaignard@linaro.org>
First post2017-08-23 18:10 +0200
Last post2017-08-25 18:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] selftests/timers: make loop consistent with array size Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-08-23 18:10 +0200
    Re: [PATCH] selftests/timers: make loop consistent with array size Shuah Khan <shuah@kernel.org> - 2017-08-25 18:10 +0200

#1718490 — [PATCH] selftests/timers: make loop consistent with array size

FromBenjamin Gaignard <benjamin.gaignard@linaro.org>
Date2017-08-23 18:10 +0200
Subject[PATCH] selftests/timers: make loop consistent with array size
Message-ID<uhGoa-2JU-25@gated-at.bofh.it>
clocksource_list array is defined as char [10][30] so
to initialise it we only have to iterate 10 times.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
---
 tools/testing/selftests/timers/clocksource-switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/timers/clocksource-switch.c b/tools/testing/selftests/timers/clocksource-switch.c
index 5ff1653..56fbfc1 100644
--- a/tools/testing/selftests/timers/clocksource-switch.c
+++ b/tools/testing/selftests/timers/clocksource-switch.c
@@ -61,7 +61,7 @@ int get_clocksources(char list[][30])
 
 	close(fd);
 
-	for (i = 0; i < 30; i++)
+	for (i = 0; i < 10; i++)
 		list[i][0] = '\0';
 
 	head = buf;
-- 
2.7.4

[toc] | [next] | [standalone]


#1720227

FromShuah Khan <shuah@kernel.org>
Date2017-08-25 18:10 +0200
Message-ID<uiplg-6dJ-23@gated-at.bofh.it>
In reply to#1718490
On 08/23/2017 10:07 AM, Benjamin Gaignard wrote:
> clocksource_list array is defined as char [10][30] so
> to initialise it we only have to iterate 10 times.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> ---
>  tools/testing/selftests/timers/clocksource-switch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/timers/clocksource-switch.c b/tools/testing/selftests/timers/clocksource-switch.c
> index 5ff1653..56fbfc1 100644
> --- a/tools/testing/selftests/timers/clocksource-switch.c
> +++ b/tools/testing/selftests/timers/clocksource-switch.c
> @@ -61,7 +61,7 @@ int get_clocksources(char list[][30])
>  
>  	close(fd);
>  
> -	for (i = 0; i < 30; i++)
> +	for (i = 0; i < 10; i++)
>  		list[i][0] = '\0';
>  
>  	head = buf;
> 

Good catch. Thanks. Applied to linux-kselftest next for 4.14-rc1.

thanks,
-- Shuah

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web