Skip to content

Commit

Permalink
[PATCH] tpm_bios indexing fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Feb 1, 2006
1 parent ca4a031 commit 1c40f7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/char/tpm/tpm_bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ static int get_event_name(char *dest, struct tcpa_event *event,
}
break;
case EVENT_TAG:
event_id = be32_to_cpu(event_entry);
event_data_size = be32_to_cpu(&event_entry[4]);
event_id = be32_to_cpu(*((u32 *)event_entry));
event_data_size = be32_to_cpu(((u32 *)event_entry)[1]);

/* ToDo Row data -> Base64 */

Expand Down

0 comments on commit 1c40f7d

Please sign in to comment.