Commit fd75f371 authored by Christian Bruel's avatar Christian Bruel Committed by Vinod Koul
Browse files

phy: stm32: Fix constant-value overflow assertion



Rework the workaround as the lookup tables always fits into the bitfield,
and the default values are defined by the hardware and cannot be 0:

Guard against false positive with a WARN_ON check to make the compiler
happy: The offset range is pre-checked against the sorted imp_lookup_table
values and overflow should not happen and would be caught by a warning and
return in error.

Also guard against a true positive found during the max_vswing lookup, as a
max vswing value can be 802000 or 803000 microvolt depending on the current
impedance. Therefore set the default impedence index.

Fixes: 2de679ec ("phy: stm32: work around constant-value overflow assertion")
Signed-off-by: default avatarChristian Bruel <christian.bruel@foss.st.com>
Link: https://lore.kernel.org/r/20250210103515.2598377-1-christian.bruel@foss.st.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 3126ea9b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment