From mboxrd@z Thu Jan 1 00:00:00 1970 From: walter harms Date: Tue, 09 Aug 2016 10:20:06 +0000 Subject: Re: [PATCH] selftests/timers: Add missing error code assignment before test Message-Id: <57A9AE56.8060706@bfs.de> List-Id: References: <1470737486-5924-1-git-send-email-christophe.jaillet@wanadoo.fr> In-Reply-To: <1470737486-5924-1-git-send-email-christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Christophe JAILLET 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 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 > --- > 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; From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752661AbcHIKUM (ORCPT ); Tue, 9 Aug 2016 06:20:12 -0400 Received: from mx01-fr.bfs.de ([193.174.231.67]:35124 "EHLO mx01-fr.bfs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752348AbcHIKUK (ORCPT ); Tue, 9 Aug 2016 06:20:10 -0400 Message-ID: <57A9AE56.8060706@bfs.de> Date: Tue, 09 Aug 2016 12:20:06 +0200 From: walter harms Reply-To: wharms@bfs.de User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11 MIME-Version: 1.0 To: Christophe JAILLET 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 References: <1470737486-5924-1-git-send-email-christophe.jaillet@wanadoo.fr> In-Reply-To: <1470737486-5924-1-git-send-email-christophe.jaillet@wanadoo.fr> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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;