diff options
author | Andrew Morton <akpm@osdl.org> | 2006-02-01 06:05:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-01 11:53:12 -0500 |
commit | 1c40f7d4f0a9d5242f19b02b00e3e5a8ee218a20 (patch) | |
tree | 3a6422d574bf033ef1c4c6f455c6e528ac3116c2 /drivers/char/tpm | |
parent | ca4a031f6b43edb8745ebc0a1b7307c24719dae4 (diff) |
[PATCH] tpm_bios indexing fix
It generates warnings:
drivers/char/tpm/tpm_bios.c: In function `get_event_name':
drivers/char/tpm/tpm_bios.c:223: warning: cast from pointer to integer of different size
drivers/char/tpm/tpm_bios.c:223: warning: cast from pointer to integer of different size
drivers/char/tpm/tpm_bios.c:223: warning: cast from pointer to integer of different size
drivers/char/tpm/tpm_bios.c:224: warning: cast from pointer to integer of different size
drivers/char/tpm/tpm_bios.c:224: warning: cast from pointer to integer of different size
drivers/char/tpm/tpm_bios.c:224: warning: cast from pointer to integer of different size
and I'm not sure what the code is doing there, but it seems wrong. We're
using the address of the buffer rather than the contents of it.
The patch adds more nasty typecasting, but I think the whole arrangement could
be done in a more typesafe manner.
Cc: Kylene Jo Hall <kjhall@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/tpm')
-rw-r--r-- | drivers/char/tpm/tpm_bios.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c index 9ffa5643e79..1310189fd9f 100644 --- a/drivers/char/tpm/tpm_bios.c +++ b/drivers/char/tpm/tpm_bios.c | |||
@@ -220,8 +220,8 @@ static int get_event_name(char *dest, struct tcpa_event *event, | |||
220 | } | 220 | } |
221 | break; | 221 | break; |
222 | case EVENT_TAG: | 222 | case EVENT_TAG: |
223 | event_id = be32_to_cpu(event_entry); | 223 | event_id = be32_to_cpu(*((u32 *)event_entry)); |
224 | event_data_size = be32_to_cpu(&event_entry[4]); | 224 | event_data_size = be32_to_cpu(((u32 *)event_entry)[1]); |
225 | 225 | ||
226 | /* ToDo Row data -> Base64 */ | 226 | /* ToDo Row data -> Base64 */ |
227 | 227 | ||