aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJustin Chadwell <justin.chadwell@arm.com>2019-07-03 14:04:33 +0100
committerJustin Chadwell <justin.chadwell@arm.com>2019-07-11 12:10:51 +0100
commitb19498b97b72879ad6ab746da9ee9a0020a413b1 (patch)
tree85886a109728008aa5f34cfd142e4e6811e9c0e6 /drivers
parent21bde92ff6d20ef2d3a2651fd729a1579232313b (diff)
downloadplatform_external_arm-trusted-firmware-b19498b97b72879ad6ab746da9ee9a0020a413b1.tar.gz
platform_external_arm-trusted-firmware-b19498b97b72879ad6ab746da9ee9a0020a413b1.tar.bz2
platform_external_arm-trusted-firmware-b19498b97b72879ad6ab746da9ee9a0020a413b1.zip
Update marvell platform to not rely on undefined overflow behaviour
This consists of ensuring that the left operand of each shift is unsigned when the operation might overflow into the sign bit. Change-Id: I78f386f5ac171d6e52383a3e42003e6fb3e96b57 Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/marvell/mci.c2
-rw-r--r--drivers/marvell/mochi/cp110_setup.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/marvell/mci.c b/drivers/marvell/mci.c
index 3a9859c98..06fe88e13 100644
--- a/drivers/marvell/mci.c
+++ b/drivers/marvell/mci.c
@@ -245,7 +245,7 @@
MCI_PHY_CTRL_PHY_ADDR_MSB_OFFSET)
#define MCI_PHY_CTRL_PIDI_MODE_OFFSET 31
#define MCI_PHY_CTRL_PIDI_MODE \
- (1 << MCI_PHY_CTRL_PIDI_MODE_OFFSET)
+ (1U << MCI_PHY_CTRL_PIDI_MODE_OFFSET)
/* Number of times to wait for the MCI link ready after MCI configurations
* Normally takes 34-35 successive reads
diff --git a/drivers/marvell/mochi/cp110_setup.c b/drivers/marvell/mochi/cp110_setup.c
index d7d737318..b4b4e0c82 100644
--- a/drivers/marvell/mochi/cp110_setup.c
+++ b/drivers/marvell/mochi/cp110_setup.c
@@ -56,11 +56,11 @@
(0x1 << MVEBU_AMB_IP_BRIDGE_WIN_EN_OFFSET)
#define MVEBU_AMB_IP_BRIDGE_WIN_SIZE_OFFSET 16
#define MVEBU_AMB_IP_BRIDGE_WIN_SIZE_MASK \
- (0xffff << MVEBU_AMB_IP_BRIDGE_WIN_SIZE_OFFSET)
+ (0xffffu << MVEBU_AMB_IP_BRIDGE_WIN_SIZE_OFFSET)
#define MVEBU_SAMPLE_AT_RESET_REG (0x440600)
#define SAR_PCIE1_CLK_CFG_OFFSET 31
-#define SAR_PCIE1_CLK_CFG_MASK (0x1 << SAR_PCIE1_CLK_CFG_OFFSET)
+#define SAR_PCIE1_CLK_CFG_MASK (0x1u << SAR_PCIE1_CLK_CFG_OFFSET)
#define SAR_PCIE0_CLK_CFG_OFFSET 30
#define SAR_PCIE0_CLK_CFG_MASK (0x1 << SAR_PCIE0_CLK_CFG_OFFSET)
#define SAR_I2C_INIT_EN_OFFSET 24