Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/pm: suppress compile warning about possible unaligned accesses

Suppress the following compile warning:
In file included from drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_0_ppt.c:39:
>> drivers/gpu/drm/amd/amdgpu/../pm/inc/smu_v13_0_0_pptable.h:194:39:
warning: field overdrive_table within 'struct smu_13_0_0_powerplay_table' is
less aligned than 'struct smu_13_0_0_overdrive_table' and is usually due to
'struct smu_13_0_0_powerplay_table' being packed,
which can lead to unaligned accesses [-Wunaligned-access]

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Evan Quan and committed by
Alex Deucher
663e4811 0ae99221

+4 -1
+4 -1
drivers/gpu/drm/amd/pm/inc/smu_v13_0_0_pptable.h
··· 22 22 #ifndef SMU_13_0_0_PPTABLE_H 23 23 #define SMU_13_0_0_PPTABLE_H 24 24 25 + #pragma pack(push, 1) 26 + 25 27 #define SMU_13_0_0_TABLE_FORMAT_REVISION 15 26 28 27 29 //// POWERPLAYTABLE::ulPlatformCaps ··· 196 194 struct smu_13_0_0_overdrive_table overdrive_table; 197 195 uint8_t padding1; 198 196 PPTable_t smc_pptable; //PPTable_t in driver_if.h 199 - } __attribute__((packed)); 197 + }; 200 198 199 + #pragma pack(pop) 201 200 202 201 #endif