On Thu, 29 Feb 2024, Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> wrote: > On Mon, Feb 26, 2024 at 07:58:54PM +0200, Jani Nikula wrote: >> Add a function to return the expected child device size. Flip the if >> ladder around and use the same versions as in documentation to make it >> easier to verify. Return an error for unknown versions. No functional >> changes. >> >> v2: Move BUILD_BUG_ON() next to the expected sizes >> >> Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx> >> --- >> drivers/gpu/drm/i915/display/intel_bios.c | 40 ++++++++++++++--------- >> 1 file changed, 24 insertions(+), 16 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c >> index c0f41bd1f946..343726de9aa7 100644 >> --- a/drivers/gpu/drm/i915/display/intel_bios.c >> +++ b/drivers/gpu/drm/i915/display/intel_bios.c >> @@ -2699,27 +2699,35 @@ static void parse_ddi_ports(struct drm_i915_private *i915) >> print_ddi_port(devdata); >> } >> >> +static int child_device_expected_size(u16 version) >> +{ >> + BUILD_BUG_ON(sizeof(struct child_device_config) < 40); > > Should we make that !=40 perhaps? Yeah, but let's get this going first. > Anyways, series is > Reviewed-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> Thanks, pushed to din. BR, Jani. -- Jani Nikula, Intel