diff options
| author | Marek Vasut <[email protected]> | 2025-03-16 14:51:40 +0100 |
|---|---|---|
| committer | Marek Vasut <[email protected]> | 2025-03-16 14:56:16 +0100 |
| commit | 9a106f15fac20790c272023845ec10e46281bef2 (patch) | |
| tree | 02541fac1cb7a6e6c2fe964807d83a1cb3fcd56b /drivers | |
| parent | 6c219e184f9efffed88dbd82dac94c24ebb00347 (diff) | |
ram: renesas: dbsc5: Fix JS1 index calculation
The JS1 index is calculated correctly, but the limiter cannot
be the max() function because the index should be lower than
JS1_USABLEC_SPEC_HI and the max() function would unconditionally
override the JS1 index to JS1_USABLEC_SPEC_HI. Use clamp() to
limit the JS1 index instead.
Signed-off-by: Marek Vasut <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/ram/renesas/dbsc5/dram.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ram/renesas/dbsc5/dram.c b/drivers/ram/renesas/dbsc5/dram.c index 939775d4d16..289d1224673 100644 --- a/drivers/ram/renesas/dbsc5/dram.c +++ b/drivers/ram/renesas/dbsc5/dram.c @@ -2192,7 +2192,7 @@ static void dbsc5_ddrtbl_calc(struct renesas_dbsc5_dram_priv *priv) if (js1[i].fx3 * 2 * priv->ddr_mbpsdiv >= priv->ddr_mbps * 3) break; - priv->js1_ind = max(i, JS1_USABLEC_SPEC_HI); + priv->js1_ind = clamp(i, 0, JS1_USABLEC_SPEC_HI); priv->RL = js1[priv->js1_ind].RLset1; priv->WL = js1[priv->js1_ind].WLsetA; |
