]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe: Combine PF and VF device data into union
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Sun, 13 Jul 2025 10:36:19 +0000 (12:36 +0200)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 14 Jul 2025 15:53:39 +0000 (17:53 +0200)
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 <michal.wajdeczko@intel.com>
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Link: https://lore.kernel.org/r/20250713103625.1964-2-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_device_types.h

index 1e6ecf1e6979f487bfa8a3d2c68cecb8e76092b5..b41dd3e76b919975f60051dabcb547b9fc4ec49d 100644 (file)
@@ -422,10 +422,12 @@ struct xe_device {
                /** @sriov.__mode: SR-IOV mode (Don't access directly!) */
                enum xe_sriov_mode __mode;
 
-               /** @sriov.pf: PF specific data */
-               struct xe_device_pf pf;
-               /** @sriov.vf: VF specific data */
-               struct xe_device_vf vf;
+               union {
+                       /** @sriov.pf: PF specific data */
+                       struct xe_device_pf pf;
+                       /** @sriov.vf: VF specific data */
+                       struct xe_device_vf vf;
+               };
 
                /** @sriov.wq: workqueue used by the virtualization workers */
                struct workqueue_struct *wq;