Skip to contentSkip to conversation

drivers: firmware: efi: fix gcc warning -Wint-conversion

PATCH In review Hariprasad Kelam 4 participants 6 messages Jun 15, 2019 – Jun 24, 2019 EFI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: firmware: efi: fix gcc warning -Wint-conversion

This patch fixes below warning

drivers/firmware/efi/tpm.c:78:38: warning: passing argument 1 of ‘tpm2_calc_event_log_size’ makes pointer from integer without a cast [-Wint-conversion]

---
 drivers/firmware/efi/tpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/tpm.c +1 -1
index 74d0cd1..1d3f5ca 100644
@@ -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,
Signature · 1 line
2.7.4
#1 lore raw

(+ Jarkko, tpmdd, Matthew)

Quoted 8 lines · Hariprasad Kelam

This patch fixes below warning

drivers/firmware/efi/tpm.c:78:38: warning: passing argument 1 of ‘tpm2_calc_event_log_size’ makes pointer from integer without a cast [-Wint-conversion]

I think we already have a fix queued for this, no?

Quoted 20 lines
---
 drivers/firmware/efi/tpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/tpm.c +1 -2
index 74d0cd1..1d3f5ca 100644
@@ -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.7.4

#2 lore raw
Quoted 8 lines · Ard Biesheuvel

(+ Jarkko, tpmdd, Matthew)

Quoted 3 lines · Hariprasad Kelam

This patch fixes below warning

Quoted 7 lines
Quoted 5 lines

drivers/firmware/efi/tpm.c:78:38: warning: passing argument 1 of ‘tpm2_calc_event_log_size’ makes pointer from integer without a cast [-Wint-conversion]

I think we already have a fix queued for this, no?

It looks like I fixed this in "Don't duplicate events from the final event log in the TCG2 log" rather than a separate patch - I'm fine merging this, based on Jarkko's preferences.

#3 lore raw
Quoted 14 lines · Matthew Garrett
Quoted 12 lines · Ard Biesheuvel

(+ Jarkko, tpmdd, Matthew)

Quoted 7 lines · Hariprasad Kelam

This patch fixes below warning

drivers/firmware/efi/tpm.c:78:38: warning: passing argument 1 of ‘tpm2_calc_event_log_size’ makes pointer from integer without a cast [-Wint-conversion]

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

I think we already have a fix queued for this, no?

It looks like I fixed this in "Don't duplicate events from the final event log in the TCG2 log" rather than a separate patch - I'm fine merging this, based on Jarkko's preferences.

Right! OK, I squashed just the fix to the earlier patch. Master and next are updated. Can you take a peek of [1] and see if it looks legit given all the fuzz around these changes? Then I'm confident enough to do the 5.3 PR.

[1] git://git.infradead.org/users/jjs/linux-tpmdd.git

/Jarkko

#4 lore raw
Quoted 4 lines · Jarkko Sakkinen

Right! OK, I squashed just the fix to the earlier patch. Master and next are updated. Can you take a peek of [1] and see if it looks legit given all the fuzz around these changes? Then I'm confident enough to do the 5.3 PR.

All looks good to me. Thanks!

#5 lore raw
Quoted 8 lines · Matthew Garrett
Quoted 4 lines · Jarkko Sakkinen

Right! OK, I squashed just the fix to the earlier patch. Master and next are updated. Can you take a peek of [1] and see if it looks legit given all the fuzz around these changes? Then I'm confident enough to do the 5.3 PR.

All looks good to me. Thanks!

Thank you! I'll send the PR now.

/Jarkko