drm/amd/pm: avoid unaligned access warnings
authorJonathan Gray <jsg@jsg.id.au>
Tue, 14 Feb 2023 06:52:12 +0000 (17:52 +1100)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 16 Feb 2023 03:25:01 +0000 (22:25 -0500)
commitf989fa298c0f57070dca9816439aa2e72f1bec8d
treee26c1978123211b83c9fb2b4eacee42e1a03150a
parent6e60cba666831e148d24b0aed783e1eb5bf99ff4
drm/amd/pm: avoid unaligned access warnings

When building on OpenBSD/arm64 with clang 15, unaligned access
warnings are seen when a union is embedded inside a packed struct.

drm/amd/pm/powerplay/hwmgr/vega20_pptable.h:136:17: error: field
  smcPPTable within 'struct _ATOM_VEGA20_POWERPLAYTABLE' is less aligned
  than 'PPTable_t' and is usually due to
  'struct _ATOM_VEGA20_POWERPLAYTABLE' being packed, which can lead to
   unaligned accesses [-Werror,-Wunaligned-access]
      PPTable_t smcPPTable;
                ^

Make PPTable_t packed to avoid this.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/powerplay/inc/smu11_driver_if.h
drivers/gpu/drm/amd/pm/powerplay/inc/smu9_driver_if.h
drivers/gpu/drm/amd/pm/powerplay/inc/vega12/smu9_driver_if.h
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_arcturus.h
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_navi10.h
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu11_driver_if_sienna_cichlid.h
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_aldebaran.h
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_7.h