mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: rpmpd: use correct __le32 type
@ 2023-05-22 16:07 Min-Hua Chen
  2023-05-22 16:27 ` Konrad Dybcio
  2023-05-25  4:54 ` Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: Min-Hua Chen @ 2023-05-22 16:07 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio
  Cc: Min-Hua Chen, linux-arm-msm, linux-kernel

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>
---
 drivers/soc/qcom/rpmpd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c
index f8397dcb146c..99b017fd76b7 100644
--- a/drivers/soc/qcom/rpmpd.c
+++ b/drivers/soc/qcom/rpmpd.c
@@ -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);
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] soc: qcom: rpmpd: use correct __le32 type
  2023-05-22 16:07 [PATCH] soc: qcom: rpmpd: use correct __le32 type Min-Hua Chen
@ 2023-05-22 16:27 ` Konrad Dybcio
  2023-05-25  4:54 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Konrad Dybcio @ 2023-05-22 16:27 UTC (permalink / raw)
  To: Min-Hua Chen, Andy Gross, Bjorn Andersson; +Cc: linux-arm-msm, linux-kernel



On 22.05.2023 18:07, Min-Hua Chen wrote:
> 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>
> ---
I wonder if our drivers are capable of booting and working properly
in BE..

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  drivers/soc/qcom/rpmpd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c
> index f8397dcb146c..99b017fd76b7 100644
> --- a/drivers/soc/qcom/rpmpd.c
> +++ b/drivers/soc/qcom/rpmpd.c
> @@ -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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] soc: qcom: rpmpd: use correct __le32 type
  2023-05-22 16:07 [PATCH] soc: qcom: rpmpd: use correct __le32 type Min-Hua Chen
  2023-05-22 16:27 ` Konrad Dybcio
@ 2023-05-25  4:54 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2023-05-25  4:54 UTC (permalink / raw)
  To: Andy Gross, Konrad Dybcio, Min-Hua Chen; +Cc: linux-kernel, linux-arm-msm

On Tue, 23 May 2023 00:07:56 +0800, Min-Hua Chen wrote:
> 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,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-25  4:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-22 16:07 [PATCH] soc: qcom: rpmpd: use correct __le32 type Min-Hua Chen
2023-05-22 16:27 ` Konrad Dybcio
2023-05-25  4:54 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®