Commit a3d64df8 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Peter Huewe

tpm: simplify code by using %*phN specifier

Instead of looping by ourselves we may use %*phN specifier to dump a small
buffer.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
[ PHuewe: removed now unused variable i ]
Signed-off-by: default avatarPeter Huewe <peterhuewe@gmx.de>
parent 8e54caf4
...@@ -235,7 +235,6 @@ static int tpm_bios_measurements_release(struct inode *inode, ...@@ -235,7 +235,6 @@ static int tpm_bios_measurements_release(struct inode *inode,
static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v) static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v)
{ {
int len = 0; int len = 0;
int i;
char *eventname; char *eventname;
struct tcpa_event *event = v; struct tcpa_event *event = v;
unsigned char *event_entry = unsigned char *event_entry =
...@@ -251,8 +250,7 @@ static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v) ...@@ -251,8 +250,7 @@ static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v)
seq_printf(m, "%2d ", event->pcr_index); seq_printf(m, "%2d ", event->pcr_index);
/* 2nd: SHA1 */ /* 2nd: SHA1 */
for (i = 0; i < 20; i++) seq_printf(m, "%20phN", event->pcr_value);
seq_printf(m, "%02x", event->pcr_value[i]);
/* 3rd: event type identifier */ /* 3rd: event type identifier */
seq_printf(m, " %02x", event->event_type); seq_printf(m, " %02x", event->event_type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment