diff mbox series

[12/12] drm/v3d: Prefer get_user for scalar types

Message ID 20240710134130.17292-13-tursulin@igalia.com (mailing list archive)
State New, archived
Headers show
Series v3d: Perfmon cleanup | expand

Commit Message

Tvrtko Ursulin July 10, 2024, 1:41 p.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>

It makes it just a tiny bit more obvious what is going on.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
---
 drivers/gpu/drm/v3d/v3d_submit.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Maíra Canal July 10, 2024, 5:44 p.m. UTC | #1
On 7/10/24 10:41, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
> 
> It makes it just a tiny bit more obvious what is going on.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>

Reviewed-by: Maíra Canal <mcanal@igalia.com>

Best Regards,
- Maíra

> ---
>   drivers/gpu/drm/v3d/v3d_submit.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/v3d/v3d_submit.c b/drivers/gpu/drm/v3d/v3d_submit.c
> index b0c2a8e9cb06..9273b0aadb79 100644
> --- a/drivers/gpu/drm/v3d/v3d_submit.c
> +++ b/drivers/gpu/drm/v3d/v3d_submit.c
> @@ -486,14 +486,14 @@ v3d_get_cpu_timestamp_query_params(struct drm_file *file_priv,
>   	for (i = 0; i < timestamp.count; i++) {
>   		u32 offset, sync;
>   
> -		if (copy_from_user(&offset, offsets++, sizeof(offset))) {
> +		if (get_user(offset, offsets++)) {
>   			err = -EFAULT;
>   			goto error;
>   		}
>   
>   		qinfo->queries[i].offset = offset;
>   
> -		if (copy_from_user(&sync, syncs++, sizeof(sync))) {
> +		if (get_user(sync, syncs++)) {
>   			err = -EFAULT;
>   			goto error;
>   		}
> @@ -552,7 +552,7 @@ v3d_get_cpu_reset_timestamp_params(struct drm_file *file_priv,
>   
>   		qinfo->queries[i].offset = reset.offset + 8 * i;
>   
> -		if (copy_from_user(&sync, syncs++, sizeof(sync))) {
> +		if (get_user(sync, syncs++)) {
>   			err = -EFAULT;
>   			goto error;
>   		}
> @@ -614,14 +614,14 @@ v3d_get_cpu_copy_query_results_params(struct drm_file *file_priv,
>   	for (i = 0; i < copy.count; i++) {
>   		u32 offset, sync;
>   
> -		if (copy_from_user(&offset, offsets++, sizeof(offset))) {
> +		if (get_user(offset, offsets++)) {
>   			err = -EFAULT;
>   			goto error;
>   		}
>   
>   		qinfo->queries[i].offset = offset;
>   
> -		if (copy_from_user(&sync, syncs++, sizeof(sync))) {
> +		if (get_user(sync, syncs++)) {
>   			err = -EFAULT;
>   			goto error;
>   		}
diff mbox series

Patch

diff --git a/drivers/gpu/drm/v3d/v3d_submit.c b/drivers/gpu/drm/v3d/v3d_submit.c
index b0c2a8e9cb06..9273b0aadb79 100644
--- a/drivers/gpu/drm/v3d/v3d_submit.c
+++ b/drivers/gpu/drm/v3d/v3d_submit.c
@@ -486,14 +486,14 @@  v3d_get_cpu_timestamp_query_params(struct drm_file *file_priv,
 	for (i = 0; i < timestamp.count; i++) {
 		u32 offset, sync;
 
-		if (copy_from_user(&offset, offsets++, sizeof(offset))) {
+		if (get_user(offset, offsets++)) {
 			err = -EFAULT;
 			goto error;
 		}
 
 		qinfo->queries[i].offset = offset;
 
-		if (copy_from_user(&sync, syncs++, sizeof(sync))) {
+		if (get_user(sync, syncs++)) {
 			err = -EFAULT;
 			goto error;
 		}
@@ -552,7 +552,7 @@  v3d_get_cpu_reset_timestamp_params(struct drm_file *file_priv,
 
 		qinfo->queries[i].offset = reset.offset + 8 * i;
 
-		if (copy_from_user(&sync, syncs++, sizeof(sync))) {
+		if (get_user(sync, syncs++)) {
 			err = -EFAULT;
 			goto error;
 		}
@@ -614,14 +614,14 @@  v3d_get_cpu_copy_query_results_params(struct drm_file *file_priv,
 	for (i = 0; i < copy.count; i++) {
 		u32 offset, sync;
 
-		if (copy_from_user(&offset, offsets++, sizeof(offset))) {
+		if (get_user(offset, offsets++)) {
 			err = -EFAULT;
 			goto error;
 		}
 
 		qinfo->queries[i].offset = offset;
 
-		if (copy_from_user(&sync, syncs++, sizeof(sync))) {
+		if (get_user(sync, syncs++)) {
 			err = -EFAULT;
 			goto error;
 		}