diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2014-07-09 08:34:41 -0400 |
---|---|---|
committer | Peter Huewe <peterhuewe@gmx.de> | 2014-07-29 17:10:56 -0400 |
commit | a3d64df849bcb84220bf6db5773a10eee1fad4dc (patch) | |
tree | f742576f646c436f741d4a3449bd50b79a131e52 /drivers/char | |
parent | 8e54caf407b98efa05409e1fee0e5381abd2b088 (diff) |
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
[ PHuewe: removed now unused variable i ]
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tpm/tpm_eventlog.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/char/tpm/tpm_eventlog.c b/drivers/char/tpm/tpm_eventlog.c index 59f7cb28260b..3a56a131586c 100644 --- a/drivers/char/tpm/tpm_eventlog.c +++ b/drivers/char/tpm/tpm_eventlog.c | |||
@@ -235,7 +235,6 @@ static int tpm_bios_measurements_release(struct inode *inode, | |||
235 | static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v) | 235 | static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v) |
236 | { | 236 | { |
237 | int len = 0; | 237 | int len = 0; |
238 | int i; | ||
239 | char *eventname; | 238 | char *eventname; |
240 | struct tcpa_event *event = v; | 239 | struct tcpa_event *event = v; |
241 | unsigned char *event_entry = | 240 | unsigned char *event_entry = |
@@ -251,8 +250,7 @@ static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v) | |||
251 | seq_printf(m, "%2d ", event->pcr_index); | 250 | seq_printf(m, "%2d ", event->pcr_index); |
252 | 251 | ||
253 | /* 2nd: SHA1 */ | 252 | /* 2nd: SHA1 */ |
254 | for (i = 0; i < 20; i++) | 253 | seq_printf(m, "%20phN", event->pcr_value); |
255 | seq_printf(m, "%02x", event->pcr_value[i]); | ||
256 | 254 | ||
257 | /* 3rd: event type identifier */ | 255 | /* 3rd: event type identifier */ |
258 | seq_printf(m, " %02x", event->event_type); | 256 | seq_printf(m, " %02x", event->event_type); |