]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/configfs: Drop MAX_GT_TYPE_CHARS constant
authorMatt Roper <matthew.d.roper@intel.com>
Fri, 24 Oct 2025 20:08:35 +0000 (13:08 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Fri, 24 Oct 2025 22:00:38 +0000 (15:00 -0700)
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>
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://patch.msgid.link/20251024200834.1512329-2-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
drivers/gpu/drm/xe/xe_configfs.c

index c1419a270fa4b9b315ad593ab899f35edefdd785..fad75650f3ddb78107b696c946512a00dbbb03be 100644 (file)
@@ -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 },