diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2017-09-14 15:57:44 +0100 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2017-09-21 12:03:53 +0100 |
commit | e47ac1fd634a3934d7d3ac446190b2f4bd8a640f (patch) | |
tree | 4291bffc8b34a4d395bbee467ee5fcaff2bcdbeb /drivers/arm/ccn/ccn.c | |
parent | df312c5a2b152953f755df9d979cff20afb7ef4b (diff) | |
download | platform_external_arm-trusted-firmware-e47ac1fd634a3934d7d3ac446190b2f4bd8a640f.tar.gz platform_external_arm-trusted-firmware-e47ac1fd634a3934d7d3ac446190b2f4bd8a640f.tar.bz2 platform_external_arm-trusted-firmware-e47ac1fd634a3934d7d3ac446190b2f4bd8a640f.zip |
Fix type of `unsigned long` constants
The type `unsigned long` is 32 bit wide in AArch32, but 64 bit wide in
AArch64. This is inconsistent and that's why we avoid using it as per
the Coding Guidelines. This patch changes all `UL` occurrences to `U`
or `ULL` depending on the context so that the size of the constant is
clear.
This problem affected the macro `BIT(nr)`. As long as this macro is used
to fill fields of registers, that's not a problem, since all registers
are 32 bit wide in AArch32 and 64 bit wide in AArch64. However, if the
macro is used to fill the fields of a 64-bit integer, it won't be able
to set the upper 32 bits in AArch32.
By changing the type of this macro to `unsigned long long` the behaviour
is always the same regardless of the architecture, as this type is
64-bit wide in both cases.
Some Tegra platform files have been modified by this patch.
Change-Id: I918264c03e7d691a931f0d1018df25a2796cc221
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'drivers/arm/ccn/ccn.c')
-rw-r--r-- | drivers/arm/ccn/ccn.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/arm/ccn/ccn.c b/drivers/arm/ccn/ccn.c index ec264d218..afb7d9d3b 100644 --- a/drivers/arm/ccn/ccn.c +++ b/drivers/arm/ccn/ccn.c @@ -236,7 +236,7 @@ static unsigned long long ccn_master_to_rn_id_map(unsigned long long master_map) node_id = ccn_plat_desc->master_to_rn_id_map[iface_id]; /* Set the bit corresponding to this node ID */ - rn_id_map |= (1UL << node_id); + rn_id_map |= (1ULL << node_id); } return rn_id_map; |