drm/xe/query: Use kzalloc for drm_xe_query_engines
authorNirmoy Das <nirmoy.das@intel.com>
Wed, 31 Jan 2024 05:18:38 +0000 (06:18 +0100)
committerLucas De Marchi <lucas.demarchi@intel.com>
Sat, 3 Feb 2024 06:44:55 +0000 (22:44 -0800)
Use kzalloc like other routines for better consistency.

v2: Improve the subject(Matt)

Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240131051838.24705-1-nirmoy.das@intel.com
drivers/gpu/drm/xe/xe_query.c

index 7e924faeeea0b0f8ebc2f7fe89ade231412a3892..4f1ab91dbec5845412bd12364d8b64a53e3a812e 100644 (file)
@@ -198,7 +198,7 @@ static int query_engines(struct xe_device *xe,
                return -EINVAL;
        }
 
-       engines = kmalloc(size, GFP_KERNEL);
+       engines = kzalloc(size, GFP_KERNEL);
        if (!engines)
                return -ENOMEM;
 
@@ -212,14 +212,10 @@ static int query_engines(struct xe_device *xe,
                        engines->engines[i].instance.engine_instance =
                                hwe->logical_instance;
                        engines->engines[i].instance.gt_id = gt->info.id;
-                       engines->engines[i].instance.pad = 0;
-                       memset(engines->engines[i].reserved, 0,
-                              sizeof(engines->engines[i].reserved));
 
                        i++;
                }
 
-       engines->pad = 0;
        engines->num_engines = i;
 
        if (copy_to_user(query_ptr, engines, size)) {