Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Knop, Ryszard" <ryszard.knop@intel.com>
To: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"Hajda, Andrzej" <andrzej.hajda@intel.com>
Cc: "Summers, Stuart" <stuart.summers@intel.com>,
	"Tahvanainen, Jari" <jari.tahvanainen@intel.com>,
	"Grabski, Mateusz" <mateusz.grabski@intel.com>,
	 "kamil.konieczny@linux.intel.com"
	<kamil.konieczny@linux.intel.com>
Subject: Re: [PATCH v3 1/2] lib/igt_core: do not reset errno in igt_gettime
Date: Mon, 11 May 2026 15:05:55 +0000	[thread overview]
Message-ID: <7e1517c71867dd5101dda96a61d4ee8854f6a615.camel@intel.com> (raw)
In-Reply-To: <20260511-add_timestamps_to_logs-v3-1-041130e1f7ef@intel.com>

This function is used quite a lot in tests which also happen to check
for errno later. A quick grep suggests nothing should go wrong though.

Reviewed-by: Ryszard Knop <ryszard.knop@intel.com>

On Mon, 2026-05-11 at 14:55 +0200, Andrzej Hajda wrote:
> Resetting errno before calls makes sense only if we are not able
> to distinguish if following call will fail. This is not the case
> of clock_gettime - it's return value is straightforward, -1 means function
> failed with errno set.
> 
> Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
> ---
>  lib/igt_core.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 4f79c02948ab..5a0ab4361eaa 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -719,7 +719,6 @@ double igt_time_elapsed(struct timespec *then,
>  int igt_gettime(struct timespec *ts)
>  {
>  	memset(ts, 0, sizeof(*ts));
> -	errno = 0;
>  
>  	/* Stay on the same clock for consistency. */
>  	if (igt_clock != (clockid_t)-1) {

  reply	other threads:[~2026-05-11 15:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11 12:55 [PATCH v3 0/2] lib/igt_core: add timestamps to error logs Andrzej Hajda
2026-05-11 12:55 ` [PATCH v3 1/2] lib/igt_core: do not reset errno in igt_gettime Andrzej Hajda
2026-05-11 15:05   ` Knop, Ryszard [this message]
2026-05-11 12:55 ` [PATCH v3 2/2] lib/igt_core: add timestamps to error logs Andrzej Hajda
2026-05-11 14:35   ` Knop, Ryszard
2026-05-12  3:59 ` ✓ i915.CI.BAT: success for lib/igt_core: add timestamps to error logs (rev2) Patchwork
2026-05-12  5:43 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-12 11:20 ` ✓ Xe.CI.FULL: " Patchwork
2026-05-12 17:20 ` ✗ i915.CI.Full: failure " Patchwork
2026-05-12 18:58   ` Hajda, Andrzej

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=7e1517c71867dd5101dda96a61d4ee8854f6a615.camel@intel.com \
    --to=ryszard.knop@intel.com \
    --cc=andrzej.hajda@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jari.tahvanainen@intel.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=mateusz.grabski@intel.com \
    --cc=stuart.summers@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox