From c074f70ce5d85e1735b589b323fac99d7eb988b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Thu, 23 Sep 2021 18:19:24 +0200 Subject: [PATCH] fix(drivers/marvell/comphy-3700): fix address overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Physical address has to be stored in 64-bit data type as Armada 3720 is 64-bit platform. Driver already uses uintptr_t type for this purpise. Change type of 'offset' variables in mvebu_a3700_comphy_usb3_power_on() and mvebu_a3700_comphy_sgmii_power_on() / off() functions to uintptr_t as in this variable is stored physical address of registers. Signed-off-by: Pali Rohár Change-Id: I69581714f8899d21cc1a27005747708f0f1cd933 --- drivers/marvell/comphy/phy-comphy-3700.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/marvell/comphy/phy-comphy-3700.c b/drivers/marvell/comphy/phy-comphy-3700.c index 3b904d307..a59fbd548 100644 --- a/drivers/marvell/comphy/phy-comphy-3700.c +++ b/drivers/marvell/comphy/phy-comphy-3700.c @@ -364,7 +364,8 @@ static int mvebu_a3700_comphy_sgmii_power_on(uint8_t comphy_index, uint32_t comphy_mode) { int ret = 0; - uint32_t mask, data, offset; + uint32_t mask, data; + uintptr_t offset; uintptr_t sd_ip_addr; int mode = COMPHY_GET_MODE(comphy_mode); int invert = COMPHY_GET_POLARITY_INVERT(comphy_mode); @@ -576,7 +577,8 @@ static int mvebu_a3700_comphy_sgmii_power_on(uint8_t comphy_index, static int mvebu_a3700_comphy_sgmii_power_off(uint8_t comphy_index) { int ret = 0; - uint32_t mask, data, offset; + uintptr_t offset; + uint32_t mask, data; debug_enter(); @@ -595,7 +597,8 @@ static int mvebu_a3700_comphy_usb3_power_on(uint8_t comphy_index, { int ret = 0; uintptr_t reg_base = 0; - uint32_t mask, data, addr, cfg, ref_clk; + uintptr_t addr; + uint32_t mask, data, cfg, ref_clk; void (*usb3_reg_set)(uintptr_t addr, uint32_t reg_offset, uint16_t data, uint16_t mask); int invert = COMPHY_GET_POLARITY_INVERT(comphy_mode);