diff options
| author | Taticharla Venkata Sai <venkatasai.taticharla@amd.com> | 2025-07-20 16:17:05 +0530 |
|---|---|---|
| committer | Manish Pandey <manish.pandey2@arm.com> | 2026-01-08 16:31:27 +0000 |
| commit | 6de7520a3b997a246d341b7df465844d5574a08d (patch) | |
| tree | e40627b13ad3de1ffb390189d1f569c463af7fb0 | |
| parent | dee3312e6c62a078c3204bf715248dfdf7288906 (diff) | |
| download | arm-trusted-firmware-6de7520a3b997a246d341b7df465844d5574a08d.tar.gz arm-trusted-firmware-6de7520a3b997a246d341b7df465844d5574a08d.zip | |
fix(el3-runtime): resolve essential-type mismatch
This resolves MISRA C:2012 Rule 10.7 violation
where a composite expression involved operands of differing
essential types, causing unintended implicit conversions.
The fix ensures all operands in the expression have matching
essential types by introducing explicit casts,
preventing unsafe or inconsistent arithmetic operations.
Change-Id: If01dfe78e7a5cffc8b0efa6ac969b262e236852b
Signed-off-by: Taticharla Venkata Sai <venkatasai.taticharla@amd.com>
| -rw-r--r-- | include/lib/smccc.h | 4 | ||||
| -rw-r--r-- | plat/xilinx/versal/sip_svc_setup.c | 2 | ||||
| -rw-r--r-- | plat/xilinx/zynqmp/sip_svc_setup.c | 2 | ||||
| -rw-r--r-- | services/arm_arch_svc/arm_arch_svc_setup.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/include/lib/smccc.h b/include/lib/smccc.h index 775c2b21b..2ba3351d8 100644 --- a/include/lib/smccc.h +++ b/include/lib/smccc.h @@ -107,7 +107,7 @@ #define SMC_64 U(1) #define SMC_32 U(0) -#define SMC_TYPE_FAST UL(1) +#define SMC_TYPE_FAST U(1) #define SMC_TYPE_YIELD UL(0) #define SMC_OK ULL(0) @@ -178,7 +178,7 @@ /* The macro below is used to identify a valid Fast SMC call */ #define is_valid_fast_smc(_fid) ((!(((_fid) >> 16) & U(0xff))) && \ (GET_SMC_TYPE(_fid) \ - == (uint32_t)SMC_TYPE_FAST)) + == SMC_TYPE_FAST)) /* * Macro to define UUID for services. Apart from defining and initializing a diff --git a/plat/xilinx/versal/sip_svc_setup.c b/plat/xilinx/versal/sip_svc_setup.c index ac4f5e02b..b7f56aa87 100644 --- a/plat/xilinx/versal/sip_svc_setup.c +++ b/plat/xilinx/versal/sip_svc_setup.c @@ -122,6 +122,6 @@ DECLARE_RT_SVC( sip_svc, OEN_SIP_START, OEN_SIP_END, - (uint8_t)SMC_TYPE_FAST, + SMC_TYPE_FAST, sip_svc_setup, sip_svc_smc_handler); diff --git a/plat/xilinx/zynqmp/sip_svc_setup.c b/plat/xilinx/zynqmp/sip_svc_setup.c index 534eb33cc..74c13aacf 100644 --- a/plat/xilinx/zynqmp/sip_svc_setup.c +++ b/plat/xilinx/zynqmp/sip_svc_setup.c @@ -121,6 +121,6 @@ DECLARE_RT_SVC( sip_svc, OEN_SIP_START, OEN_SIP_END, - (uint8_t)SMC_TYPE_FAST, + SMC_TYPE_FAST, sip_svc_setup, sip_svc_smc_handler); diff --git a/services/arm_arch_svc/arm_arch_svc_setup.c b/services/arm_arch_svc/arm_arch_svc_setup.c index a2ff69aea..0221db078 100644 --- a/services/arm_arch_svc/arm_arch_svc_setup.c +++ b/services/arm_arch_svc/arm_arch_svc_setup.c @@ -337,7 +337,7 @@ DECLARE_RT_SVC( arm_arch_svc, OEN_ARM_START, OEN_ARM_END, - (uint8_t)SMC_TYPE_FAST, + SMC_TYPE_FAST, NULL, arm_arch_svc_smc_handler ); |
