Commit 348df8db301d9fa01fb51e5eaca1e9f3b27bd4c8
Committed by
Kent Yoder
1 parent
c584af1926
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
TPM: Switch to __packed instead of __attribute__((packed))
This seems to be preferred these days. Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Reviewed-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
Showing 2 changed files with 21 additions and 21 deletions Side-by-side Diff
drivers/char/tpm/tpm.h
... | ... | @@ -155,13 +155,13 @@ |
155 | 155 | __be16 tag; |
156 | 156 | __be32 length; |
157 | 157 | __be32 ordinal; |
158 | -}__attribute__((packed)); | |
158 | +} __packed; | |
159 | 159 | |
160 | 160 | struct tpm_output_header { |
161 | 161 | __be16 tag; |
162 | 162 | __be32 length; |
163 | 163 | __be32 return_code; |
164 | -}__attribute__((packed)); | |
164 | +} __packed; | |
165 | 165 | |
166 | 166 | struct stclear_flags_t { |
167 | 167 | __be16 tag; |
168 | 168 | |
... | ... | @@ -170,14 +170,14 @@ |
170 | 170 | u8 physicalPresence; |
171 | 171 | u8 physicalPresenceLock; |
172 | 172 | u8 bGlobalLock; |
173 | -}__attribute__((packed)); | |
173 | +} __packed; | |
174 | 174 | |
175 | 175 | struct tpm_version_t { |
176 | 176 | u8 Major; |
177 | 177 | u8 Minor; |
178 | 178 | u8 revMajor; |
179 | 179 | u8 revMinor; |
180 | -}__attribute__((packed)); | |
180 | +} __packed; | |
181 | 181 | |
182 | 182 | struct tpm_version_1_2_t { |
183 | 183 | __be16 tag; |
184 | 184 | |
185 | 185 | |
... | ... | @@ -185,20 +185,20 @@ |
185 | 185 | u8 Minor; |
186 | 186 | u8 revMajor; |
187 | 187 | u8 revMinor; |
188 | -}__attribute__((packed)); | |
188 | +} __packed; | |
189 | 189 | |
190 | 190 | struct timeout_t { |
191 | 191 | __be32 a; |
192 | 192 | __be32 b; |
193 | 193 | __be32 c; |
194 | 194 | __be32 d; |
195 | -}__attribute__((packed)); | |
195 | +} __packed; | |
196 | 196 | |
197 | 197 | struct duration_t { |
198 | 198 | __be32 tpm_short; |
199 | 199 | __be32 tpm_medium; |
200 | 200 | __be32 tpm_long; |
201 | -}__attribute__((packed)); | |
201 | +} __packed; | |
202 | 202 | |
203 | 203 | struct permanent_flags_t { |
204 | 204 | __be16 tag; |
... | ... | @@ -222,7 +222,7 @@ |
222 | 222 | u8 tpmEstablished; |
223 | 223 | u8 maintenanceDone; |
224 | 224 | u8 disableFullDALogicInfo; |
225 | -}__attribute__((packed)); | |
225 | +} __packed; | |
226 | 226 | |
227 | 227 | typedef union { |
228 | 228 | struct permanent_flags_t perm_flags; |
229 | 229 | |
... | ... | @@ -240,12 +240,12 @@ |
240 | 240 | __be32 cap; |
241 | 241 | __be32 subcap_size; |
242 | 242 | __be32 subcap; |
243 | -}__attribute__((packed)); | |
243 | +} __packed; | |
244 | 244 | |
245 | 245 | struct tpm_getcap_params_out { |
246 | 246 | __be32 cap_size; |
247 | 247 | cap_t cap; |
248 | -}__attribute__((packed)); | |
248 | +} __packed; | |
249 | 249 | |
250 | 250 | struct tpm_readpubek_params_out { |
251 | 251 | u8 algorithm[4]; |
... | ... | @@ -256,7 +256,7 @@ |
256 | 256 | __be32 keysize; |
257 | 257 | u8 modulus[256]; |
258 | 258 | u8 checksum[20]; |
259 | -}__attribute__((packed)); | |
259 | +} __packed; | |
260 | 260 | |
261 | 261 | typedef union { |
262 | 262 | struct tpm_input_header in; |
263 | 263 | |
264 | 264 | |
... | ... | @@ -266,16 +266,16 @@ |
266 | 266 | #define TPM_DIGEST_SIZE 20 |
267 | 267 | struct tpm_pcrread_out { |
268 | 268 | u8 pcr_result[TPM_DIGEST_SIZE]; |
269 | -}__attribute__((packed)); | |
269 | +} __packed; | |
270 | 270 | |
271 | 271 | struct tpm_pcrread_in { |
272 | 272 | __be32 pcr_idx; |
273 | -}__attribute__((packed)); | |
273 | +} __packed; | |
274 | 274 | |
275 | 275 | struct tpm_pcrextend_in { |
276 | 276 | __be32 pcr_idx; |
277 | 277 | u8 hash[TPM_DIGEST_SIZE]; |
278 | -}__attribute__((packed)); | |
278 | +} __packed; | |
279 | 279 | |
280 | 280 | /* 128 bytes is an arbitrary cap. This could be as large as TPM_BUFSIZE - 18 |
281 | 281 | * bytes, but 128 is still a relatively large number of random bytes and |
282 | 282 | |
... | ... | @@ -286,11 +286,11 @@ |
286 | 286 | struct tpm_getrandom_out { |
287 | 287 | __be32 rng_data_len; |
288 | 288 | u8 rng_data[TPM_MAX_RNG_DATA]; |
289 | -}__attribute__((packed)); | |
289 | +} __packed; | |
290 | 290 | |
291 | 291 | struct tpm_getrandom_in { |
292 | 292 | __be32 num_bytes; |
293 | -}__attribute__((packed)); | |
293 | +} __packed; | |
294 | 294 | |
295 | 295 | struct tpm_startup_in { |
296 | 296 | __be16 startup_type; |
... | ... | @@ -312,7 +312,7 @@ |
312 | 312 | struct tpm_cmd_t { |
313 | 313 | tpm_cmd_header header; |
314 | 314 | tpm_cmd_params params; |
315 | -}__attribute__((packed)); | |
315 | +} __packed; | |
316 | 316 | |
317 | 317 | ssize_t tpm_getcap(struct device *, __be32, cap_t *, const char *); |
318 | 318 |
drivers/char/tpm/tpm_acpi.c
... | ... | @@ -33,13 +33,13 @@ |
33 | 33 | u16 platform_class; |
34 | 34 | union { |
35 | 35 | struct client_hdr { |
36 | - u32 log_max_len __attribute__ ((packed)); | |
37 | - u64 log_start_addr __attribute__ ((packed)); | |
36 | + u32 log_max_len __packed; | |
37 | + u64 log_start_addr __packed; | |
38 | 38 | } client; |
39 | 39 | struct server_hdr { |
40 | 40 | u16 reserved; |
41 | - u64 log_max_len __attribute__ ((packed)); | |
42 | - u64 log_start_addr __attribute__ ((packed)); | |
41 | + u64 log_max_len __packed; | |
42 | + u64 log_start_addr __packed; | |
43 | 43 | } server; |
44 | 44 | }; |
45 | 45 | }; |