]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/v3d: Prefer get_user for scalar types
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Thu, 11 Jul 2024 13:53:39 +0000 (14:53 +0100)
committerMaíra Canal <mcanal@igalia.com>
Sat, 13 Jul 2024 14:00:32 +0000 (11:00 -0300)
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>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240711135340.84617-11-tursulin@igalia.com
drivers/gpu/drm/v3d/v3d_submit.c

index d1060e60aafaddb01b2322c511465517ee3f4b68..b282d12571b54edbfd345c295cfe4f000d6a7bb2 100644 (file)
@@ -485,14 +485,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;
                }
 
                job->timestamp_query.queries[i].offset = offset;
 
-               if (copy_from_user(&sync, syncs++, sizeof(sync))) {
+               if (get_user(sync, syncs++)) {
                        err = -EFAULT;
                        goto error;
                }
@@ -550,7 +550,7 @@ v3d_get_cpu_reset_timestamp_params(struct drm_file *file_priv,
 
                job->timestamp_query.queries[i].offset = reset.offset + 8 * i;
 
-               if (copy_from_user(&sync, syncs++, sizeof(sync))) {
+               if (get_user(sync, syncs++)) {
                        err = -EFAULT;
                        goto error;
                }
@@ -611,14 +611,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;
                }
 
                job->timestamp_query.queries[i].offset = offset;
 
-               if (copy_from_user(&sync, syncs++, sizeof(sync))) {
+               if (get_user(sync, syncs++)) {
                        err = -EFAULT;
                        goto error;
                }