]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/i915/gt: use designated initializers for intel_gt_debugfs_file
authorSebastian Brzezinka <sebastian.brzezinka@intel.com>
Tue, 16 Dec 2025 15:11:45 +0000 (16:11 +0100)
committerAndi Shyti <andi.shyti@kernel.org>
Thu, 1 Jan 2026 12:14:50 +0000 (13:14 +0100)
commit78df43b95885eb764666eac2ea8e21e2953175e1
tree6de05a7c646ab2e2a76beb16a476693df2832eaa
parent08889b706d4f0b8d2352b7ca29c2d8df4d0787cd
drm/i915/gt: use designated initializers for intel_gt_debugfs_file

CONFIG_RANDSTRUCT may reorder structure fields, which makes positional
initializers unsafe. The i915 GT debugfs tables were using positional
initializers for `struct intel_gt_debugfs_file`, and on configs where
the layout differs (e.g., presence/absence of the `.eval` callback),
this can lead to fields being initialized incorrectly and trigger
randstruct warnings such as:

```
  drivers/gpu/drm/i915/gt/intel_gt_debugfs.c:75:51: note: randstruct:
  casting between randomized structure pointer types (constructor)
```

Switch all the GT debugfs file arrays to designated initializers. This
binds each value to the intended member regardless of structure
reordering or optional members and removes the warning while preserving
the intended initialization. Also drops the '&' from
intel_eval_slpc_support so .eval receives the function pointer directly.

No functional change, only initialization style is updated.

Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://lore.kernel.org/r/bae491e8098705a87304a7c94573b377e8c8fa37.1765897826.git.sebastian.brzezinka@intel.com
drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
drivers/gpu/drm/i915/gt/intel_gt_engines_debugfs.c
drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c
drivers/gpu/drm/i915/gt/intel_sseu_debugfs.c
drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_debugfs.c
drivers/gpu/drm/i915/gt/uc/intel_guc_debugfs.c
drivers/gpu/drm/i915/gt/uc/intel_guc_log_debugfs.c
drivers/gpu/drm/i915/gt/uc/intel_huc_debugfs.c
drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c