drm/xe/mcr: Use designated init for xe_steering_types
authorLucas De Marchi <lucas.demarchi@intel.com>
Mon, 30 Jan 2023 22:14:37 +0000 (14:14 -0800)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:27:48 +0000 (18:27 -0500)
There is already a BUILD_BUG_ON() check to make sure the size follow the
number of steering types. Also make sure the right index is being used
for each steering type.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_gt_mcr.c

index 7c97031cd716c8378bc1e3bca1500d5a2be022ce..d7c89f7b56e2a371b86bb19ccfbe5afea13f31b3 100644 (file)
@@ -249,12 +249,12 @@ static const struct {
        const char *name;
        void (*init)(struct xe_gt *);
 } xe_steering_types[] = {
-       { "L3BANK",     init_steering_l3bank },
-       { "MSLICE",     init_steering_mslice },
-       { "LNCF",       NULL },         /* initialized by mslice init */
-       { "DSS",        init_steering_dss },
-       { "OADDRM",     init_steering_oaddrm },
-       { "INSTANCE 0", init_steering_inst0 },
+       [L3BANK] =      { "L3BANK",     init_steering_l3bank },
+       [MSLICE] =      { "MSLICE",     init_steering_mslice },
+       [LNCF] =        { "LNCF",       NULL }, /* initialized by mslice init */
+       [DSS] =         { "DSS",        init_steering_dss },
+       [OADDRM] =      { "OADDRM",     init_steering_oaddrm },
+       [INSTANCE0] =   { "INSTANCE 0", init_steering_inst0 },
 };
 
 void xe_gt_mcr_init(struct xe_gt *gt)