[prev in list] [next in list] [prev in thread] [next in thread] 

List:       grub-devel
Subject:    Re: [PATCH 4/6] tpm: Drop unneeded code
From:       Daniel Kiper <dkiper () net-space ! pl>
Date:       2020-05-29 11:44:50
Message-ID: 20200529114450.rc2np53lry3hdved () tomti ! i ! net-space ! pl
[Download RAW message or body]

On Thu, May 28, 2020 at 09:22:34AM +0200, Javier Martinez Canillas wrote:
> On 5/25/20 9:02 PM, Daniel Kiper wrote:
> > Drop unused grub_tpm*_execute() and declaration of nonexistent grub_tpm_init().
> >
> > Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> > ---
>
> [snip]
>
> > -static grub_err_t
> > -grub_tpm2_execute (grub_efi_handle_t tpm_handle,
> > -                   PassThroughToTPM_InputParamBlock *inbuf,
> > -                   PassThroughToTPM_OutputParamBlock *outbuf)
> > -{
> > -  grub_efi_status_t status;
> > -  grub_efi_tpm2_protocol_t *tpm;
> > -  grub_uint32_t inhdrsize = sizeof (*inbuf) - sizeof (inbuf->TPMOperandIn);
> > -  grub_uint32_t outhdrsize =
> > -    sizeof (*outbuf) - sizeof (outbuf->TPMOperandOut);
> > -
> > -  tpm = grub_efi_open_protocol (tpm_handle, &tpm2_guid,
> > -				GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL);
> > -
> > -  if (!grub_tpm2_present (tpm))
> > -    return 0;
> > -
> > -  /* UEFI TPM protocol takes the raw operand block, no param block header. */
> > -  status = efi_call_5 (tpm->submit_command, tpm,
> > -		       inbuf->IPBLength - inhdrsize, inbuf->TPMOperandIn,
> > -		       outbuf->OPBLength - outhdrsize, outbuf->TPMOperandOut);
> > -
>
> I think this would be useful if we ever add support for sending TPM commands.
> But I agree that should be removed since is unused and can always be brought
> back from the git history if needed.

Yeah, I was thinking about mentioning something about this but later
forgot about it. I will add following clarification to the commit
message before pushing the patch:
  If somebody needs the functionality implemented in the dropped code then
  he/she can readd it later. Now it only increases the GRUB code/image size.

> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

Thanks a lot for review!

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic