drm/xe: Allow const propagation in gt_to_xe()
authorLucas De Marchi <lucas.demarchi@intel.com>
Sat, 4 Mar 2023 06:26:55 +0000 (22:26 -0800)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:29:45 +0000 (18:29 -0500)
commit8846ffb457587e5d393a83ce977c3db7c800fe58
tree021f0b1bd4cc91df2c70605d481f600ac2b0af9d
parent6b980aa88d403db3e4cf5b58965dfa9a5f27c740
drm/xe: Allow const propagation in gt_to_xe()

Replace the inline function with a _Generic() so gt_to_xe() can work
with a const struct xe_gt*, which leads to a const struct xe *.
This allows a const gt being passed around and when the xe device is
needed, compiler won't issue a warning that calling gt_to_xe() would
discard the const. Rather, just propagate the const to the xe pointer
being returned.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_gt.h