fix(arm-drivers): typecast operands to match data type
This corrects the MISRA violation C2012-10.3:
The value of an expression shall not be assigned to an object with a
narrower essential type or of a different essential type category.
The condition is explicitly checked against 0U, appending 'U' and
typecasting for unsigned comparison.
Change-Id: I6464ba742af81a2fffe9782d032275486d32f3a1
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
diff --git a/drivers/arm/gic/v2/gicdv2_helpers.c b/drivers/arm/gic/v2/gicdv2_helpers.c
index 2f3f7f8..464bb34 100644
--- a/drivers/arm/gic/v2/gicdv2_helpers.c
+++ b/drivers/arm/gic/v2/gicdv2_helpers.c
@@ -320,7 +320,7 @@
void gicd_set_ipriorityr(uintptr_t base, unsigned int id, unsigned int pri)
{
- uint8_t val = pri & GIC_PRI_MASK;
+ uint8_t val = (uint8_t)(pri & GIC_PRI_MASK);
mmio_write_8(base + GICD_IPRIORITYR + id, val);
}