Skip to contentSkip to conversation

soc: qcom: rpmpd: use correct __le32 type

PATCH Applied Min-Hua Chen 3 participants 3 messages May 22, 2023 – May 25, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: qcom: rpmpd: use correct __le32 type

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

---
 drivers/soc/qcom/rpmpd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soc/qcom/rpmpd.c +2 -2
index f8397dcb146c..99b017fd76b7 100644
@@ -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);
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Min-Hua Chen

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

---

I wonder if our drivers are capable of booting and working properly in BE..

Konrad

Quoted 18 lines
 drivers/soc/qcom/rpmpd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soc/qcom/rpmpd.c +2 -2
index f8397dcb146c..99b017fd76b7 100644
@@ -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);
maintainer Applied
#2 lore raw
In reply to Min-Hua Chen
Quoted 8 lines · Min-Hua Chen

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

[...]

Applied, thanks!

[1/1] soc: qcom: rpmpd: use correct __le32 type

      commit: 4b819e7e89fedc90150a78152bfa6e6e3534e64b

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>