soc: mediatek: mtk-svs: Use ULONG_MAX to compare floor frequency
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tue, 21 Nov 2023 12:50:41 +0000 (13:50 +0100)
committerAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Mon, 11 Dec 2023 10:36:15 +0000 (11:36 +0100)
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>
drivers/soc/mediatek/mtk-svs.c

index 16a16c5a3f248acf37bb03f0d322d2c20e59e2d1..df39e7430ba9d979f305ecc97be0713ba7acc95e 100644 (file)
@@ -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",