From: Lucas De Marchi Date: Mon, 30 Jan 2023 22:14:37 +0000 (-0800) Subject: drm/xe/mcr: Use designated init for xe_steering_types X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3319b213d7c8bdeaa001fec7b60aefa2390112d4;p=linux.git drm/xe/mcr: Use designated init for xe_steering_types 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 Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi --- diff --git a/drivers/gpu/drm/xe/xe_gt_mcr.c b/drivers/gpu/drm/xe/xe_gt_mcr.c index 7c97031cd716c..d7c89f7b56e2a 100644 --- a/drivers/gpu/drm/xe/xe_gt_mcr.c +++ b/drivers/gpu/drm/xe/xe_gt_mcr.c @@ -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)