Skip to content

Commit

Permalink
soc: mediatek: mtk-svs: Use ULONG_MAX to compare floor frequency
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
AngeloGioacchino Del Regno committed Dec 11, 2023
1 parent b74cac0 commit f6c5f28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/soc/mediatek/mtk-svs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f6c5f28

Please sign in to comment.