diff options
author | AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> | 2023-11-21 13:50:41 +0100 |
---|---|---|
committer | AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> | 2023-12-11 11:36:15 +0100 |
commit | f6c5f285e357aa2d7521f802d13b655068229e27 (patch) | |
tree | 85318c9c667ad58bc716a0fc37a9dd0611e4661d /drivers/soc | |
parent | b74cac09c009bd797da0dedd84415c4c9f586201 (diff) | |
download | lwn-f6c5f285e357aa2d7521f802d13b655068229e27.tar.gz lwn-f6c5f285e357aa2d7521f802d13b655068229e27.zip |
soc: mediatek: mtk-svs: Use ULONG_MAX to compare floor frequency
The `freq` variable is of type unsigned long and, even though it does
currently work with u32 because no frequency is higher than U32_MAX,
it is not guaranteed that in the future we will see one.
Initialize the freq variable with ULONG_MAX instead of U32_MAX.
Link: https://lore.kernel.org/r/20231121125044.78642-18-angelogioacchino.delregno@collabora.com
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Diffstat (limited to 'drivers/soc')
-rw-r--r-- | drivers/soc/mediatek/mtk-svs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c index 16a16c5a3f24..df39e7430ba9 100644 --- a/drivers/soc/mediatek/mtk-svs.c +++ b/drivers/soc/mediatek/mtk-svs.c @@ -1804,7 +1804,7 @@ static int svs_bank_resource_setup(struct svs_platform *svsp) return count; } - for (i = 0, freq = U32_MAX; i < svsb->opp_count; i++, freq--) { + for (i = 0, freq = ULONG_MAX; i < svsb->opp_count; i++, freq--) { opp = dev_pm_opp_find_freq_floor(svsb->opp_dev, &freq); if (IS_ERR(opp)) { dev_err(svsb->dev, "cannot find freq = %ld\n", |