summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2022-09-13 09:57:30 +0200
committerFelix Held <felix-coreboot@felixheld.de>2022-09-14 12:49:44 +0000
commit0f1fb8a8685148e2bad299285a62e98a59c9f9b4 (patch)
treeae063e5ed4af95cfab56858a1a4eb981e214824a /src
parent5e6b0f0cac4ba5cde6114325ea69ec0e98c7e08f (diff)
soc/mediatek: Use "if (!ptr)" in preference to "if (ptr == NULL)"
Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: I9cf4097518034fa4c3ae1899840ae3a276936f80 Reviewed-on: https://review.coreboot.org/c/coreboot/+/67581 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/soc/mediatek/common/clkbuf.c4
-rw-r--r--src/soc/mediatek/common/msdc.c2
-rw-r--r--src/soc/mediatek/common/pmic_wrap.c2
-rw-r--r--src/soc/mediatek/common/rtc_mt6359p.c4
-rw-r--r--src/soc/mediatek/mt8192/srclken_rc.c2
5 files changed, 7 insertions, 7 deletions
diff --git a/src/soc/mediatek/common/clkbuf.c b/src/soc/mediatek/common/clkbuf.c
index 735457122f..60f53a77b0 100644
--- a/src/soc/mediatek/common/clkbuf.c
+++ b/src/soc/mediatek/common/clkbuf.c
@@ -30,7 +30,7 @@ static u32 buf_read(u32 addr)
{
u32 rdata;
- if (pmif_arb == NULL)
+ if (!pmif_arb)
pmif_arb = get_pmif_controller(PMIF_SPI, 0);
pmif_arb->read(pmif_arb, 0, addr, &rdata);
@@ -39,7 +39,7 @@ static u32 buf_read(u32 addr)
static void buf_write(u32 addr, u32 wdata)
{
- if (pmif_arb == NULL)
+ if (!pmif_arb)
pmif_arb = get_pmif_controller(PMIF_SPI, 0);
pmif_arb->write(pmif_arb, 0, addr, wdata);
}
diff --git a/src/soc/mediatek/common/msdc.c b/src/soc/mediatek/common/msdc.c
index 6e0086ba75..c6f77abc5c 100644
--- a/src/soc/mediatek/common/msdc.c
+++ b/src/soc/mediatek/common/msdc.c
@@ -443,7 +443,7 @@ static void set_early_mmc_wake_status(int32_t status)
ms_cbmem = cbmem_add(CBMEM_ID_MMC_STATUS, sizeof(status));
- if (ms_cbmem == NULL) {
+ if (!ms_cbmem) {
printk(BIOS_ERR,
"%s: Failed to add early mmc wake status to cbmem!\n",
__func__);
diff --git a/src/soc/mediatek/common/pmic_wrap.c b/src/soc/mediatek/common/pmic_wrap.c
index d732994e4b..45db8b05db 100644
--- a/src/soc/mediatek/common/pmic_wrap.c
+++ b/src/soc/mediatek/common/pmic_wrap.c
@@ -135,7 +135,7 @@ s32 pwrap_wacs2(u32 write, u16 addr, u16 wdata, u16 *rdata, u32 init_check)
write32(&mtk_pwrap->wacs2_cmd, wacs_cmd);
if (write == 0) {
- if (rdata == NULL) {
+ if (!rdata) {
pwrap_err("rdata is a NULL pointer\n");
return E_PWR_INVALID_ARG;
}
diff --git a/src/soc/mediatek/common/rtc_mt6359p.c b/src/soc/mediatek/common/rtc_mt6359p.c
index 2b5611bb15..a930aacb87 100644
--- a/src/soc/mediatek/common/rtc_mt6359p.c
+++ b/src/soc/mediatek/common/rtc_mt6359p.c
@@ -15,7 +15,7 @@ void rtc_read(u16 addr, u16 *rdata)
{
u32 data;
- if (pmif_arb == NULL)
+ if (!pmif_arb)
pmif_arb = get_pmif_controller(PMIF_SPI, 0);
pmif_arb->read(pmif_arb, 0, (u32)addr, &data);
@@ -24,7 +24,7 @@ void rtc_read(u16 addr, u16 *rdata)
void rtc_write(u16 addr, u16 wdata)
{
- if (pmif_arb == NULL)
+ if (!pmif_arb)
pmif_arb = get_pmif_controller(PMIF_SPI, 0);
pmif_arb->write(pmif_arb, 0, (unsigned int)addr, (unsigned int)wdata);
}
diff --git a/src/soc/mediatek/mt8192/srclken_rc.c b/src/soc/mediatek/mt8192/srclken_rc.c
index f6790c6898..0c5b8896d9 100644
--- a/src/soc/mediatek/mt8192/srclken_rc.c
+++ b/src/soc/mediatek/mt8192/srclken_rc.c
@@ -118,7 +118,7 @@ static void pmic_read(u32 addr, u32 *rdata)
{
static struct pmif *pmif_arb;
- if (pmif_arb == NULL)
+ if (!pmif_arb)
pmif_arb = get_pmif_controller(PMIF_SPI, 0);
pmif_arb->read(pmif_arb, 0, addr, rdata);