src/security: Use "if (!ptr)" in preference to "if (ptr == NULL)"
Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: I3def65c016015d8213824e6b8561d8a67b6d5cf0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/67579 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
parent
a6b41f2fd0
commit
aebccac7e1
6 changed files with 10 additions and 10 deletions
|
|
@ -55,7 +55,7 @@ static uint32_t tlcl_send_startup(TPM_SU type)
|
|||
response = tpm_process_command(TPM2_Startup, &startup);
|
||||
|
||||
/* IO error, tpm2_response pointer is empty. */
|
||||
if (response == NULL) {
|
||||
if (!response) {
|
||||
printk(BIOS_ERR, "%s: TPM communication error\n", __func__);
|
||||
return TPM_E_IOERROR;
|
||||
}
|
||||
|
|
@ -89,7 +89,7 @@ static uint32_t tlcl_send_shutdown(TPM_SU type)
|
|||
response = tpm_process_command(TPM2_Shutdown, &shutdown);
|
||||
|
||||
/* IO error, tpm2_response pointer is empty. */
|
||||
if (response == NULL) {
|
||||
if (!response) {
|
||||
printk(BIOS_ERR, "%s: TPM communication error\n", __func__);
|
||||
return TPM_E_IOERROR;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -517,7 +517,7 @@ static int unmarshal_TPM2B_MAX_NV_BUFFER(struct ibuf *ib,
|
|||
|
||||
nv_buffer->t.buffer = ibuf_oob_drain(ib, nv_buffer->t.size);
|
||||
|
||||
if (nv_buffer->t.buffer == NULL) {
|
||||
if (!nv_buffer->t.buffer) {
|
||||
printk(BIOS_ERR, "%s:%d - "
|
||||
"size mismatch: expected %d, remaining %zd\n",
|
||||
__func__, __LINE__, nv_buffer->t.size,
|
||||
|
|
|
|||
2
src/security/tpm/tss/vendor/cr50/cr50.c
vendored
2
src/security/tpm/tss/vendor/cr50/cr50.c
vendored
|
|
@ -18,7 +18,7 @@ uint32_t tlcl_cr50_enable_nvcommits(void)
|
|||
|
||||
response = tpm_process_command(TPM2_CR50_VENDOR_COMMAND, &sub_command);
|
||||
|
||||
if (response == NULL || (response && response->hdr.tpm_code)) {
|
||||
if (!response || (response && response->hdr.tpm_code)) {
|
||||
if (response)
|
||||
printk(BIOS_INFO, "%s: failed %x\n", __func__,
|
||||
response->hdr.tpm_code);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue