diff options
author | Julius Werner <jwerner@chromium.org> | 2020-07-29 17:39:21 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-08-03 05:15:15 +0000 |
commit | 3e034b6e9aaddcca1996773b25d2ee88940d1144 (patch) | |
tree | efb1a415a83fa68fed21d14f4f407ced7b1d545f /src/soc | |
parent | c435d3daa71005d190373ee00a6491520b542eaa (diff) | |
download | coreboot-3e034b6e9aaddcca1996773b25d2ee88940d1144.tar.xz |
Change all assert(0) to BUG()
I would like to make assertions evaluate at compile time where possible,
but sometimes people used a literal assert(0) to force an assertion in a
certain code path. We already have BUG() for that so let's just replace
those instances with that.
Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: I674e5f8ec7f5fe8b92b1c7c95d9f9202d422ce32
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44047
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/amd/common/block/gpio_banks/gpio.c | 2 | ||||
-rw-r--r-- | src/soc/amd/picasso/reset.c | 2 | ||||
-rw-r--r-- | src/soc/intel/common/block/gpio/gpio.c | 2 | ||||
-rw-r--r-- | src/soc/mediatek/mt8183/mt6358.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/soc/amd/common/block/gpio_banks/gpio.c b/src/soc/amd/common/block/gpio_banks/gpio.c index b9646b9412..4f1b842311 100644 --- a/src/soc/amd/common/block/gpio_banks/gpio.c +++ b/src/soc/amd/common/block/gpio_banks/gpio.c @@ -28,7 +28,7 @@ static void program_smi(uint32_t flags, int gevent_num) if (!is_gpio_event_level_triggered(flags)) { printk(BIOS_ERR, "ERROR: %s - Only level trigger allowed for SMI!\n", __func__); - assert(0); + BUG(); return; } diff --git a/src/soc/amd/picasso/reset.c b/src/soc/amd/picasso/reset.c index b6aeb1fb54..902538ff6c 100644 --- a/src/soc/amd/picasso/reset.c +++ b/src/soc/amd/picasso/reset.c @@ -49,6 +49,6 @@ void chipset_handle_reset(uint32_t status) { printk(BIOS_ERR, "Error: unexpected call to %s(0x%08x). Doing cold reset.\n", __func__, status); - assert(0); + BUG(); do_cold_reset(); } diff --git a/src/soc/intel/common/block/gpio/gpio.c b/src/soc/intel/common/block/gpio/gpio.c index ee91aa6550..d6958b111f 100644 --- a/src/soc/intel/common/block/gpio/gpio.c +++ b/src/soc/intel/common/block/gpio/gpio.c @@ -78,7 +78,7 @@ static inline size_t gpio_group_index(const struct pad_community *comm, } printk(BIOS_ERR, "%s: pad %d is not found in community %s!\n", __func__, relative_pad, comm->name); - assert(0); + BUG(); return i; } diff --git a/src/soc/mediatek/mt8183/mt6358.c b/src/soc/mediatek/mt8183/mt6358.c index 7b4febc56d..6e6e43a6c4 100644 --- a/src/soc/mediatek/mt8183/mt6358.c +++ b/src/soc/mediatek/mt8183/mt6358.c @@ -831,7 +831,7 @@ void pmic_set_vsim2_cali(unsigned int vsim2_mv) break; default: - assert(0); + BUG(); return; }; |