[PATCH] drm/amdgpu: fix a missing break in gfx_v11_0_handle_priv_fault

2022-05-29 Thread sunliming
Fixes the following w1 warning:

drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:5873:2: warning: unannotated
fall-through between switch labels [-Wimplicit-fallthrough].

Reported-by: kernel test robot 
Signed-off-by: sunliming 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
index cb581cfc7464..628d3536938e 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
@@ -6028,6 +6028,7 @@ static void gfx_v11_0_handle_priv_fault(struct 
amdgpu_device *adev,
break;
default:
BUG();
+   break;
}
 }
 
-- 
2.25.1



[PATCH] drm/amdgpu: make gfx_v11_0_rlc_stop static

2022-05-29 Thread sunliming
This symbol is not used outside of gfx_v11_0.c, so marks it static.

Fixes the following w1 warning:

drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1945:6: warning: no previous
prototype for function 'gfx_v11_0_rlc_stop' [-Wmissing-prototypes].

Reported-by: kernel test robot 
Signed-off-by: sunliming 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
index 8c0a3fc7aaa6..cb581cfc7464 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
@@ -1983,7 +1983,7 @@ static int gfx_v11_0_init_csb(struct amdgpu_device *adev)
return 0;
 }
 
-void gfx_v11_0_rlc_stop(struct amdgpu_device *adev)
+static void gfx_v11_0_rlc_stop(struct amdgpu_device *adev)
 {
u32 tmp = RREG32_SOC15(GC, 0, regRLC_CNTL);
 
-- 
2.25.1



[PATCH] drm/amd/display: Fix variable dereferenced before check

2022-08-26 Thread sunliming
Fixes the following smatch warning:

drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:311 
dc_dmub_srv_p_state_delegate()
warn: variable dereferenced before check 'dc' (see line 309)

Reported-by: kernel test robot 
Reported-by: Dan Carpenter 
Signed-off-by: sunliming 
---
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c 
b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
index 09b304507bad..ebf99e8f93e0 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -323,11 +323,13 @@ bool dc_dmub_srv_p_state_delegate(struct dc *dc, bool 
should_manage_pstate, stru
struct dmub_cmd_fw_assisted_mclk_switch_config *config_data = 
&cmd.fw_assisted_mclk_switch.config_data;
int i = 0;
int ramp_up_num_steps = 1; // TODO: Ramp is currently disabled. 
Reenable it.
-   uint8_t visual_confirm_enabled = dc->debug.visual_confirm == 
VISUAL_CONFIRM_FAMS;
+   uint8_t visual_confirm_enabled;
 
if (dc == NULL)
return false;
 
+   visual_confirm_enabled = dc->debug.visual_confirm == 
VISUAL_CONFIRM_FAMS;
+
// Format command.
cmd.fw_assisted_mclk_switch.header.type = 
DMUB_CMD__FW_ASSISTED_MCLK_SWITCH;
cmd.fw_assisted_mclk_switch.header.sub_type = 
DMUB_CMD__FAMS_SETUP_FW_CTRL;
-- 
2.25.1



[PATCH] drm/vc4: fix uninitialized smatch warnings

2025-04-04 Thread sunliming
From: sunliming 

Fix below smatch warnings:
drivers/gpu/drm/vc4/vc4_gem.c:604 vc4_lock_bo_reservations() error: 
uninitialized symbol 'ret'.

Reported-by: kernel test robot 
Reported-by: Dan Carpenter 
Closes: https://lore.kernel.org/r/202504021500.3am1hkks-...@intel.com/
Signed-off-by: sunliming 
---
 drivers/gpu/drm/vc4/vc4_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
index 8125f87edc60..04ea1696fc5d 100644
--- a/drivers/gpu/drm/vc4/vc4_gem.c
+++ b/drivers/gpu/drm/vc4/vc4_gem.c
@@ -582,7 +582,7 @@ static int
 vc4_lock_bo_reservations(struct vc4_exec_info *exec,
 struct drm_exec *exec_ctx)
 {
-   int ret;
+   int ret = 0;
 
/* Reserve space for our shared (read-only) fence references,
 * before we commit the CL to the hardware.
-- 
2.25.1