tpm2: Rearrange code in _plat__IsNvAvailable to avoid unused var

Rerrange the code in _plat__IsNvavailable to avoid an unused
variable.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2019-05-29 13:41:59 -04:00 committed by Stefan Berger
parent 1b2c4fc5b9
commit bca3109634

View File

@ -291,15 +291,15 @@ _plat__IsNvAvailable(
)
{
int retVal = 0;
// NV is not available if the TPM is in failure mode
if(!s_NvIsAvailable)
retVal = 1;
#ifdef TPM_LIBTPMS_CALLBACKS
if (libtpms_plat__IsNvAvailable() == 1)
return 0;
#endif /* TPM_LIBTPMS_CALLBACKS */
// NV is not available if the TPM is in failure mode
if(!s_NvIsAvailable)
retVal = 1;
#if FILE_BACKED_NV
else
retVal = (s_NvFile == NULL);