Skip to content

Commit 735be7a

Browse files
committed
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: Sai Teja Pottumuttu <[email protected]> Reviewed-by: Matt Roper <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 5c84985 commit 735be7a

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

drivers/gpu/drm/xe/xe_query.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,10 @@ query_engine_cycles(struct xe_device *xe,
163163
resp.width = 36;
164164

165165
/* Only write to the output fields of user query */
166-
if (put_user(resp.cpu_timestamp, &query_ptr->cpu_timestamp))
167-
return -EFAULT;
168-
169-
if (put_user(resp.cpu_delta, &query_ptr->cpu_delta))
170-
return -EFAULT;
171-
172-
if (put_user(resp.engine_cycles, &query_ptr->engine_cycles))
173-
return -EFAULT;
174-
175-
if (put_user(resp.width, &query_ptr->width))
166+
if (put_user(resp.cpu_timestamp, &query_ptr->cpu_timestamp) ||
167+
put_user(resp.cpu_delta, &query_ptr->cpu_delta) ||
168+
put_user(resp.engine_cycles, &query_ptr->engine_cycles) ||
169+
put_user(resp.width, &query_ptr->width))
176170
return -EFAULT;
177171

178172
return 0;

0 commit comments

Comments
 (0)