tpm/tss: Remove local variable

Depending on how the "middle-end" (yes, the gcc developers are
serious about that) optimizer ends up mangling the code, there may
or may not be a complaint about x being used uninitialized when it's
clearly not used at all.

So instead, why keep x in the first place? memcpy(foo, NULL, 0) is
the same as memcpy(foo, some_uninitialized_variable, 0) in that it
does nothing.

Change-Id: Ib0a97c3e3fd1a2a6aff37da63376373c88ac595d
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55499
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Patrick Georgi 2021-06-14 17:12:58 +02:00
parent 47ad2ae3f9
commit a5061f8f57
1 changed files with 1 additions and 2 deletions

View File

@ -327,9 +327,8 @@ uint32_t tlcl_get_flags(uint8_t *disable, uint8_t *deactivated,
uint32_t tlcl_set_global_lock(void)
{
uint32_t x;
VBDEBUG("TPM: Set global lock\n");
return tlcl_write(TPM_NV_INDEX0, (uint8_t *) &x, 0);
return tlcl_write(TPM_NV_INDEX0, NULL, 0);
}
uint32_t tlcl_extend(int pcr_num, const uint8_t *in_digest,