From 0e378135c2b4ac1d9b35d809fd08718c0d08f219 Mon Sep 17 00:00:00 2001 From: Shruti Gupta Date: Tue, 5 Dec 2023 10:06:46 +0000 Subject: [PATCH] fix(rmm): fix MISRA C 2012 violations Fixes MISRA C 2012 Rules 10.4 violations. Change-Id: Iba47a119e3641cfd6a28172fa03c8b5ddfe102be Signed-off-by: Shruti Gupta --- lib/arch/include/simd.h | 18 +++--- lib/measurement/include/measurement.h | 36 +++++------ lib/realm/include/buffer.h | 2 +- lib/realm/src/buffer.c | 4 +- lib/rmm_el3_ifc/include/rmm_el3_ifc.h | 6 +- lib/smc/include/smc.h | 2 +- lib/smc/src/smc-rmi-offsets.c | 90 +++++++++++++-------------- lib/smc/src/smc-rsi-offsets.c | 18 +++--- lib/xlat/include/xlat_tables.h | 2 +- runtime/rmi/system.c | 4 +- 10 files changed, 91 insertions(+), 91 deletions(-) diff --git a/lib/arch/include/simd.h b/lib/arch/include/simd.h index 21a904bd..848179ec 100644 --- a/lib/arch/include/simd.h +++ b/lib/arch/include/simd.h @@ -22,17 +22,17 @@ * Z register. */ #define SVE_Z_REG_MIN_SIZE U(16) -#define SVE_P_REG_MIN_SIZE (SVE_Z_REG_MIN_SIZE / 8) -#define SVE_FFR_REG_MIN_SIZE (SVE_Z_REG_MIN_SIZE / 8) +#define SVE_P_REG_MIN_SIZE (SVE_Z_REG_MIN_SIZE / 8U) +#define SVE_FFR_REG_MIN_SIZE (SVE_Z_REG_MIN_SIZE / 8U) /* Number of Z, P, FFR registers */ #define SVE_Z_REG_NUM U(32) #define SVE_P_REG_NUM U(16) #define SVE_FFR_REG_NUM U(1) -#define SVE_Z_REGS_SIZE(vq) (((vq) + 1) * (SVE_Z_REG_MIN_SIZE * SVE_Z_REG_NUM)) -#define SVE_P_REGS_SIZE(vq) (((vq) + 1) * (SVE_P_REG_MIN_SIZE * SVE_P_REG_NUM)) -#define SVE_FFR_REGS_SIZE(vq) (((vq) + 1) * (SVE_FFR_REG_MIN_SIZE * \ +#define SVE_Z_REGS_SIZE(vq) (((vq) + 1U) * (SVE_Z_REG_MIN_SIZE * SVE_Z_REG_NUM)) +#define SVE_P_REGS_SIZE(vq) (((vq) + 1U) * (SVE_P_REG_MIN_SIZE * SVE_P_REG_NUM)) +#define SVE_FFR_REGS_SIZE(vq) (((vq) + 1U) * (SVE_FFR_REG_MIN_SIZE * \ SVE_FFR_REG_NUM)) /* SVE vq architecture limit */ @@ -178,10 +178,10 @@ struct simd_context { * TODO: Auto generate header file simd-asm-offsets.h during build and use it * in assembly routines. */ -COMPILER_ASSERT(offsetof(struct fpu_regs, q) == (size_t)FPU_REGS_OFFSET_Q); -COMPILER_ASSERT(offsetof(struct sve_regs, z) == (size_t)SVE_REGS_OFFSET_Z); -COMPILER_ASSERT(offsetof(struct sve_regs, p) == (size_t)SVE_REGS_OFFSET_P); -COMPILER_ASSERT(offsetof(struct sve_regs, ffr) == (size_t)SVE_REGS_OFFSET_FFR); +COMPILER_ASSERT((U(offsetof(struct fpu_regs, q))) == FPU_REGS_OFFSET_Q); +COMPILER_ASSERT((U(offsetof(struct sve_regs, z))) == SVE_REGS_OFFSET_Z); +COMPILER_ASSERT((U(offsetof(struct sve_regs, p))) == SVE_REGS_OFFSET_P); +COMPILER_ASSERT((U(offsetof(struct sve_regs, ffr))) == SVE_REGS_OFFSET_FFR); /* Initialize SIMD layer based on CPU support for FPU or SVE */ void simd_init(void); diff --git a/lib/measurement/include/measurement.h b/lib/measurement/include/measurement.h index 3a888f1e..1254b28c 100644 --- a/lib/measurement/include/measurement.h +++ b/lib/measurement/include/measurement.h @@ -65,14 +65,14 @@ struct measurement_desc_data { */ SET_MEMBER(unsigned char content[MAX_MEASUREMENT_SIZE], 0x60, 0x100); }; -COMPILER_ASSERT(sizeof(struct measurement_desc_data) == 0x100); +COMPILER_ASSERT(sizeof(struct measurement_desc_data) == 0x100UL); -COMPILER_ASSERT(offsetof(struct measurement_desc_data, desc_type) == 0x0); -COMPILER_ASSERT(offsetof(struct measurement_desc_data, len) == 0x8); -COMPILER_ASSERT(offsetof(struct measurement_desc_data, rim) == 0x10); -COMPILER_ASSERT(offsetof(struct measurement_desc_data, ipa) == 0x50); -COMPILER_ASSERT(offsetof(struct measurement_desc_data, flags) == 0x58); -COMPILER_ASSERT(offsetof(struct measurement_desc_data, content) == 0x60); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_data, desc_type)) == 0x0U); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_data, len)) == 0x8U); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_data, rim)) == 0x10U); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_data, ipa)) == 0x50U); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_data, flags)) == 0x58U); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_data, content)) == 0x60U); /* RmmMeasurementDescriptorRec type as per RMM spec */ struct measurement_desc_rec { @@ -85,12 +85,12 @@ struct measurement_desc_rec { /* Hash of 4KB page which contains REC parameters data structure */ SET_MEMBER(unsigned char content[MAX_MEASUREMENT_SIZE], 0x50, 0x100); }; -COMPILER_ASSERT(sizeof(struct measurement_desc_rec) == 0x100); +COMPILER_ASSERT(sizeof(struct measurement_desc_rec) == 0x100UL); -COMPILER_ASSERT(offsetof(struct measurement_desc_rec, desc_type) == 0x0); -COMPILER_ASSERT(offsetof(struct measurement_desc_rec, len) == 0x8); -COMPILER_ASSERT(offsetof(struct measurement_desc_rec, rim) == 0x10); -COMPILER_ASSERT(offsetof(struct measurement_desc_rec, content) == 0x50); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_rec, desc_type)) == 0x0U); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_rec, len)) == 0x8U); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_rec, rim)) == 0x10U); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_rec, content)) == 0x50U); /* RmmMeasurementDescriptorRipas type as per RMM spec */ struct measurement_desc_ripas { @@ -105,13 +105,13 @@ struct measurement_desc_ripas { /* Top IPA at which the RIPAS change occurred */ SET_MEMBER(unsigned long top, 0x58, 0x100); }; -COMPILER_ASSERT(sizeof(struct measurement_desc_ripas) == 0x100); +COMPILER_ASSERT(sizeof(struct measurement_desc_ripas) == 0x100UL); -COMPILER_ASSERT(offsetof(struct measurement_desc_ripas, desc_type) == 0x0); -COMPILER_ASSERT(offsetof(struct measurement_desc_ripas, len) == 0x8); -COMPILER_ASSERT(offsetof(struct measurement_desc_ripas, rim) == 0x10); -COMPILER_ASSERT(offsetof(struct measurement_desc_ripas, base) == 0x50); -COMPILER_ASSERT(offsetof(struct measurement_desc_ripas, top) == 0x58); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_ripas, desc_type)) == 0x0U); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_ripas, len)) == 0x8U); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_ripas, rim)) == 0x10U); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_ripas, base)) == 0x50U); +COMPILER_ASSERT(U(offsetof(struct measurement_desc_ripas, top)) == 0x58U); /* * Calculate the hash of data with algorithm hash_algo to the buffer `out`. diff --git a/lib/realm/include/buffer.h b/lib/realm/include/buffer.h index 3be166fb..20ea2db5 100644 --- a/lib/realm/include/buffer.h +++ b/lib/realm/include/buffer.h @@ -31,7 +31,7 @@ enum buffer_slot { * If the max aux granules is 0, no slots will * be reserved. */ - SLOT_RTT = SLOT_REC_AUX0 + MAX_REC_AUX_GRANULES, + SLOT_RTT = U(SLOT_REC_AUX0) + MAX_REC_AUX_GRANULES, SLOT_RTT2, /* Some commands access two RTT granules at a time*/ SLOT_RSI_CALL, NR_CPU_SLOTS diff --git a/lib/realm/src/buffer.c b/lib/realm/src/buffer.c index 63ecf682..f27d2be9 100644 --- a/lib/realm/src/buffer.c +++ b/lib/realm/src/buffer.c @@ -21,7 +21,7 @@ #include #include -COMPILER_ASSERT(XLAT_HIGH_VA_SLOT_NUM >= NR_CPU_SLOTS); +COMPILER_ASSERT(XLAT_HIGH_VA_SLOT_NUM >= U(NR_CPU_SLOTS)); /* coverity[misra_c_2012_rule_8_7_violation:SUPPRESS] */ uintptr_t slot_to_va(enum buffer_slot slot) @@ -86,7 +86,7 @@ bool check_cpu_slots_empty(void) { for (unsigned int i = 0U; i < (unsigned int)NR_CPU_SLOTS; i++) { if (slot_to_descriptor((enum buffer_slot)i) != - TRANSIENT_DESC) { + TRANSIENT_DESC) { return false; } } diff --git a/lib/rmm_el3_ifc/include/rmm_el3_ifc.h b/lib/rmm_el3_ifc/include/rmm_el3_ifc.h index b3e8eef7..3b3e9c24 100644 --- a/lib/rmm_el3_ifc/include/rmm_el3_ifc.h +++ b/lib/rmm_el3_ifc/include/rmm_el3_ifc.h @@ -189,9 +189,9 @@ struct rmm_core_manifest { struct ns_dram_info plat_dram; /* Platform DRAM data */ }; -COMPILER_ASSERT(offsetof(struct rmm_core_manifest, version) == 0); -COMPILER_ASSERT(offsetof(struct rmm_core_manifest, plat_data) == 8); -COMPILER_ASSERT(offsetof(struct rmm_core_manifest, plat_dram) == 16); +COMPILER_ASSERT(U(offsetof(struct rmm_core_manifest, version)) == 0U); +COMPILER_ASSERT(U(offsetof(struct rmm_core_manifest, plat_data)) == 8U); +COMPILER_ASSERT(U(offsetof(struct rmm_core_manifest, plat_dram)) == 16U); /* * Accessors to the Boot Manifest data diff --git a/lib/smc/include/smc.h b/lib/smc/include/smc.h index 2ebd1f5a..bb98f703 100644 --- a/lib/smc/include/smc.h +++ b/lib/smc/include/smc.h @@ -131,7 +131,7 @@ (IS_SMC32_FID_STD_FAST(_fid) && IS_SMC32_FID_IN_RANGE(_range, _fid)) #define SMC64_NUM_FIDS_IN_RANGE(_range) \ - (SMC64_##_range##_FNUM_MAX - SMC64_##_range##_FNUM_MIN + 1) + (SMC64_##_range##_FNUM_MAX - SMC64_##_range##_FNUM_MIN + 1U) /* Gets the offset in a range. Inputs must be pre-verified */ #define SMC64_FID_OFFSET_FROM_RANGE_MIN(_range, _fid) \ diff --git a/lib/smc/src/smc-rmi-offsets.c b/lib/smc/src/smc-rmi-offsets.c index 60546594..9eb41d3d 100644 --- a/lib/smc/src/smc-rmi-offsets.c +++ b/lib/smc/src/smc-rmi-offsets.c @@ -6,53 +6,53 @@ #include #include -COMPILER_ASSERT(sizeof(struct rmi_realm_params) == 0x1000); -COMPILER_ASSERT(offsetof(struct rmi_realm_params, flags) == 0); -COMPILER_ASSERT(offsetof(struct rmi_realm_params, s2sz) == 0x8); -COMPILER_ASSERT(offsetof(struct rmi_realm_params, sve_vl) == 0x10); -COMPILER_ASSERT(offsetof(struct rmi_realm_params, num_bps) == 0x18); -COMPILER_ASSERT(offsetof(struct rmi_realm_params, num_wps) == 0x20); -COMPILER_ASSERT(offsetof(struct rmi_realm_params, pmu_num_ctrs) == 0x28); -COMPILER_ASSERT(offsetof(struct rmi_realm_params, algorithm) == 0x30); -COMPILER_ASSERT(offsetof(struct rmi_realm_params, rpv) == 0x400); -COMPILER_ASSERT(offsetof(struct rmi_realm_params, vmid) == 0x800); -COMPILER_ASSERT(offsetof(struct rmi_realm_params, rtt_base) == 0x808); -COMPILER_ASSERT(offsetof(struct rmi_realm_params, rtt_level_start) == 0x810); -COMPILER_ASSERT(offsetof(struct rmi_realm_params, rtt_num_start) == 0x818); +COMPILER_ASSERT(sizeof(struct rmi_realm_params) == 0x1000UL); +COMPILER_ASSERT(U(offsetof(struct rmi_realm_params, flags)) == 0U); +COMPILER_ASSERT(U(offsetof(struct rmi_realm_params, s2sz)) == 0x8U); +COMPILER_ASSERT(U(offsetof(struct rmi_realm_params, sve_vl)) == 0x10U); +COMPILER_ASSERT(U(offsetof(struct rmi_realm_params, num_bps)) == 0x18U); +COMPILER_ASSERT(U(offsetof(struct rmi_realm_params, num_wps)) == 0x20U); +COMPILER_ASSERT(U(offsetof(struct rmi_realm_params, pmu_num_ctrs)) == 0x28U); +COMPILER_ASSERT(U(offsetof(struct rmi_realm_params, algorithm)) == 0x30U); +COMPILER_ASSERT(U(offsetof(struct rmi_realm_params, rpv)) == 0x400U); +COMPILER_ASSERT(U(offsetof(struct rmi_realm_params, vmid)) == 0x800U); +COMPILER_ASSERT(U(offsetof(struct rmi_realm_params, rtt_base)) == 0x808U); +COMPILER_ASSERT(U(offsetof(struct rmi_realm_params, rtt_level_start)) == 0x810U); +COMPILER_ASSERT(U(offsetof(struct rmi_realm_params, rtt_num_start)) == 0x818U); -COMPILER_ASSERT(sizeof(struct rmi_rec_params) == 0x1000); -COMPILER_ASSERT(offsetof(struct rmi_rec_params, flags) == 0); -COMPILER_ASSERT(offsetof(struct rmi_rec_params, mpidr) == 0x100); -COMPILER_ASSERT(offsetof(struct rmi_rec_params, pc) == 0x200); -COMPILER_ASSERT(offsetof(struct rmi_rec_params, gprs) == 0x300); -COMPILER_ASSERT(offsetof(struct rmi_rec_params, num_aux) == 0x800); -COMPILER_ASSERT(offsetof(struct rmi_rec_params, aux) == 0x808); +COMPILER_ASSERT(sizeof(struct rmi_rec_params) == 0x1000UL); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_params, flags)) == 0U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_params, mpidr)) == 0x100U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_params, pc)) == 0x200U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_params, gprs)) == 0x300U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_params, num_aux)) == 0x800U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_params, aux)) == 0x808U); -COMPILER_ASSERT(sizeof(struct rmi_rec_enter) == 0x800); -COMPILER_ASSERT(offsetof(struct rmi_rec_enter, flags) == 0); -COMPILER_ASSERT(offsetof(struct rmi_rec_enter, gprs) == 0x200); -COMPILER_ASSERT(offsetof(struct rmi_rec_enter, gicv3_hcr) == 0x300); -COMPILER_ASSERT(offsetof(struct rmi_rec_enter, gicv3_lrs) == 0x308); +COMPILER_ASSERT(sizeof(struct rmi_rec_enter) == 0x800UL); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_enter, flags)) == 0U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_enter, gprs)) == 0x200U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_enter, gicv3_hcr)) == 0x300U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_enter, gicv3_lrs)) == 0x308U); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, exit_reason) == 0); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, esr) == 0x100); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, far) == 0x108); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, hpfar) == 0x110); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gprs) == 0x200); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gicv3_hcr) == 0x300); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gicv3_lrs) == 0x308); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gicv3_misr) == 0x388); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, gicv3_vmcr) == 0x390); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, cntp_ctl) == 0x400); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, cntp_cval) == 0x408); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, cntv_ctl) == 0x410); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, cntv_cval) == 0x418); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, ripas_base) == 0x500); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, ripas_top) == 0x508); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, ripas_value) == 0x510); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, imm) == 0x600); -COMPILER_ASSERT(offsetof(struct rmi_rec_exit, pmu_ovf_status) == 0x700); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, exit_reason)) == 0U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, esr)) == 0x100U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, far)) == 0x108U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, hpfar)) == 0x110U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, gprs)) == 0x200U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, gicv3_hcr)) == 0x300U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, gicv3_lrs)) == 0x308U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, gicv3_misr)) == 0x388U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, gicv3_vmcr)) == 0x390U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, cntp_ctl)) == 0x400U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, cntp_cval)) == 0x408U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, cntv_ctl)) == 0x410U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, cntv_cval)) == 0x418U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, ripas_base)) == 0x500U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, ripas_top)) == 0x508U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, ripas_value)) == 0x510U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, imm)) == 0x600U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_exit, pmu_ovf_status)) == 0x700U); COMPILER_ASSERT(sizeof(struct rmi_rec_run) <= GRANULE_SIZE); -COMPILER_ASSERT(offsetof(struct rmi_rec_run, enter) == 0); -COMPILER_ASSERT(offsetof(struct rmi_rec_run, exit) == 0x800); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_run, enter)) == 0U); +COMPILER_ASSERT(U(offsetof(struct rmi_rec_run, exit)) == 0x800U); diff --git a/lib/smc/src/smc-rsi-offsets.c b/lib/smc/src/smc-rsi-offsets.c index c14ed2f9..4ba3afee 100644 --- a/lib/smc/src/smc-rsi-offsets.c +++ b/lib/smc/src/smc-rsi-offsets.c @@ -7,13 +7,13 @@ #include #include -COMPILER_ASSERT(sizeof(struct rsi_realm_config) == 0x1000); -COMPILER_ASSERT(offsetof(struct rsi_realm_config, ipa_width) == 0); -COMPILER_ASSERT(offsetof(struct rsi_realm_config, algorithm) == 8); +COMPILER_ASSERT(sizeof(struct rsi_realm_config) == 0x1000UL); +COMPILER_ASSERT(U(offsetof(struct rsi_realm_config, ipa_width)) == 0U); +COMPILER_ASSERT(U(offsetof(struct rsi_realm_config, algorithm)) == 8U); -COMPILER_ASSERT(sizeof(struct rsi_host_call) == 0x100); -COMPILER_ASSERT(offsetof(struct rsi_host_call, imm) == 0); -COMPILER_ASSERT(offsetof(struct rsi_host_call, gprs[0]) == 8); -COMPILER_ASSERT(offsetof(struct rsi_host_call, - gprs[RSI_HOST_CALL_NR_GPRS - 1]) == - (8UL * RSI_HOST_CALL_NR_GPRS)); +COMPILER_ASSERT(sizeof(struct rsi_host_call) == 0x100UL); +COMPILER_ASSERT(U(offsetof(struct rsi_host_call, imm)) == 0U); +COMPILER_ASSERT(U(offsetof(struct rsi_host_call, gprs[0U])) == 8U); +COMPILER_ASSERT(U(offsetof(struct rsi_host_call, + gprs[RSI_HOST_CALL_NR_GPRS - 1U])) == + U(8U * RSI_HOST_CALL_NR_GPRS)); diff --git a/lib/xlat/include/xlat_tables.h b/lib/xlat/include/xlat_tables.h index 1319e3fc..eed750f1 100644 --- a/lib/xlat/include/xlat_tables.h +++ b/lib/xlat/include/xlat_tables.h @@ -86,7 +86,7 @@ * attributes field as a flag to know if a tte corresponds to a transient * address or not. */ -#define TRANSIENT_FLAG_SHIFT U(55) +#define TRANSIENT_FLAG_SHIFT UL(55) #define TRANSIENT_FLAG_WIDTH U(1) /* diff --git a/runtime/rmi/system.c b/runtime/rmi/system.c index 37fcca1f..778f827e 100644 --- a/runtime/rmi/system.c +++ b/runtime/rmi/system.c @@ -6,8 +6,8 @@ #include #include -COMPILER_ASSERT(RMI_ABI_VERSION_MAJOR <= 0x7FFF); -COMPILER_ASSERT(RMI_ABI_VERSION_MINOR <= 0xFFFF); +COMPILER_ASSERT(RMI_ABI_VERSION_MAJOR <= 0x7FFFUL); +COMPILER_ASSERT(RMI_ABI_VERSION_MINOR <= 0xFFFFUL); void smc_version(unsigned long rmi_version, struct smc_result *res) {