• Jonathan Gray's avatar
    drm/amd/display: avoid unaligned access warnings · 6e60cba6
    Jonathan Gray authored
    When building on OpenBSD/arm64 with clang 15, unaligned access
    warnings are seen when a union is embedded inside a packed struct.
    
    drm/amd/display/dmub/inc/dmub_cmd.h:941:18: error: field
      cursor_copy_src within 'struct dmub_rb_cmd_mall' is less aligned than
      'union dmub_addr' and is usually due to 'struct dmub_rb_cmd_mall'
      being packed, which can lead to unaligned accesses
      [-Werror,-Wunaligned-access]
            union dmub_addr cursor_copy_src; /**< Cursor copy address */
                            ^
    drm/amd/display/dmub/inc/dmub_cmd.h:942:18: error: field cursor_copy_dst
      within 'struct dmub_rb_cmd_mall' is less aligned than
      'union dmub_addr' and is usually due to 'struct dmub_rb_cmd_mall'
      being packed, which can lead to unaligned accesses
      [-Werror,-Wunaligned-access]
            union dmub_addr cursor_copy_dst; /**< Cursor copy destination */
                            ^
    
    Add pragma pack around dmub_addr to avoid this.
    Signed-off-by: default avatarJonathan Gray <jsg@jsg.id.au>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    6e60cba6
dmub_cmd.h 93.2 KB