From: Qian Cai <cai@lca.pw>
To: ard.biesheuvel@linaro.org
Cc: mjg59@google.com, linux-efi@vger.kernel.org, bsz@semihalf.com,
jarkko.sakkinen@linux.intel.com, linux-kernel@vger.kernel.org,
Qian Cai <cai@lca.pw>
Subject: [PATCH -next] efi/tpm: fix a compilation warning
Date: Tue, 11 Jun 2019 08:59:04 -0400 [thread overview]
Message-ID: <20190611125904.1013-1-cai@lca.pw> (raw)
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)
next reply other threads:[~2019-06-11 12:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-11 12:59 Qian Cai [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190611125904.1013-1-cai@lca.pw \
--to=cai@lca.pw \
--cc=ard.biesheuvel@linaro.org \
--cc=bsz@semihalf.com \
--cc=jarkko.sakkinen@linux.intel.com \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg59@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®