Skip to content

Commit 7dcae52

Browse files
committed
drm/xe: Combine PF and VF device data into union
There is no need to keep PF and VF data fields fully separate since we can be only in one mode at the time. Move them into a anonymous union to save few bytes. Signed-off-by: Michal Wajdeczko <[email protected]> Reviewed-by: Piotr Piórkowski <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8d4aec4 commit 7dcae52

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/gpu/drm/xe/xe_device_types.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,12 @@ struct xe_device {
422422
/** @sriov.__mode: SR-IOV mode (Don't access directly!) */
423423
enum xe_sriov_mode __mode;
424424

425-
/** @sriov.pf: PF specific data */
426-
struct xe_device_pf pf;
427-
/** @sriov.vf: VF specific data */
428-
struct xe_device_vf vf;
425+
union {
426+
/** @sriov.pf: PF specific data */
427+
struct xe_device_pf pf;
428+
/** @sriov.vf: VF specific data */
429+
struct xe_device_vf vf;
430+
};
429431

430432
/** @sriov.wq: workqueue used by the virtualization workers */
431433
struct workqueue_struct *wq;

0 commit comments

Comments
 (0)