Re: [PATCH v2] drm/msm/dpu: clean up dpu_kms_get_clk_rate() returns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 5/26/2023 4:51 AM, Dan Carpenter wrote:
Static analysis tools complain about the -EINVAL error code being
stored in an unsigned variable.  Let's change this to match
the clk_get_rate() function which is type unsigned long and returns
zero on error.

Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
v2: In v1 I change the type to int which was wrong.  This is a different
     approach.  CC the freedreno list this time too.

  drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 4 ++--
  drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h | 2 +-
  2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index 0e7a68714e9e..25e6a15eaf9f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -979,13 +979,13 @@ static int _dpu_kms_mmu_init(struct dpu_kms *dpu_kms)
  	return 0;
  }
-u64 dpu_kms_get_clk_rate(struct dpu_kms *dpu_kms, char *clock_name)
+unsigned long dpu_kms_get_clk_rate(struct dpu_kms *dpu_kms, char *clock_name)
  {
  	struct clk *clk;
clk = msm_clk_bulk_get_clock(dpu_kms->clocks, dpu_kms->num_clocks, clock_name);
  	if (!clk)
-		return -EINVAL;
+		return 0;

Currently, the only caller of this API is dpu_encoder_phys_cmd_tearcheck_config which seems to handle <=0 so this change should be fine. Hence


Reviewed-by: Abhinav Kumar <quic_abhinavk@xxxxxxxxxxx>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux