Commit 735be7ac authored by Lucas De Marchi's avatar Lucas De Marchi
Browse files

drm/xe/query: Tidy up error EFAULT returns



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

Reviewed-by: default avatarSai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241011035618.1057602-3-lucas.demarchi@intel.com


Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent 5c84985b
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -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;