From: Matthew Brost <matthew.brost@intel.com>
To: Nirmoy Das <nirmoy.das@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe/query: zero the engine info
Date: Tue, 30 Jan 2024 17:33:43 +0000 [thread overview]
Message-ID: <Zbky9x45K5h18tVB@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20240130155122.12138-1-nirmoy.das@intel.com>
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
With that:
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
>
next prev parent reply other threads:[~2024-01-30 17:34 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 [this message]
2024-01-31 5:21 ` Nirmoy Das
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=Zbky9x45K5h18tVB@DUT025-TGLU.fm.intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=nirmoy.das@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