soc: qcom: rpmpd: use correct __le32 type
authorMin-Hua Chen <minhuadotchen@gmail.com>
Mon, 22 May 2023 16:07:56 +0000 (00:07 +0800)
committerBjorn Andersson <andersson@kernel.org>
Thu, 25 May 2023 03:00:58 +0000 (20:00 -0700)
Use cpu_to_le32 to cast constants to __le32 before comparing
them with __le32 type pd->key. This fixes the following sparse
warnings:

drivers/soc/qcom/rpmpd.c:895:31: sparse: warning: restricted __le32 degrades to integer
drivers/soc/qcom/rpmpd.c:896:15: sparse: warning: restricted __le32 degrades to integer

Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230522160757.284165-1-minhuadotchen@gmail.com
drivers/soc/qcom/rpmpd.c

index f8397dc..99b017f 100644 (file)
@@ -892,8 +892,8 @@ static int rpmpd_set_performance(struct generic_pm_domain *domain,
        pd->corner = state;
 
        /* Always send updates for vfc and vfl */
-       if (!pd->enabled && pd->key != KEY_FLOOR_CORNER &&
-           pd->key != KEY_FLOOR_LEVEL)
+       if (!pd->enabled && pd->key != cpu_to_le32(KEY_FLOOR_CORNER) &&
+           pd->key != cpu_to_le32(KEY_FLOOR_LEVEL))
                goto out;
 
        ret = rpmpd_aggregate_corner(pd);