diff options
author | John Powell <john.powell@arm.com> | 2020-03-20 14:21:05 -0500 |
---|---|---|
committer | johpow01 <john.powell@arm.com> | 2020-04-03 16:20:59 -0500 |
commit | 3443a7027d78a9ccebc6940f0a69300ec7c1ed44 (patch) | |
tree | 079c29b2f19a0009fdf7dbe2aa6727f920009a93 /include/lib | |
parent | 0f99bf32df156b7b87454278b049c65221eeeb84 (diff) | |
download | platform_external_arm-trusted-firmware-3443a7027d78a9ccebc6940f0a69300ec7c1ed44.tar.gz platform_external_arm-trusted-firmware-3443a7027d78a9ccebc6940f0a69300ec7c1ed44.tar.bz2 platform_external_arm-trusted-firmware-3443a7027d78a9ccebc6940f0a69300ec7c1ed44.zip |
Fix MISRA C issues in BL1/BL2/BL31
Attempts to address MISRA compliance issues in BL1, BL2, and BL31 code.
Mainly issues like not using boolean expressions in conditionals,
conflicting variable names, ignoring return values without (void), adding
explicit casts, etc.
Change-Id: If1fa18ab621b9c374db73fa6eaa6f6e5e55c146a
Signed-off-by: John Powell <john.powell@arm.com>
Diffstat (limited to 'include/lib')
-rw-r--r-- | include/lib/smccc.h | 22 | ||||
-rw-r--r-- | include/lib/utils_def.h | 4 |
2 files changed, 13 insertions, 13 deletions
diff --git a/include/lib/smccc.h b/include/lib/smccc.h index 5e13e6f0a..26509aeca 100644 --- a/include/lib/smccc.h +++ b/include/lib/smccc.h @@ -122,18 +122,18 @@ */ #define DEFINE_SVC_UUID2(_name, _tl, _tm, _th, _cl, _ch, \ _n0, _n1, _n2, _n3, _n4, _n5) \ - CASSERT((uint32_t)(_tl) != (uint32_t) SMC_UNK, invalid_svc_uuid);\ + CASSERT((uint32_t)(_tl) != (uint32_t)SMC_UNK, invalid_svc_uuid);\ static const uuid_t _name = { \ - {(_tl >> 24) & 0xFF, \ - (_tl >> 16) & 0xFF, \ - (_tl >> 8) & 0xFF, \ - (_tl & 0xFF)}, \ - {(_tm >> 8) & 0xFF, \ - (_tm & 0xFF)}, \ - {(_th >> 8) & 0xFF, \ - (_th & 0xFF)}, \ - _cl, _ch, \ - { _n0, _n1, _n2, _n3, _n4, _n5 } \ + {((_tl) >> 24) & 0xFF, \ + ((_tl) >> 16) & 0xFF, \ + ((_tl) >> 8) & 0xFF, \ + ((_tl) & 0xFF)}, \ + {((_tm) >> 8) & 0xFF, \ + ((_tm) & 0xFF)}, \ + {((_th) >> 8) & 0xFF, \ + ((_th) & 0xFF)}, \ + (_cl), (_ch), \ + { (_n0), (_n1), (_n2), (_n3), (_n4), (_n5) } \ } /* diff --git a/include/lib/utils_def.h b/include/lib/utils_def.h index 09ae3999d..2d0e9c08e 100644 --- a/include/lib/utils_def.h +++ b/include/lib/utils_def.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2020, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2020, NVIDIA Corporation. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -17,7 +17,7 @@ #define IS_POWER_OF_TWO(x) \ (((x) & ((x) - 1)) == 0) -#define SIZE_FROM_LOG2_WORDS(n) (4 << (n)) +#define SIZE_FROM_LOG2_WORDS(n) (U(4) << (n)) #define BIT_32(nr) (U(1) << (nr)) #define BIT_64(nr) (ULL(1) << (nr)) |