grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/6] tpm: Drop unneeded code


From: Daniel Kiper
Subject: Re: [PATCH 4/6] tpm: Drop unneeded code
Date: Fri, 29 May 2020 13:44:50 +0200
User-agent: NeoMutt/20170113 (1.7.2)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]