summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2023-04-19 10:14:25 +0200
committerLean Sheng Tan <sheng.tan@9elements.com>2023-05-13 09:30:21 +0000
commit4ffce7e8acdcfa55c6fb23ae14c5e2ab7c172c72 (patch)
treeb7970f87e986015794d551e519166e238e1a7602
parentbd429063d93e7fa95df64e05c8532c32cc6c5e26 (diff)
downloadcoreboot-4ffce7e8acdcfa55c6fb23ae14c5e2ab7c172c72.tar.gz
coreboot-4ffce7e8acdcfa55c6fb23ae14c5e2ab7c172c72.tar.bz2
coreboot-4ffce7e8acdcfa55c6fb23ae14c5e2ab7c172c72.zip
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 <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/74553 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
-rw-r--r--src/soc/mediatek/mt8195/apusys_devapc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/soc/mediatek/mt8195/apusys_devapc.c b/src/soc/mediatek/mt8195/apusys_devapc.c
index d5f89786e571..0c8d10fa28be 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;
}