Yu-Ping Wu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36231 )
Change subject: soc/mediatek/mt8183: Fix incorrect usage of sizeof ......................................................................
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 --- M src/soc/mediatek/mt8183/mt6358.c 1 file changed, 4 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/36231/1
diff --git a/src/soc/mediatek/mt8183/mt6358.c b/src/soc/mediatek/mt8183/mt6358.c index 61b1211..cee9ef2 100644 --- a/src/soc/mediatek/mt8183/mt6358.c +++ b/src/soc/mediatek/mt8183/mt6358.c @@ -798,7 +798,7 @@ 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 @@
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 @@ 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);
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36231 )
Change subject: soc/mediatek/mt8183: Fix incorrect usage of sizeof ......................................................................
Patch Set 1: Code-Review+2
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36231 )
Change subject: soc/mediatek/mt8183: Fix incorrect usage of sizeof ......................................................................
Patch Set 1: Code-Review+1