Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: <intel-xe@lists.freedesktop.org>
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>,
	Szymon Morek <szymon.morek@intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>
Subject: [PATCH 3/3] drm/xe/query: Tidy up error EFAULT returns
Date: Wed,  9 Oct 2024 20:48:47 -0700	[thread overview]
Message-ID: <20241010034847.389734-3-lucas.demarchi@intel.com> (raw)
In-Reply-To: <20241010034847.389734-1-lucas.demarchi@intel.com>

Move the error handling together in a single branch since all of them
are doing similar thing and return the same error.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/xe/xe_query.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index d86959076b078..cd2799c0ba510 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -163,16 +163,10 @@ query_engine_cycles(struct xe_device *xe,
 		resp.width = 36;
 
 	/* Only write to the output fields of user query */
-	if (put_user(resp.cpu_timestamp, &query_ptr->cpu_timestamp))
-		return -EFAULT;
-
-	if (put_user(resp.cpu_delta, &query_ptr->cpu_delta))
-		return -EFAULT;
-
-	if (put_user(resp.engine_cycles, &query_ptr->engine_cycles))
-		return -EFAULT;
-
-	if (put_user(resp.width, &query_ptr->width))
+	if (put_user(resp.cpu_timestamp, &query_ptr->cpu_timestamp) ||
+	    put_user(resp.cpu_delta, &query_ptr->cpu_delta) ||
+	    put_user(resp.engine_cycles, &query_ptr->engine_cycles) ||
+	    put_user(resp.width, &query_ptr->width))
 		return -EFAULT;
 
 	return 0;
-- 
2.46.2


  parent reply	other threads:[~2024-10-10  3:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10  3:48 [PATCH 1/3] drm/xe/query: Increase timestamp width Lucas De Marchi
2024-10-10  3:48 ` [PATCH 2/3] drm/xe/query: Move timestamp reg to hwe_read_timestamp() Lucas De Marchi
2024-10-10 10:03   ` Pottumuttu, Sai Teja
2024-10-10 13:24     ` Lucas De Marchi
2024-10-10 13:31       ` Pottumuttu, Sai Teja
2024-10-10  3:48 ` Lucas De Marchi [this message]
2024-10-10  9:39   ` [PATCH 3/3] drm/xe/query: Tidy up error EFAULT returns Pottumuttu, Sai Teja
2024-10-10  3:54 ` ✓ CI.Patch_applied: success for series starting with [1/3] drm/xe/query: Increase timestamp width Patchwork
2024-10-10  3:54 ` ✓ CI.checkpatch: " Patchwork
2024-10-10  3:56 ` ✓ CI.KUnit: " Patchwork
2024-10-10  4:07 ` ✓ CI.Build: " Patchwork
2024-10-10  4:08 ` [PATCH 1/3] " Lucas De Marchi
2024-10-10 17:10   ` Matt Roper
2024-10-10 18:28     ` Lucas De Marchi
2024-10-10 21:34       ` Matt Roper
2024-10-10  4:09 ` ✓ CI.Hooks: success for series starting with [1/3] " Patchwork
2024-10-10  4:11 ` ✓ CI.checksparse: " Patchwork
2024-10-10  4:30 ` ✗ CI.BAT: failure " Patchwork
2024-10-10 17:39 ` ✗ CI.FULL: " Patchwork

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=20241010034847.389734-3-lucas.demarchi@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=szymon.morek@intel.com \
    --cc=umesh.nerlige.ramappa@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