Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andy Shevchenko and committed by
Peter Huewe
a3d64df8 8e54caf4

+1 -3
+1 -3
drivers/char/tpm/tpm_eventlog.c
··· 235 235 static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v) 236 236 { 237 237 int len = 0; 238 - int i; 239 238 char *eventname; 240 239 struct tcpa_event *event = v; 241 240 unsigned char *event_entry = ··· 250 251 seq_printf(m, "%2d ", event->pcr_index); 251 252 252 253 /* 2nd: SHA1 */ 253 - for (i = 0; i < 20; i++) 254 - seq_printf(m, "%02x", event->pcr_value[i]); 254 + seq_printf(m, "%20phN", event->pcr_value); 255 255 256 256 /* 3rd: event type identifier */ 257 257 seq_printf(m, " %02x", event->event_type);