drm/xe: Assert size of the struct xe_reg
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Thu, 14 Mar 2024 17:31:25 +0000 (18:31 +0100)
committerMichał Winiarski <michal.winiarski@intel.com>
Fri, 15 Mar 2024 21:20:14 +0000 (22:20 +0100)
We want to keep the struct xe_reg as small as possible.
Make sure we don't accidentally change its size.

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240314173130.1177-2-michal.wajdeczko@intel.com
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
drivers/gpu/drm/xe/regs/xe_reg_defs.h

index c50e7650c09a438ad7d05d126316b568a5e5a5b0..114b07db962f168f95043e89e695c0394ef355aa 100644 (file)
@@ -6,6 +6,8 @@
 #ifndef _XE_REG_DEFS_H_
 #define _XE_REG_DEFS_H_
 
+#include <linux/build_bug.h>
+
 #include "compat-i915-headers/i915_reg_defs.h"
 
 /**
@@ -44,6 +46,7 @@ struct xe_reg {
                u32 raw;
        };
 };
+static_assert(sizeof(struct xe_reg) == sizeof(u32));
 
 /**
  * struct xe_reg_mcr - MCR register definition