Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoy.das@intel.com>
To: Matthew Brost <matthew.brost@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe/query: zero the engine info
Date: Wed, 31 Jan 2024 10:51:27 +0530	[thread overview]
Message-ID: <963e8288-050e-459e-91be-9243991f49a4@intel.com> (raw)
In-Reply-To: <Zbky9x45K5h18tVB@DUT025-TGLU.fm.intel.com>


On 1/30/2024 11:03 PM, Matthew Brost wrote:
> On Tue, Jan 30, 2024 at 04:51:22PM +0100, Nirmoy Das wrote:
>> Use kzalloc like other routines for better consistency.
>>
>> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> Maybe s/zero the engine info/Use kzalloc for drm_xe_query_engines
Better, I will resend.
>
> With that:
> Reviewed-by: Matthew Brost <matthew.brost@intel.com>

Thanks,

Nirmoy

>
>> ---
>>   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
>>

  reply	other threads:[~2024-01-31  5:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30 15:51 [PATCH] drm/xe/query: zero the engine info Nirmoy Das
2024-01-30 17:33 ` Matthew Brost
2024-01-31  5:21   ` Nirmoy Das [this message]
2024-01-30 21:30 ` ✓ CI.Patch_applied: success for " Patchwork
2024-01-30 21:30 ` ✓ CI.checkpatch: " Patchwork
2024-01-30 21:31 ` ✓ CI.KUnit: " Patchwork
2024-01-30 21:38 ` ✓ CI.Build: " Patchwork
2024-01-30 21:39 ` ✓ CI.Hooks: " Patchwork
2024-01-30 21:40 ` ✓ CI.checksparse: " Patchwork
2024-01-30 22:24 ` ✓ CI.BAT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=963e8288-050e-459e-91be-9243991f49a4@intel.com \
    --to=nirmoy.das@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox