aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>2012-11-21 15:56:45 -0500
committerKent Yoder <key@linux.vnet.ibm.com>2013-02-05 10:38:22 -0500
commit348df8db301d9fa01fb51e5eaca1e9f3b27bd4c8 (patch)
tree560d7a6574e520ea9e9e232abce80cfb96e88142 /drivers/char
parentc584af1926b7626ef3bdab3354382cb2bd434d36 (diff)
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>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/tpm/tpm.h34
-rw-r--r--drivers/char/tpm/tpm_acpi.c8
2 files changed, 21 insertions, 21 deletions
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 8971b128500b..04b4547162c8 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -155,13 +155,13 @@ struct tpm_input_header {
155 __be16 tag; 155 __be16 tag;
156 __be32 length; 156 __be32 length;
157 __be32 ordinal; 157 __be32 ordinal;
158}__attribute__((packed)); 158} __packed;
159 159
160struct tpm_output_header { 160struct tpm_output_header {
161 __be16 tag; 161 __be16 tag;
162 __be32 length; 162 __be32 length;
163 __be32 return_code; 163 __be32 return_code;
164}__attribute__((packed)); 164} __packed;
165 165
166struct stclear_flags_t { 166struct stclear_flags_t {
167 __be16 tag; 167 __be16 tag;
@@ -170,14 +170,14 @@ struct stclear_flags_t {
170 u8 physicalPresence; 170 u8 physicalPresence;
171 u8 physicalPresenceLock; 171 u8 physicalPresenceLock;
172 u8 bGlobalLock; 172 u8 bGlobalLock;
173}__attribute__((packed)); 173} __packed;
174 174
175struct tpm_version_t { 175struct tpm_version_t {
176 u8 Major; 176 u8 Major;
177 u8 Minor; 177 u8 Minor;
178 u8 revMajor; 178 u8 revMajor;
179 u8 revMinor; 179 u8 revMinor;
180}__attribute__((packed)); 180} __packed;
181 181
182struct tpm_version_1_2_t { 182struct tpm_version_1_2_t {
183 __be16 tag; 183 __be16 tag;
@@ -185,20 +185,20 @@ struct tpm_version_1_2_t {
185 u8 Minor; 185 u8 Minor;
186 u8 revMajor; 186 u8 revMajor;
187 u8 revMinor; 187 u8 revMinor;
188}__attribute__((packed)); 188} __packed;
189 189
190struct timeout_t { 190struct timeout_t {
191 __be32 a; 191 __be32 a;
192 __be32 b; 192 __be32 b;
193 __be32 c; 193 __be32 c;
194 __be32 d; 194 __be32 d;
195}__attribute__((packed)); 195} __packed;
196 196
197struct duration_t { 197struct duration_t {
198 __be32 tpm_short; 198 __be32 tpm_short;
199 __be32 tpm_medium; 199 __be32 tpm_medium;
200 __be32 tpm_long; 200 __be32 tpm_long;
201}__attribute__((packed)); 201} __packed;
202 202
203struct permanent_flags_t { 203struct permanent_flags_t {
204 __be16 tag; 204 __be16 tag;
@@ -222,7 +222,7 @@ struct permanent_flags_t {
222 u8 tpmEstablished; 222 u8 tpmEstablished;
223 u8 maintenanceDone; 223 u8 maintenanceDone;
224 u8 disableFullDALogicInfo; 224 u8 disableFullDALogicInfo;
225}__attribute__((packed)); 225} __packed;
226 226
227typedef union { 227typedef union {
228 struct permanent_flags_t perm_flags; 228 struct permanent_flags_t perm_flags;
@@ -240,12 +240,12 @@ struct tpm_getcap_params_in {
240 __be32 cap; 240 __be32 cap;
241 __be32 subcap_size; 241 __be32 subcap_size;
242 __be32 subcap; 242 __be32 subcap;
243}__attribute__((packed)); 243} __packed;
244 244
245struct tpm_getcap_params_out { 245struct tpm_getcap_params_out {
246 __be32 cap_size; 246 __be32 cap_size;
247 cap_t cap; 247 cap_t cap;
248}__attribute__((packed)); 248} __packed;
249 249
250struct tpm_readpubek_params_out { 250struct tpm_readpubek_params_out {
251 u8 algorithm[4]; 251 u8 algorithm[4];
@@ -256,7 +256,7 @@ struct tpm_readpubek_params_out {
256 __be32 keysize; 256 __be32 keysize;
257 u8 modulus[256]; 257 u8 modulus[256];
258 u8 checksum[20]; 258 u8 checksum[20];
259}__attribute__((packed)); 259} __packed;
260 260
261typedef union { 261typedef union {
262 struct tpm_input_header in; 262 struct tpm_input_header in;
@@ -266,16 +266,16 @@ typedef union {
266#define TPM_DIGEST_SIZE 20 266#define TPM_DIGEST_SIZE 20
267struct tpm_pcrread_out { 267struct tpm_pcrread_out {
268 u8 pcr_result[TPM_DIGEST_SIZE]; 268 u8 pcr_result[TPM_DIGEST_SIZE];
269}__attribute__((packed)); 269} __packed;
270 270
271struct tpm_pcrread_in { 271struct tpm_pcrread_in {
272 __be32 pcr_idx; 272 __be32 pcr_idx;
273}__attribute__((packed)); 273} __packed;
274 274
275struct tpm_pcrextend_in { 275struct tpm_pcrextend_in {
276 __be32 pcr_idx; 276 __be32 pcr_idx;
277 u8 hash[TPM_DIGEST_SIZE]; 277 u8 hash[TPM_DIGEST_SIZE];
278}__attribute__((packed)); 278} __packed;
279 279
280/* 128 bytes is an arbitrary cap. This could be as large as TPM_BUFSIZE - 18 280/* 128 bytes is an arbitrary cap. This could be as large as TPM_BUFSIZE - 18
281 * bytes, but 128 is still a relatively large number of random bytes and 281 * bytes, but 128 is still a relatively large number of random bytes and
@@ -286,11 +286,11 @@ struct tpm_pcrextend_in {
286struct tpm_getrandom_out { 286struct tpm_getrandom_out {
287 __be32 rng_data_len; 287 __be32 rng_data_len;
288 u8 rng_data[TPM_MAX_RNG_DATA]; 288 u8 rng_data[TPM_MAX_RNG_DATA];
289}__attribute__((packed)); 289} __packed;
290 290
291struct tpm_getrandom_in { 291struct tpm_getrandom_in {
292 __be32 num_bytes; 292 __be32 num_bytes;
293}__attribute__((packed)); 293} __packed;
294 294
295struct tpm_startup_in { 295struct tpm_startup_in {
296 __be16 startup_type; 296 __be16 startup_type;
@@ -312,7 +312,7 @@ typedef union {
312struct tpm_cmd_t { 312struct tpm_cmd_t {
313 tpm_cmd_header header; 313 tpm_cmd_header header;
314 tpm_cmd_params params; 314 tpm_cmd_params params;
315}__attribute__((packed)); 315} __packed;
316 316
317ssize_t tpm_getcap(struct device *, __be32, cap_t *, const char *); 317ssize_t tpm_getcap(struct device *, __be32, cap_t *, const char *);
318 318
diff --git a/drivers/char/tpm/tpm_acpi.c b/drivers/char/tpm/tpm_acpi.c
index 56051d0c97a2..64420b3396a2 100644
--- a/drivers/char/tpm/tpm_acpi.c
+++ b/drivers/char/tpm/tpm_acpi.c
@@ -33,13 +33,13 @@ struct acpi_tcpa {
33 u16 platform_class; 33 u16 platform_class;
34 union { 34 union {
35 struct client_hdr { 35 struct client_hdr {
36 u32 log_max_len __attribute__ ((packed)); 36 u32 log_max_len __packed;
37 u64 log_start_addr __attribute__ ((packed)); 37 u64 log_start_addr __packed;
38 } client; 38 } client;
39 struct server_hdr { 39 struct server_hdr {
40 u16 reserved; 40 u16 reserved;
41 u64 log_max_len __attribute__ ((packed)); 41 u64 log_max_len __packed;
42 u64 log_start_addr __attribute__ ((packed)); 42 u64 log_start_addr __packed;
43 } server; 43 } server;
44 }; 44 };
45}; 45};