Suppress the following compile warnings: >> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v11_0_pptable.h:163:17: warning: field smc_pptable within 'struct smu_11_0_powerplay_table' is less aligned than 'PPTable_t' and is usually due to 'struct smu_11_0_powerplay_table' being packed, which can lead to unaligned accesses [-Wunaligned-access] PPTable_t smc_pptable; //PPTable_t in smu11_driver_if.h ^ 1 warning generated. -- >> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v11_0_7_pptable.h:193:17: warning: field smc_pptable within 'struct smu_11_0_7_powerplay_table' is less aligned than 'PPTable_t' and is usually due to 'struct smu_11_0_7_powerplay_table' being packed, which can lead to unaligned accesses [-Wunaligned-access] PPTable_t smc_pptable; //PPTable_t in smu11_driver_if.h ^ 1 warning generated. -- >> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v13_0_pptable.h:161:12: warning: field smc_pptable within 'struct smu_13_0_powerplay_table' is less aligned than 'PPTable_t' and is usually due to 'struct smu_13_0_powerplay_table' being packed, which can lead to unaligned accesses [-Wunaligned-access]
Unified · Split
| @@ -22,6 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | #ifndef SMU_11_0_7_PPTABLE_H |
| 23 | 23 | #define SMU_11_0_7_PPTABLE_H |
| 24 | 24 | |
| 25 | +#pragma pack(push, 1) | |
| 25 | 26 | |
| 26 | 27 | #define SMU_11_0_7_TABLE_FORMAT_REVISION 15 |
| 27 | 28 | |
| @@ -139,7 +140,7 @@ struct smu_11_0_7_overdrive_table · 111 unmodified lines | ||
| 139 | 140 | uint32_t max[SMU_11_0_7_MAX_ODSETTING]; //default maximum settings |
| 140 | 141 | uint32_t min[SMU_11_0_7_MAX_ODSETTING]; //default minimum settings |
| 141 | 142 | int16_t pm_setting[SMU_11_0_7_MAX_PMSETTING]; //Optimized power mode feature settings |
| 142 | −} __attribute__((packed)); | |
| 143 | +}; | |
| 143 | 144 | |
| 144 | 145 | enum SMU_11_0_7_PPCLOCK_ID { |
| 145 | 146 | SMU_11_0_7_PPCLOCK_GFXCLK = 0, |
| @@ -166,7 +167,7 @@ struct smu_11_0_7_power_saving_clock_table · 20 unmodified lines | ||
| 166 | 167 | uint32_t count; //power_saving_clock_count = SMU_11_0_7_PPCLOCK_COUNT |
| 167 | 168 | uint32_t max[SMU_11_0_7_MAX_PPCLOCK]; //PowerSavingClock Mode Clock Maximum array In MHz |
| 168 | 169 | uint32_t min[SMU_11_0_7_MAX_PPCLOCK]; //PowerSavingClock Mode Clock Minimum array In MHz |
| 169 | −} __attribute__((packed)); | |
| 170 | +}; | |
| 170 | 171 | |
| 171 | 172 | struct smu_11_0_7_powerplay_table |
| 172 | 173 | { |
| @@ -191,6 +192,8 @@ struct smu_11_0_7_powerplay_table · 18 unmodified lines | ||
| 191 | 192 | struct smu_11_0_7_overdrive_table overdrive_table; |
| 192 | 193 | |
| 193 | 194 | PPTable_t smc_pptable; //PPTable_t in smu11_driver_if.h |
| 194 | −} __attribute__((packed)); | |
| 195 | +}; | |
| 196 | + | |
| 197 | +#pragma pack(pop) | |
| 195 | 198 | |
| 196 | 199 | #endif |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | #ifndef SMU_11_0_PPTABLE_H |
| 23 | 23 | #define SMU_11_0_PPTABLE_H |
| 24 | 24 | |
| 25 | +#pragma pack(push, 1) | |
| 25 | 26 | |
| 26 | 27 | #define SMU_11_0_TABLE_FORMAT_REVISION 12 |
| 27 | 28 | |
| @@ -109,7 +110,7 @@ struct smu_11_0_overdrive_table · 81 unmodified lines | ||
| 109 | 110 | uint8_t cap[SMU_11_0_MAX_ODFEATURE]; //OD feature support flags |
| 110 | 111 | uint32_t max[SMU_11_0_MAX_ODSETTING]; //default maximum settings |
| 111 | 112 | uint32_t min[SMU_11_0_MAX_ODSETTING]; //default minimum settings |
| 112 | −} __attribute__((packed)); | |
| 113 | +}; | |
| 113 | 114 | |
| 114 | 115 | enum SMU_11_0_PPCLOCK_ID { |
| 115 | 116 | SMU_11_0_PPCLOCK_GFXCLK = 0, |
| @@ -133,7 +134,7 @@ struct smu_11_0_power_saving_clock_table · 17 unmodified lines | ||
| 133 | 134 | uint32_t count; //power_saving_clock_count = SMU_11_0_PPCLOCK_COUNT |
| 134 | 135 | uint32_t max[SMU_11_0_MAX_PPCLOCK]; //PowerSavingClock Mode Clock Maximum array In MHz |
| 135 | 136 | uint32_t min[SMU_11_0_MAX_PPCLOCK]; //PowerSavingClock Mode Clock Minimum array In MHz |
| 136 | −} __attribute__((packed)); | |
| 137 | +}; | |
| 137 | 138 | |
| 138 | 139 | struct smu_11_0_powerplay_table |
| 139 | 140 | { |
| @@ -162,6 +163,8 @@ struct smu_11_0_powerplay_table · 22 unmodified lines | ||
| 162 | 163 | #ifndef SMU_11_0_PARTIAL_PPTABLE |
| 163 | 164 | PPTable_t smc_pptable; //PPTable_t in smu11_driver_if.h |
| 164 | 165 | #endif |
| 165 | −} __attribute__((packed)); | |
| 166 | +}; | |
| 167 | + | |
| 168 | +#pragma pack(pop) | |
| 166 | 169 | |
| 167 | 170 | #endif |
| @@ -22,6 +22,8 @@ · 21 unmodified lines | ||
| 22 | 22 | #ifndef SMU_13_0_7_PPTABLE_H |
| 23 | 23 | #define SMU_13_0_7_PPTABLE_H |
| 24 | 24 | |
| 25 | +#pragma pack(push, 1) | |
| 26 | + | |
| 25 | 27 | #define SMU_13_0_7_TABLE_FORMAT_REVISION 15 |
| 26 | 28 | |
| 27 | 29 | //// POWERPLAYTABLE::ulPlatformCaps |
| @@ -194,7 +196,8 @@ struct smu_13_0_7_powerplay_table · 166 unmodified lines | ||
| 194 | 196 | struct smu_13_0_7_overdrive_table overdrive_table; |
| 195 | 197 | uint8_t padding1; |
| 196 | 198 | PPTable_t smc_pptable; //PPTable_t in driver_if.h |
| 197 | −} __attribute__((packed)); | |
| 199 | +}; | |
| 198 | 200 | |
| 201 | +#pragma pack(pop) | |
| 199 | 202 | |
| 200 | 203 | #endif |
| @@ -22,6 +22,8 @@ · 21 unmodified lines | ||
| 22 | 22 | #ifndef SMU_13_0_PPTABLE_H |
| 23 | 23 | #define SMU_13_0_PPTABLE_H |
| 24 | 24 | |
| 25 | +#pragma pack(push, 1) | |
| 26 | + | |
| 25 | 27 | #define SMU_13_0_TABLE_FORMAT_REVISION 1 |
| 26 | 28 | |
| 27 | 29 | //// POWERPLAYTABLE::ulPlatformCaps |
| @@ -109,7 +111,7 @@ struct smu_13_0_overdrive_table { · 81 unmodified lines | ||
| 109 | 111 | uint8_t cap[SMU_13_0_MAX_ODFEATURE]; //OD feature support flags |
| 110 | 112 | uint32_t max[SMU_13_0_MAX_ODSETTING]; //default maximum settings |
| 111 | 113 | uint32_t min[SMU_13_0_MAX_ODSETTING]; //default minimum settings |
| 112 | −} __attribute__((packed)); | |
| 114 | +}; | |
| 113 | 115 | |
| 114 | 116 | enum SMU_13_0_PPCLOCK_ID { |
| 115 | 117 | SMU_13_0_PPCLOCK_GFXCLK = 0, |
| @@ -132,7 +134,7 @@ struct smu_13_0_power_saving_clock_table { · 16 unmodified lines | ||
| 132 | 134 | uint32_t count; //power_saving_clock_count = SMU_11_0_PPCLOCK_COUNT |
| 133 | 135 | uint32_t max[SMU_13_0_MAX_PPCLOCK]; //PowerSavingClock Mode Clock Maximum array In MHz |
| 134 | 136 | uint32_t min[SMU_13_0_MAX_PPCLOCK]; //PowerSavingClock Mode Clock Minimum array In MHz |
| 135 | −} __attribute__((packed)); | |
| 137 | +}; | |
| 136 | 138 | |
| 137 | 139 | struct smu_13_0_powerplay_table { |
| 138 | 140 | struct atom_common_table_header header; |
| @@ -160,6 +162,8 @@ struct smu_13_0_powerplay_table { · 21 unmodified lines | ||
| 160 | 162 | #ifndef SMU_13_0_PARTIAL_PPTABLE |
| 161 | 163 | PPTable_t smc_pptable; //PPTable_t in driver_if.h |
| 162 | 164 | #endif |
| 163 | −} __attribute__((packed)); | |
| 165 | +}; | |
| 166 | + | |
| 167 | +#pragma pack(pop) | |
| 164 | 168 | |
| 165 | 169 | #endif |