summaryrefslogtreecommitdiff
path: root/drivers/ddr/imx/imx8m
diff options
context:
space:
mode:
authorEugeniu Rosca <erosca@de.adit-jv.com>2024-01-04 05:26:23 +0100
committerTom Rini <trini@konsulko.com>2024-03-26 19:58:26 -0400
commitf5dbfc82a90b2333bfee76906df883ba86a85f56 (patch)
treec6a3804eda3e4d8df56b7868617b67c844e2b477 /drivers/ddr/imx/imx8m
parent388cb2d321dd0bc5b0dc6e7f8e96d6d0f2929736 (diff)
net: phy: Fix signed shift overflow
Booting R-Car Gen3 arm64 U-Boot with CONFIG_UBSAN=y resulted in: ===================================================================== UBSAN: Undefined behaviour in drivers/net/phy/phy.c:728:19 left shift of 1 by 31 places cannot be represented in type 'int' ===================================================================== Fix it by appending the UL suffix to the numeric literal. While at it, convert the type of "addr" variable from signed to unsigned, to protect against shifting the numeric literal by a negative value (which would lead to yet another undefined behavior). Fixes: 1adb406b0141 ("phy: add phy_find_by_mask/phy_connect_dev") Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> * Using U-suffix for integer is sufficient. * ffs() of non-zero value cannot be 0. But addr being unsigned is * preferable. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'drivers/ddr/imx/imx8m')
0 files changed, 0 insertions, 0 deletions