diff options
author | Yu-Ping Wu <yupingso@google.com> | 2019-10-22 16:54:44 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-10-23 13:35:59 +0000 |
commit | 42ec48032aecbf420d8fd3d72eb64ecf9de087f9 (patch) | |
tree | c8a73ec4ad74ebbd5530a644dae026ffb2300d7f /src/soc | |
parent | b6ca93839d9e82bff060125e742dff1b2260c5d5 (diff) | |
download | coreboot-42ec48032aecbf420d8fd3d72eb64ecf9de087f9.tar.xz |
soc/mediatek/mt8183: Fix incorrect usage of sizeof
BRANCH=kukui
BUG=none
TEST=emerge-kukui coreboot
Change-Id: Ic2f6bfaf42aed642e1d7d6aba5db373944eb8ef6
Signed-off-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36231
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/mediatek/mt8183/mt6358.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/soc/mediatek/mt8183/mt6358.c b/src/soc/mediatek/mt8183/mt6358.c index 61b1211b8e..cee9ef2239 100644 --- a/src/soc/mediatek/mt8183/mt6358.c +++ b/src/soc/mediatek/mt8183/mt6358.c @@ -798,7 +798,7 @@ static unsigned int pmic_read_efuse(int i) static int pmic_get_efuse_votrim(void) { const unsigned int cali_efuse = pmic_read_efuse(104) & 0xF; - assert(cali_efuse < sizeof(vddq_votrim)); + assert(cali_efuse < ARRAY_SIZE(vddq_votrim)); return vddq_votrim[cali_efuse]; } @@ -907,7 +907,7 @@ unsigned int pmic_get_vddq_vol(void) efuse_votrim = pmic_get_efuse_votrim(); cali_trim = pwrap_read_field(PMIC_VDDQ_ELR_0, 0xF, 0); - assert(cali_trim < sizeof(vddq_votrim)); + assert(cali_trim < ARRAY_SIZE(vddq_votrim)); return 600 * 1000 - efuse_votrim + vddq_votrim[cali_trim]; } @@ -930,10 +930,10 @@ void pmic_set_vddq_vol(unsigned int vddq_uv) cali_trim = 7; else { cali_trim = 0; - while (cali_trim < sizeof(vddq_votrim) && + while (cali_trim < ARRAY_SIZE(vddq_votrim) && vddq_votrim[cali_trim] != cali_offset_uv) ++cali_trim; - assert(cali_trim < sizeof(vddq_votrim)); + assert(cali_trim < ARRAY_SIZE(vddq_votrim)); } pwrap_write_field(PMIC_TOP_TMA_KEY, 0x9CA7, 0xFFFF, 0); |