From: walter harms <wharms@bfs.de>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: john.stultz@linaro.org, tglx@linutronix.de,
shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] selftests/timers: Add missing error code assignment before test
Date: Tue, 09 Aug 2016 10:20:06 +0000 [thread overview]
Message-ID: <57A9AE56.8060706@bfs.de> (raw)
In-Reply-To: <1470737486-5924-1-git-send-email-christophe.jaillet@wanadoo.fr>
The patch looks ok.
but perhaps it is better to replace this with clock_gettime() ?
from the manpage:
"POSIX.1-2008 marks gettimeofday() as obsolete, recommending the
use of clock_gettime(2) instead."
just my 2 cents.
re,
wh
Am 09.08.2016 12:11, schrieb Christophe JAILLET:
> In order to work, the 'err' return value has to be updated otherwise the
> test can never be true.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> tools/testing/selftests/timers/posix_timers.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/timers/posix_timers.c b/tools/testing/selftests/timers/posix_timers.c
> index 5a246a0..15cf56d 100644
> --- a/tools/testing/selftests/timers/posix_timers.c
> +++ b/tools/testing/selftests/timers/posix_timers.c
> @@ -122,7 +122,7 @@ static int check_itimer(int which)
> else if (which = ITIMER_REAL)
> idle_loop();
>
> - gettimeofday(&end, NULL);
> + err = gettimeofday(&end, NULL);
> if (err < 0) {
> perror("Can't call gettimeofday()\n");
> return -1;
> @@ -175,7 +175,7 @@ static int check_timer_create(int which)
>
> user_loop();
>
> - gettimeofday(&end, NULL);
> + err = gettimeofday(&end, NULL);
> if (err < 0) {
> perror("Can't call gettimeofday()\n");
> return -1;
WARNING: multiple messages have this Message-ID (diff)
From: walter harms <wharms@bfs.de>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: john.stultz@linaro.org, tglx@linutronix.de,
shuahkh@osg.samsung.com, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] selftests/timers: Add missing error code assignment before test
Date: Tue, 09 Aug 2016 12:20:06 +0200 [thread overview]
Message-ID: <57A9AE56.8060706@bfs.de> (raw)
In-Reply-To: <1470737486-5924-1-git-send-email-christophe.jaillet@wanadoo.fr>
The patch looks ok.
but perhaps it is better to replace this with clock_gettime() ?
from the manpage:
"POSIX.1-2008 marks gettimeofday() as obsolete, recommending the
use of clock_gettime(2) instead."
just my 2 cents.
re,
wh
Am 09.08.2016 12:11, schrieb Christophe JAILLET:
> In order to work, the 'err' return value has to be updated otherwise the
> test can never be true.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> tools/testing/selftests/timers/posix_timers.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/timers/posix_timers.c b/tools/testing/selftests/timers/posix_timers.c
> index 5a246a0..15cf56d 100644
> --- a/tools/testing/selftests/timers/posix_timers.c
> +++ b/tools/testing/selftests/timers/posix_timers.c
> @@ -122,7 +122,7 @@ static int check_itimer(int which)
> else if (which == ITIMER_REAL)
> idle_loop();
>
> - gettimeofday(&end, NULL);
> + err = gettimeofday(&end, NULL);
> if (err < 0) {
> perror("Can't call gettimeofday()\n");
> return -1;
> @@ -175,7 +175,7 @@ static int check_timer_create(int which)
>
> user_loop();
>
> - gettimeofday(&end, NULL);
> + err = gettimeofday(&end, NULL);
> if (err < 0) {
> perror("Can't call gettimeofday()\n");
> return -1;
next prev parent reply other threads:[~2016-08-09 10:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-09 10:11 [PATCH] selftests/timers: Add missing error code assignment before test Christophe JAILLET
2016-08-09 10:11 ` Christophe JAILLET
2016-08-09 10:20 ` walter harms [this message]
2016-08-09 10:20 ` walter harms
2016-08-17 21:31 ` John Stultz
2016-08-17 21:31 ` John Stultz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57A9AE56.8060706@bfs.de \
--to=wharms@bfs.de \
--cc=christophe.jaillet@wanadoo.fr \
--cc=john.stultz@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuahkh@osg.samsung.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.