Skip to content

Commit

Permalink
tpm: simplify code by using %*phN specifier
Browse files Browse the repository at this point in the history
Instead of looping by ourselves we may use %*phN specifier to dump a small
buffer.

Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
[ PHuewe: removed now unused variable i ]
Signed-off-by: Peter Huewe <[email protected]>
  • Loading branch information
andy-shev authored and PeterHuewe committed Jul 29, 2014
1 parent 8e54caf commit a3d64df
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/char/tpm/tpm_eventlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
int len = 0;
int i;
char *eventname;
struct tcpa_event *event = v;
unsigned char *event_entry =
Expand All @@ -251,8 +250,7 @@ static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v)
seq_printf(m, "%2d ", event->pcr_index);

/* 2nd: SHA1 */
for (i = 0; i < 20; i++)
seq_printf(m, "%02x", event->pcr_value[i]);
seq_printf(m, "%20phN", event->pcr_value);

/* 3rd: event type identifier */
seq_printf(m, " %02x", event->event_type);
Expand Down

0 comments on commit a3d64df

Please sign in to comment.