Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Sousa <gustavo.sousa@intel.com>
To: Matt Roper <matthew.d.roper@intel.com>, <intel-xe@lists.freedesktop.org>
Cc: <matthew.d.roper@intel.com>
Subject: Re: [PATCH] drm/xe/configfs: Drop MAX_GT_TYPE_CHARS constant
Date: Fri, 24 Oct 2025 17:22:27 -0300	[thread overview]
Message-ID: <176133734766.1676.15788306250151133090@intel.com> (raw)
In-Reply-To: <20251024200834.1512329-2-matthew.d.roper@intel.com>

Quoting Matt Roper (2025-10-24 17:08:35-03:00)
>Early revisions of commit 7abd69278bb5 ("drm/xe/configfs: Add attribute
>to disable GT types") used MAX_GT_TYPE_CHARS not only to size the
>constant name field, but also for some of the string matching logic.  By
>the time the patch finally landed, the constant was no longer needed for
>parsing.  Stop using it for the string field definition as well; this
>eliminates the risk that we forget to update the constant if we ever add
>a GT type name longer than seven characters.
>
>Suggested-by: Gustavo Sousa <gustavo.sousa@intel.com>
>Signed-off-by: Matt Roper <matthew.d.roper@intel.com>

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>

>---
> drivers/gpu/drm/xe/xe_configfs.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c
>index c1419a270fa4..fad75650f3dd 100644
>--- a/drivers/gpu/drm/xe/xe_configfs.c
>+++ b/drivers/gpu/drm/xe/xe_configfs.c
>@@ -301,7 +301,6 @@ struct engine_info {
> /* Some helpful macros to aid on the sizing of buffer allocation when parsing */
> #define MAX_ENGINE_CLASS_CHARS 5
> #define MAX_ENGINE_INSTANCE_CHARS 2
>-#define MAX_GT_TYPE_CHARS 7
> 
> static const struct engine_info engine_info[] = {
>         { .cls = "rcs", .mask = XE_HW_ENGINE_RCS_MASK, .engine_class = XE_ENGINE_CLASS_RENDER },
>@@ -313,7 +312,7 @@ static const struct engine_info engine_info[] = {
> };
> 
> static const struct {
>-        const char name[MAX_GT_TYPE_CHARS + 1];
>+        const char *name;
>         enum xe_gt_type type;
> } gt_types[] = {
>         { .name = "primary", .type = XE_GT_TYPE_MAIN },
>-- 
>2.51.0
>

  parent reply	other threads:[~2025-10-24 20:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24 20:08 [PATCH] drm/xe/configfs: Drop MAX_GT_TYPE_CHARS constant Matt Roper
2025-10-24 20:15 ` ✓ CI.KUnit: success for " Patchwork
2025-10-24 20:22 ` Gustavo Sousa [this message]
2025-10-24 21:12 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-24 22:01   ` Matt Roper
2025-10-25  8:19 ` ✓ Xe.CI.Full: " 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=176133734766.1676.15788306250151133090@intel.com \
    --to=gustavo.sousa@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@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