From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Francois Dugast <francois.dugast@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH] drm/xe: Rely on kmalloc/kzalloc log message
Date: Wed, 19 Jul 2023 11:32:27 -0400 [thread overview]
Message-ID: <ZLgCCzIvSAaLo+GH@intel.com> (raw)
In-Reply-To: <20230719132059.7-1-francois.dugast@intel.com>
On Wed, Jul 19, 2023 at 01:20:59PM +0000, Francois Dugast wrote:
> Those messages are unnecessary because a generic message is already
> produced in case of allocation failure. Besides, this also removes a
> misuse of the XE_IOCTL_DBG macro.
this could be 2 separated patches, but anyway:
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> Signed-off-by: Francois Dugast <francois.dugast@intel.com>
> ---
> drivers/gpu/drm/xe/xe_gt_debugfs.c | 1 -
> drivers/gpu/drm/xe/xe_guc_debugfs.c | 1 -
> drivers/gpu/drm/xe/xe_huc_debugfs.c | 1 -
> drivers/gpu/drm/xe/xe_query.c | 8 ++++----
> 4 files changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_debugfs.c b/drivers/gpu/drm/xe/xe_gt_debugfs.c
> index f9f653243f20..30a031356b4e 100644
> --- a/drivers/gpu/drm/xe/xe_gt_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_gt_debugfs.c
> @@ -174,7 +174,6 @@ void xe_gt_debugfs_register(struct xe_gt *gt)
> #define DEBUGFS_SIZE (ARRAY_SIZE(debugfs_list) * sizeof(struct drm_info_list))
> local = drmm_kmalloc(>_to_xe(gt)->drm, DEBUGFS_SIZE, GFP_KERNEL);
> if (!local) {
> - XE_WARN_ON("Couldn't allocate memory");
> return;
> }
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_debugfs.c b/drivers/gpu/drm/xe/xe_guc_debugfs.c
> index 0178b1a2d367..069afb52343c 100644
> --- a/drivers/gpu/drm/xe/xe_guc_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_guc_debugfs.c
> @@ -90,7 +90,6 @@ void xe_guc_debugfs_register(struct xe_guc *guc, struct dentry *parent)
> #define DEBUGFS_SIZE (ARRAY_SIZE(debugfs_list) * sizeof(struct drm_info_list))
> local = drmm_kmalloc(&guc_to_xe(guc)->drm, DEBUGFS_SIZE, GFP_KERNEL);
> if (!local) {
> - XE_WARN_ON("Couldn't allocate memory");
> return;
> }
>
> diff --git a/drivers/gpu/drm/xe/xe_huc_debugfs.c b/drivers/gpu/drm/xe/xe_huc_debugfs.c
> index ae3c21315d59..9478edc4c39a 100644
> --- a/drivers/gpu/drm/xe/xe_huc_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_huc_debugfs.c
> @@ -56,7 +56,6 @@ void xe_huc_debugfs_register(struct xe_huc *huc, struct dentry *parent)
> #define DEBUGFS_SIZE (ARRAY_SIZE(debugfs_list) * sizeof(struct drm_info_list))
> local = drmm_kmalloc(&huc_to_xe(huc)->drm, DEBUGFS_SIZE, GFP_KERNEL);
> if (!local) {
> - XE_WARN_ON("Couldn't allocate memory");
> return;
> }
>
> diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
> index 4b7869596ba8..f880c9af1651 100644
> --- a/drivers/gpu/drm/xe/xe_query.c
> +++ b/drivers/gpu/drm/xe/xe_query.c
> @@ -65,7 +65,7 @@ static int query_engines(struct xe_device *xe,
> }
>
> hw_engine_info = kmalloc(size, GFP_KERNEL);
> - if (XE_IOCTL_DBG(xe, !hw_engine_info))
> + if (!hw_engine_info)
> return -ENOMEM;
>
> for_each_gt(gt, xe, gt_id)
> @@ -182,7 +182,7 @@ static int query_config(struct xe_device *xe, struct drm_xe_device_query *query)
> }
>
> config = kzalloc(size, GFP_KERNEL);
> - if (XE_IOCTL_DBG(xe, !config))
> + if (!config)
> return -ENOMEM;
>
> config->num_params = num_params;
> @@ -231,7 +231,7 @@ static int query_gts(struct xe_device *xe, struct drm_xe_device_query *query)
> }
>
> gts = kzalloc(size, GFP_KERNEL);
> - if (XE_IOCTL_DBG(xe, !gts))
> + if (!gts)
> return -ENOMEM;
>
> gts->num_gt = xe->info.gt_count;
> @@ -278,7 +278,7 @@ static int query_hwconfig(struct xe_device *xe,
> }
>
> hwconfig = kzalloc(size, GFP_KERNEL);
> - if (XE_IOCTL_DBG(xe, !hwconfig))
> + if (!hwconfig)
> return -ENOMEM;
>
> xe_device_mem_access_get(xe);
> --
> 2.34.1
>
prev parent reply other threads:[~2023-07-19 15:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-19 13:20 [Intel-xe] [PATCH] drm/xe: Rely on kmalloc/kzalloc log message Francois Dugast
2023-07-19 13:51 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
2023-07-19 13:51 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-07-19 13:52 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-07-19 13:56 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-07-19 13:56 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-07-19 13:58 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-07-19 14:31 ` [Intel-xe] ○ CI.BAT: info " Patchwork
2023-07-19 15:32 ` Rodrigo Vivi [this message]
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=ZLgCCzIvSAaLo+GH@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=francois.dugast@intel.com \
--cc=intel-xe@lists.freedesktop.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.