mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] efi/tpm: fix a compilation warning
@ 2019-06-11 12:59 Qian Cai
  2019-06-13  8:55 ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Qian Cai @ 2019-06-11 12:59 UTC (permalink / raw)
  To: ard.biesheuvel
  Cc: mjg59, linux-efi, bsz, jarkko.sakkinen, linux-kernel, Qian Cai

The linux-next "tpm: Reserve the TPM final events table" [1] introduced
a compilation warning,

drivers/firmware/efi/tpm.c: In function 'efi_tpm_eventlog_init':
drivers/firmware/efi/tpm.c:80:10: warning: passing argument 1 of
'tpm2_calc_event_log_size' makes pointer from integer without a cast
[-Wint-conversion]
  tbl_size = tpm2_calc_event_log_size(efi.tpm_final_log
drivers/firmware/efi/tpm.c:19:43: note: expected 'void *' but argument
is of type 'long unsigned int'

Fix it by making a necessary cast for the argument 1 of
tpm2_calc_event_log_size().

[1] https://lore.kernel.org/linux-efi/20190520205501.177637-3-matthewgarrett@google.com/

Signed-off-by: Qian Cai <cai@lca.pw>
---
 drivers/firmware/efi/tpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c
index 74d0cd1647b8..1d3f5ca3eaaf 100644
--- a/drivers/firmware/efi/tpm.c
+++ b/drivers/firmware/efi/tpm.c
@@ -75,7 +75,7 @@ int __init efi_tpm_eventlog_init(void)
 		goto out;
 	}
 
-	tbl_size = tpm2_calc_event_log_size(efi.tpm_final_log
+	tbl_size = tpm2_calc_event_log_size((void *)efi.tpm_final_log
 					    + sizeof(final_tbl->version)
 					    + sizeof(final_tbl->nr_events),
 					    final_tbl->nr_events,
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-06-13 15:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11 12:59 [PATCH -next] efi/tpm: fix a compilation warning Qian Cai
2019-06-13  8:55 ` Arnd Bergmann
2019-06-13 11:41   ` Bartosz Szczepanek
2019-06-13 12:40     ` Arnd Bergmann
2019-06-13 13:23       ` Bartosz Szczepanek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®