From 4ffce7e8acdcfa55c6fb23ae14c5e2ab7c172c72 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Wed, 19 Apr 2023 10:14:25 +0200 Subject: soc/mediatek/mt8195/apusys_devapc.c: Fix unsigned comparison Clang warns about unsigned comparison below 0. Use the enum value itself to fix this warning. Change-Id: I12fccff2fb7d43fd4582afd518a7eab632908a5f Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/74553 Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) Reviewed-by: Elyes Haouas --- src/soc/mediatek/mt8195/apusys_devapc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/soc/mediatek') diff --git a/src/soc/mediatek/mt8195/apusys_devapc.c b/src/soc/mediatek/mt8195/apusys_devapc.c index d5f89786e5..0c8d10fa28 100644 --- a/src/soc/mediatek/mt8195/apusys_devapc.c +++ b/src/soc/mediatek/mt8195/apusys_devapc.c @@ -151,7 +151,7 @@ static int set_slave_noc_dapc(u32 slave, enum domain_id domain_id, enum devapc_p u32 apc_set_index; u32 *base; - if (perm >= PERM_NUM || perm < 0) { + if (perm >= PERM_NUM || perm < NO_PROTECTION) { printk(BIOS_ERR, "[NOC_DAPC] permission type:%#x is not supported!\n", perm); return APUSYS_APC_ERR_PERMISSION_NOT_SUPPORTED; } @@ -192,7 +192,7 @@ static int set_slave_apc(u32 slave, enum domain_id domain_id, enum devapc_perm_t u32 apc_set_index; u32 *base; - if (perm >= PERM_NUM || perm < 0) { + if (perm >= PERM_NUM || perm < NO_PROTECTION) { printk(BIOS_ERR, "[APUAPC] perm type:%#x is not supported!\n", perm); return APUSYS_APC_ERR_PERMISSION_NOT_SUPPORTED; } -- cgit v1.2.3