From: Yann Gautier Date: Thu, 24 Nov 2022 18:16:46 +0000 (+0100) Subject: fix(st): rework secure-status check in fdt_get_status() X-Git-Tag: baikal/aarch64/sdk5.10~1^2~313^2~3 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=0ebaf222899c1c33fe8bd0e69bd2c287ebe1154b;p=arm-tf.git fix(st): rework secure-status check in fdt_get_status() This corrects MISRA C2012-15.7: All if...else if constructs shall be terminated with an else statement. Signed-off-by: Yann Gautier Change-Id: I3d893d0db0a448323270086923563147008c59b9 --- diff --git a/plat/st/common/stm32mp_dt.c b/plat/st/common/stm32mp_dt.c index 5a5ca565d..6ec428c57 100644 --- a/plat/st/common/stm32mp_dt.c +++ b/plat/st/common/stm32mp_dt.c @@ -79,11 +79,8 @@ uint8_t fdt_get_status(int node) } cchar = fdt_getprop(fdt, node, "secure-status", NULL); - if (cchar == NULL) { - if (status == DT_NON_SECURE) { - status |= DT_SECURE; - } - } else if (strncmp(cchar, "okay", strlen("okay")) == 0) { + if (((cchar == NULL) && (status == DT_NON_SECURE)) || + ((cchar != NULL) && (strncmp(cchar, "okay", strlen("okay")) == 0))) { status |= DT_SECURE; }