diff options
author | Jeenu Viswambharan <jeenu.viswambharan@arm.com> | 2018-08-02 10:14:12 +0100 |
---|---|---|
committer | Jeenu Viswambharan <jeenu.viswambharan@arm.com> | 2018-08-20 09:05:39 +0100 |
commit | 03b645ed866a46a8762dfff20acc0bd35a54e34f (patch) | |
tree | f34c8c15d6f837d7820fe34d2c8dc984a3ddfb8d /include/bl31/ehf.h | |
parent | 611eb9cfa72628d752a6f0cdf616eb48412506c2 (diff) | |
download | platform_external_arm-trusted-firmware-03b645ed866a46a8762dfff20acc0bd35a54e34f.tar.gz platform_external_arm-trusted-firmware-03b645ed866a46a8762dfff20acc0bd35a54e34f.tar.bz2 platform_external_arm-trusted-firmware-03b645ed866a46a8762dfff20acc0bd35a54e34f.zip |
EHF: MISRA fixes
These changes address most of the required MISRA rules. In the process,
some from generic code are also fixed.
No functional changes.
Change-Id: I19786070af7bc5e1f6d15bdba93e22a4451d8fe9
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
Diffstat (limited to 'include/bl31/ehf.h')
-rw-r--r-- | include/bl31/ehf.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/include/bl31/ehf.h b/include/bl31/ehf.h index f963f8d0c..144627986 100644 --- a/include/bl31/ehf.h +++ b/include/bl31/ehf.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef __EHF_H__ -#define __EHF_H__ +#ifndef EHF_H +#define EHF_H #ifndef __ASSEMBLY__ @@ -13,27 +13,27 @@ #include <utils_def.h> /* Valid priorities set bit 0 of the priority handler. */ -#define _EHF_PRI_VALID (((uintptr_t) 1) << 0) +#define EHF_PRI_VALID_ (((uintptr_t) 1) << 0) /* Marker for no handler registered for a valid priority */ -#define _EHF_NO_HANDLER (0 | _EHF_PRI_VALID) +#define EHF_NO_HANDLER_ (0U | EHF_PRI_VALID_) /* Extract the specified number of top bits from 7 lower bits of priority */ #define EHF_PRI_TO_IDX(pri, plat_bits) \ - ((pri & 0x7f) >> (7 - plat_bits)) + ((((unsigned) (pri)) & 0x7fu) >> (7u - (plat_bits))) /* Install exception priority descriptor at a suitable index */ #define EHF_PRI_DESC(plat_bits, priority) \ [EHF_PRI_TO_IDX(priority, plat_bits)] = { \ - .ehf_handler = _EHF_NO_HANDLER, \ + .ehf_handler = EHF_NO_HANDLER_, \ } /* Macro for platforms to regiter its exception priorities */ #define EHF_REGISTER_PRIORITIES(priorities, num, bits) \ const ehf_priorities_t exception_data = { \ - .num_priorities = num, \ - .ehf_priorities = priorities, \ - .pri_bits = bits, \ + .num_priorities = (num), \ + .ehf_priorities = (priorities), \ + .pri_bits = (bits), \ } /* @@ -72,10 +72,10 @@ typedef struct ehf_pri_desc { uintptr_t ehf_handler; } ehf_pri_desc_t; -typedef struct ehf_priorities { +typedef struct ehf_priority_type { ehf_pri_desc_t *ehf_priorities; unsigned int num_priorities; - int pri_bits; + unsigned int pri_bits; } ehf_priorities_t; void ehf_init(void); @@ -87,4 +87,4 @@ unsigned int ehf_is_ns_preemption_allowed(void); #endif /* __ASSEMBLY__ */ -#endif /* __EHF_H__ */ +#endif /* EHF_H */ |