Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/xe/query: Use kzalloc for drm_xe_query_engines
@ 2024-01-31  5:18 Nirmoy Das
  2024-01-31  6:58 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Nirmoy Das @ 2024-01-31  5:18 UTC (permalink / raw)
  To: intel-xe; +Cc: Nirmoy Das

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>
---
 drivers/gpu/drm/xe/xe_query.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index 9b35673b286c..02a4e2c083e4 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -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)) {
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-02-03  6:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-31  5:18 [PATCH v2] drm/xe/query: Use kzalloc for drm_xe_query_engines Nirmoy Das
2024-01-31  6:58 ` ✓ CI.Patch_applied: success for " Patchwork
2024-01-31  6:58 ` ✓ CI.checkpatch: " Patchwork
2024-01-31  6:59 ` ✓ CI.KUnit: " Patchwork
2024-01-31  7:06 ` ✓ CI.Build: " Patchwork
2024-01-31  7:07 ` ✓ CI.Hooks: " Patchwork
2024-01-31  7:08 ` ✓ CI.checksparse: " Patchwork
2024-01-31  7:52 ` ✓ CI.BAT: " Patchwork
2024-02-03  6:47 ` [PATCH v2] " Lucas De Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox