On 7/31/23 6:26 AM, Ruan Jinjie wrote:
Ther are many ternary operators, the true or false judgement
of which is unnecessary in C language semantics.
Signed-off-by: Ruan Jinjie
---
snip
data->registry_data.avfs_support =
- hwmgr->feature_mask & PP_AVFS_MASK ? true : fals
gcc with W=1 reports
drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c:221:21: error: variable
‘loc’ set but not used [-Werror=unused-but-set-variable]
221 | u32 loc, sig, cnt, *meta;
| ^~~
This variable is not used so remove it.
Signed-off-by: Tom Rix
gcc with W=1 reports
drivers/gpu/drm/radeon/radeon_ttm.c:200:27: error: variable
‘rbo’ set but not used [-Werror=unused-but-set-variable]
200 | struct radeon_bo *rbo;
| ^~~
This variable is not used so remove it.
Signed-off-by: Tom Rix
---
drivers/gpu
[] = {
|^~~~
gfx9_cs_data is only used in gfx_v9_0.c, so move its definition there.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/amdgpu/clearstate_gfx9.h | 4
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c| 5 +
2 files changed, 5 insertions(+), 4 deletions
nager *dqm)
^
This function is not used so remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manag
should
be changed to an if-elseif.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/i915/display/intel_display.c | 14 +-
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display.c
b/drivers/gpu/drm/i915/display/intel_display.c
index
= {
| ^~~~
These variables are not used so remove them.
Signed-off-by: Tom Rix
---
.../drm/amd/display/dc/dcn20/dcn20_resource.c | 23 ---
1 file changed, 23 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
b/drivers/gpu
[] = {
| ^
This variable is not used so remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c | 8
1 file changed, 8 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
index 3648994724c2..00e7e5db7c28 100644
gcc with W=1 reports
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:2138:13: error: variable
‘num_xcc’ set but not used [-Werror=unused-but-set-variable]
2138 | int num_xcc;
| ^~~
This variable is not used so remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd
smatch reports
drivers/gpu/drm/mgag200/mgag200_drv.c:23:5: warning: symbol
'mgag200_modeset' was not declared. Should it be static?
This variable is only used in its defining file, so it should be static
Signed-off-by: Tom Rix
---
drivers/gpu/drm/mgag200/mgag200_drv.c | 2 +-
1 fi
smatch reports
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ga102.c:49:1: warning: symbol
'ga102_gsps' was not declared. Should it be static?
This variable is only used in its defining file, so it should be static
Signed-off-by: Tom Rix
---
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/g
p; tmds_clk < 148.35 * MEGA)
Floating point should not be used, so rework the floating point comparisons
to fixed point.
Signed-off-by: Tom Rix
---
v2: silence robot by casting types to u64
---
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 10 +-
1 file changed, 5 insertions(+), 5 dele
p; tmds_clk < 148.35 * MEGA)
Floating point should not be used, so rework the floating point comparisons
to fixed point.
Signed-off-by: Tom Rix
---
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/phy/mediate
This variable is not used so remove it.
Signed-off-by: Tom Rix
---
drivers/char/agp/uninorth-agp.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index 62de7f4ba864..ee67d587cad1 100644
--- a/drivers/char/agp/uninorth-agp.c
++
smatch reports
drivers/gpu/drm/amd/amdgpu/../display/modules/power/power_helpers.c:119:31:
warning: symbol 'custom_backlight_curve0' was not declared. Should it be
static?
This variable is only used in its defining file, so it should be static
Signed-off-by: Tom Rix
---
drivers/g
On 4/24/23 10:02 AM, Hamza Mahfooz wrote:
On 4/20/23 09:59, Tom Rix wrote:
gcc with W=1 reports
drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:
In function ‘dc_dmub_srv_optimized_init_done’:
drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:184:26:
error: variable ‘dmub
smatch has several simailar warnings to
drivers/gpu/drm/meson/meson_venc.c:189:28: warning: symbol
'meson_hdmi_enci_mode_480i' was not declared. Should it be static?
These variables are only used in their defining file so should be static
Signed-off-by: Tom Rix
---
drivers/gpu
ble is not used, so remove it.
Which made dout unused, so also remove.
Signed-off-by: Tom Rix
---
.../display/dc/dml/dcn314/display_rq_dlg_calc_314.c| 10 --
1 file changed, 10 deletions(-)
diff --git
a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c
b/drivers/g
’:
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:529:19: error: variable
‘j’ set but not used [-Werror=unused-but-set-variable]
529 | int r, i, j;
| ^
These variables are not used, so remove them.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
*dmub;
| ^~~~
The return status is never set.
It looks like a call to dmub_srv_get_fw_boot_status is missing.
Fixes: 499e4b1c722e ("drm/amd/display: add mechanism to skip DCN init")
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/display/dc/dc_dmub_
feature_support;
| ^~~
This variable is not used so remove it.
The status of amb_feature_support should have been returned, so
set ret and return it.
Fixes: b8fe56375f78 ("drm/amd/display: Refactor ABM feature")
Signed-off-by: Tom Rix
---
drivers/g
e them.
Fixes: e97cc04fe0fb ("drm/amd/display: refactor dmub commands into single
function")
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c
b/dri
: ff13be830333 ("accel/qaic: Add datapath")
Signed-off-by: Tom Rix
---
drivers/accel/qaic/qaic_data.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/accel/qaic/qaic_data.c b/drivers/accel/qaic/qaic_data.c
index c0a574cd1b35..b46a16fb3080 100644
--- a/drivers/
smatch reports
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn314/dcn314_dccg.c:277:6: warning:
symbol
'dccg314_init' was not declared. Should it be static?
This variable is only used in one file so should be static.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/display
cpp_check reports
drivers/gpu/drm/amd/display/modules/freesync/freesync.c:1143:17: style: Variable
'oldest_index' is assigned a value that is never used. [unreadVariable]
oldest_index = 0;
^
This variable is not used so remove.
Signed-off-by: Tom Rix
---
drive
: mediatek: add support for phy-mtk-hdmi-mt8195")
Signed-off-by: Tom Rix
---
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c
b/drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c
index abfc07
, 2, 3, 4, 5};
| ^~~
These variables are defined and used in smu_v13_0_7_ppt.c and smu_v13_0_0_ppt.c.
There should be only one definition. So define the variables as globals
in smu_v13_0.c
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/pm/swsmu/inc
used so remove it.
Signed-off-by: Tom Rix
---
drivers/accel/habanalabs/gaudi/gaudi.c | 7 ---
1 file changed, 7 deletions(-)
diff --git a/drivers/accel/habanalabs/gaudi/gaudi.c
b/drivers/accel/habanalabs/gaudi/gaudi.c
index a29aa8f7b6f3..a1697581c218 100644
--- a/drivers/accel/habanalabs
clang with W=1 reports
drivers/gpu/drm/qxl/qxl_cmd.c:424:6: error: variable
'count' set but not used [-Werror,-Wunused-but-set-variable]
int count = 0;
^
This variable is not used so remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/qxl/qxl_cmd.c | 2 --
1 fi
; was not declared. Should it be static?
drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.c:86:24: warning:
symbol
'dml32_funcs' was not declared. Should it be static?
These variables are only used in one file so should be static.
Cleanup whitespace, use tabs consistently
27; was not declared. Should it be static?
These variables are only used in one file so should be static.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn
smatch reports
drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn314/dcn314_fpu.c:100:37:
warning: symbol
'dcn3_14_soc' was not declared. Should it be static?
This variable is only used in one file so should be static.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/display/dc/
smatch reports
drivers/gpu/drm/vc4/vc4_irq.c:60:1: warning: symbol
'render_wait' was not declared. Should it be static?
This variable is not used so remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/vc4/vc4_irq.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/g
smatch reports
drivers/gpu/drm/nouveau/nvkm/engine/gr/tu102.c:210:1: warning: symbol
'tu102_gr_load' was not declared. Should it be static?
This function is not used so remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/nouveau/nvkm/engine/gr/tu102.c | 13 -
1 file c
smatch reports
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c:658:26: warning: symbol
'msm8x76_config' was not declared. Should it be static?
This variable is only used in one file so should be static.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/msm/disp/mdp5/mdp5_cfg.c | 2 +-
1 file
smatch reports
drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c:610:1: warning: symbol
'gv100_disp_core_mthd_base' was not declared. Should it be static?
This variable is only used in one file so it should be static.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/nouveau/nvkm/engine/di
clang with W=1 reports
drivers/gpu/drm/nouveau/nvkm/subdev/acr/lsfw.c:221:7: error: variable
'loc' set but not used [-Werror,-Wunused-but-set-variable]
u32 loc, sig, cnt, *meta;
^
This variable is not used so remove it.
Signed-off-by: Tom Rix
--
clang with W=1 reports
drivers/gpu/drm/qxl/qxl_ioctl.c:149:14: error: variable
'num_relocs' set but not used [-Werror,-Wunused-but-set-variable]
int i, ret, num_relocs;
^
This variable is not used so remove it.
Signed-off-by: Tom Rix
---
drivers/g
clang with W=1 reports
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/amdgpu_smu.c:1700:6: error: variable
'num_of_active_display' set but not used [-Werror,-Wunused-but-set-variable]
int num_of_active_display = 0;
^
This variable is not used so remove it.
Signed-off-b
ble is not used so remove it, which caused i to be unused so remove
that as well.
Signed-off-by: Tom Rix
---
.../drm/amd/display/modules/freesync/freesync.c| 14 --
1 file changed, 14 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
b/drivers/g
ble is not used so remove it, which caused i to be unused so remove
that as well.
Signed-off-by: Tom Rix
---
.../drm/amd/display/modules/freesync/freesync.c| 14 --
1 file changed, 14 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
b/drivers/g
ariable is not used so remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c | 9 +
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c
b/drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c
index 0d
clang with W=1 reports
drivers/gpu/drm/nouveau/nouveau_svm.c:929:6: error: variable
'ret' set but not used [-Werror,-Wunused-but-set-variable]
int ret;
^
This variable is not used so remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/nouveau/nouveau_svm.c |
ned-off-by: Tom Rix
---
drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
index 41198c729d90..30c0644d4418 10
clang with W=1 reports
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c:716:21: error: unused function
'mksstat_init_record' [-Werror,-Wunused-function]
static inline char *mksstat_init_record(mksstat_kern_stats_t stat_idx,
^
This function is not used so remove it.
Signed-off-b
ned-off-by: Tom Rix
---
drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
index 8d171d71cb8a..7e112319a23c 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
+++ b/d
clang with W=1 reports
drivers/gpu/drm/gma500/psb_irq.c:35:19: error: unused function
'gma_pipe_event' [-Werror,-Wunused-function]
static inline u32 gma_pipe_event(int pipe)
^
This function is not used, so remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/
or: unused function
'set_test_mode_src_osc_freq_target_hi_bits' [-Werror,-Wunused-function]
set_test_mode_src_osc_freq_target_hi_bits(struct kmb_dsi *kmb_dsi,
^
These static functions are not used, so remove them.
Signed-off-by: Tom Rix
---
drivers/gpu/dr
remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/bridge/sii9234.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/drivers/gpu/drm/bridge/sii9234.c b/drivers/gpu/drm/bridge/sii9234.c
index 099b510ff285..2d17f227867b 100644
--- a/drivers/gpu/drm/bridge/sii9234.c
+++ b/drivers/gpu/drm/bridge
se-if-statement out to its
own if-statement so the OVERLAY check will catch when the win-type has
been changed.
Fixes: 368419a2d429 ("drm/rockchip: vop2: initialize possible_crtcs properly")
Signed-off-by: Tom Rix
---
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 9 -
1 file cha
event moving of pinned BOs")
Since the variable is not used, remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/radeon/radeon_ttm.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c
b/drivers/gpu/drm/radeon/radeon_ttm.c
index 2220cdf6a3f6..0ea430ee5256 10
smatch reports
drivers/gpu/drm/nouveau/nvkm/subdev/mc/ga100.c:51:1:
warning: symbol 'ga100_mc_device' was not declared. Should it be static?
ga100_mc_device is only used in ga100.c, so it should be static
Signed-off-by: Tom Rix
---
drivers/gpu/drm/nouveau/nvkm/subdev/mc/ga100.c
, remove it.
Signed-off-by: Tom Rix
---
.../drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c | 8
1 file changed, 8 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c
b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia_bw.c
index
res_pool is unused, remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
ng: symbol 'dcn30_mmhubbub_funcs' was not declared. Should it be static?
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_mpc.c:1402:24:
warning: symbol 'dcn30_mpc_funcs' was not declared. Should it be static?
All of these are only used in their definition file, so they should be
mbol 'dcn20_mpc_funcs' was not declared. Should it be static?
All of these are only used in their definition file, so they should be static
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c | 2 +-
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c | 2
symbol 'dcn201_mpc_funcs' was not declared. Should it be static?
All of these are only used in their definition file, so they should be static
Signed-off-by: Tom Rix
---
.../gpu/drm/amd/display/dc/clk_mgr/dcn201/dcn201_clk_mgr.c| 2 +-
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_
)
| ^
gf100_fifo_nonstall_block is only used in gf100.c, so it should be static
Signed-off-by: Tom Rix
---
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
b/drivers/gpu/drm/nouveau/nvkm/engine
, so it should be static
Signed-off-by: Tom Rix
---
drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c
b/drivers/gpu/drm/nouveau/nvkm/nvfw/acr.c
index 83a9c48bc58c..7ac90c495737 100644
--- a/drivers/gpu
)
| ^
vangogh_set_apu_thermal_limit is only used in vangogh_ppt.c, so it should be
static
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
b
smatch reports
drivers/gpu/drm/nouveau/nvkm/engine/fifo/runl.c:33:18:
warning: symbol 'nvkm_engn_cgrp_get' was not declared. Should it be static?
nvkm_engn_cgrp_get is only used in runl.c, so it should be static
Signed-off-by: Tom Rix
---
drivers/gpu/drm/nouveau/nvkm/engine/fifo/
building with gcc and W=1 reports
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c:81:29: error: variable
‘ring’ set but not used [-Werror=unused-but-set-variable]
81 | struct amdgpu_ring *ring;
| ^~~~
ring is not used so remove it.
Signed-off-by: Tom Rix
is not used so remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/amdgpu/umc_v8_10.c | 7 +--
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/umc_v8_10.c
b/drivers/gpu/drm/amd/amdgpu/umc_v8_10.c
index 66158219f791..3f051dec56e9 100644
--- a
n a garbage state at
the fail: label. There is nothing to unwinded if fbdev alloaction fails,
return NULL.
Fixes: 3fb1f62f80a1 ("drm/fb-helper: Remove drm_fb_helper_unprepare() from
drm_fb_helper_fini()")
Signed-off-by: Tom Rix
---
drivers/gpu/drm/msm/msm_fbdev.c | 2 +-
1 file chang
nly used in device.c, so they should be static
Signed-off-by: Tom Rix
---
drivers/accel/habanalabs/common/device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/accel/habanalabs/common/device.c
b/drivers/accel/habanalabs/common/device.c
index fefe70bbbede..a5f5e
smatch reports
drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c:90:6:
warning: symbol 'should_disable_otg' was not declared. Should it be static?
should_disable_otg() is only used in dcn315_clk_mgr.c, so it should be static
Signed-off-by: Tom Rix
---
drive
vice *hdev,
|^
Signed-off-by: Tom Rix
---
drivers/accel/habanalabs/common/security.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/accel/habanalabs/common/security.h
b/drivers/accel/habanalabs/common/security.h
index 23
er.
Fixes: aa5a57773042 ("drm/amd/display: Vari-bright looks disabled near end of
MM14")
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_se
citly the check != condition, an else is simplier.
Fixes: 238debcaebe4 ("drm/amd/display: Use DML for MALL SS and Subvp allocation
calculations")
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
>From reviewing the code, the line
memset(kdata, 0, usize);
is not needed because kdata is either zeroed by
kdata = kzalloc(asize, GFP_KERNEL);
when allocated at runtime or by
char stack_kdata[128] = {0};
at compile time.
Signed-off-by: Tom Rix
---
drivers/accel/habanalabs/com
There are several copies of CalculateRemoteSurfaceFlipDelay.
Reduce to one instance.
Signed-off-by: Tom Rix
---
.../dc/dml/dcn20/display_mode_vba_20.c| 4 +-
.../dc/dml/dcn20/display_mode_vba_20v2.c | 40 +--
.../dc/dml/dcn21/display_mode_vba_21.c| 40
There are several copies of CalculateTwait.
Reduce to one instance and change local variable name to match common usage.
Signed-off-by: Tom Rix
---
.../dc/dml/dcn20/display_mode_vba_20.c| 16 +++---
.../dc/dml/dcn20/display_mode_vba_20v2.c | 21 ++-
.../dc
Mimimize the function signature by passing a pointer and an index instead
of passing several elements of the pointer.
The dml2x,dml3x families uses the same algorithm. Remove the duplicates.
Use dml20_ and dml30_ prefix to distinguish the two variants.
Signed-off-by: Tom Rix
---
.../dc/dml
On 9/16/22 2:06 PM, Nathan Chancellor wrote:
Most of the arguments are identical between the two call sites and they
can be accessed through the 'struct vba_vars_st' pointer. This reduces
the total amount of stack space that
dml314_ModeSupportAndSystemConfigurationFull() uses by 240 bytes with
successful
successfule -> successful
Signed-off-by: Tom Rix
---
drivers/gpu/drm/vmwgfx/device_include/vm_basic_types.h | 2 +-
drivers/gpu/drm/vmwgfx/ttm_object.h| 4 ++--
drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 2 +-
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res
back, but I just remembered it now so I
will go ahead and push :). apologies for the delay!
Thanks!
T
On Sat, 2022-07-02 at 11:39 -0400, Tom Rix wrote:
clang static analysis reports
drivers/gpu/drm/nouveau/nvkm/subdev/bios/pmu.c:68:17: warning: The right
operand of '*' is
reduced to an if.
If nvbios_pmuEp() returns 0, via the data variable, the output info parameter
is not used. So set info only when data is not 0.
The struct nvbios_pmuE only has the type and data elements. Since both of these
are explicitly set, memset is not needed. So remove it.
Signed-off-b
spelling changes
resoluition -> resolution
dont-> don't
commmit -> commit
Invalidade -> Invalidate
Signed-off-by: Tom Rix
---
drivers/gpu/drm/i915/display/intel_psr.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu
he dma configuration from the HVS or
V3D component")
Signed-off-by: Tom Rix
---
drivers/gpu/drm/vc4/vc4_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index 2b014b6332a6..292d1b6a01b6 100644
--- a/driv
to static.
Fixes: 0efd4374f6b4 ("drm/amd/display: add dcn32 IRQ changes")
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/display/dc/irq/dcn32/irq_service_dcn32.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn32/irq_service_dcn32.
Should it be static?
Neither of thse variables is used in dc_link_dp.c. Reviewing the commit listed
in
the fixes tag shows neither was used in the original patch. So remove them.
Fixes: 265280b99822 ("drm/amd/display: add CLKMGR changes for DCN32/321")
Signed-off-by: Tom Rix
---
drive
sparse reports
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gv100.c:56:1: warning: symbol
'gv100_fifo_runlist' was not declared. Should it be static?
gv100_fifo_runlist is only used in gv100.c, so change it to static.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/nouveau/nvkm/engine/fifo/g
cppcheck reports
[drivers/video/fbdev/xen-fbfront.c:226]: (style) Assignment of function
parameter has no effect outside the function.
The value parameter 'transp' is not used, so setting it can be removed.
Signed-off-by: Tom Rix
---
drivers/video/fbdev/xen-fbfront.c | 1 -
1 file
cppcheck reports
[drivers/gpu/drm/rockchip/rockchip_drm_vop.c:186]: (style) The function
'vop_writel' is never used.
vop_writel is static function that is not used, so remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 --
1 file changed, 6
variables should be
static.
So use static as their storage-class specifiers.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/wndwgv100.c
b/drivers/
Sparse reports this issue
wimmgv100.c:39:1: warning: symbol 'gv100_disp_wimm' was not declared. Should it
be static?
This variable is only used in wimmgv100.c. Single file variables should be
static.
So use static as its storage-class specifier.
Signed-off-by: Tom Rix
---
drive
ingle file variables
should be static, so change their storage-class specifiers to static.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/radeon/si_dpm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
index 3add39
Sparse reports these issues
kmb_plane.c:21:11: warning: symbol 'layer_irqs' was not declared. Should it be
static?
layer_irq in not used, so remove it.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/kmb/kmb_plane.c | 7 ---
1 file changed, 7 deletions(-)
diff --git a/drivers/g
e only used in cik.c. Single file
symbols
should be static. So move their definitions to cik_blit_shaders.h and change
their
storage-class-specifier to static.
Remove unneeded cik_blit_shader.c
Signed-off-by: Tom Rix
---
drivers/gpu/drm/radeon/Makefile | 2 +-
drivers/gpu/drm/radeo
variables should
be static, so change their storage-class specifiers to static.
Signed-off-by: Tom Rix
---
drivers/video/fbdev/core/fbcon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index c4e917
.c. Single file use
variables should be static, so add static to their storage-class specifier.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/nouveau/nvkm/engine/disp/coregv100.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregv100.
Smatch reports this issue
cdn-dp-core.c:51:20: warning: symbol 'rk3399_cdn_dp' was not declared. Should
it be static?
rk3399_cdn_dp is only used in cdn-dp-core.c so change
its storge-class specifier to static.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/rockchip/cdn-dp-core.c | 2
Smatch reports this issue
qxl_kms.c:36:5: warning: symbol 'qxl_log_level' was not declared. Should it be
static?
qxl_log_level is defined qxl_kms.c but unused, so remove.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/qxl/qxl_kms.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/d
Smatch reports this issue
gv100.c:46:1: warning: symbol 'gv100_gsp' was not declared. Should it be static?
gv100_gsp is only used in gv100.c so change its
storage-class specifier to static.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/gv100.c | 2 +-
1 file
Smatch reports this issue
msm_ringbuffer.c:43:36: warning: symbol 'msm_sched_ops' was not declared.
Should it be static?
msm_sched_ops is only used in msm_ringbuffer.c so change its
storage-class specifier to static.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/msm/msm_ringbuffer.c
e and used elsewhere.
For consistency, add the virtual_setup_stream_attribute
decl to virtual_link_hwss.h.
Signed-off-by: Tom Rix
---
drivers/gpu/drm/amd/display/dc/virtual/virtual_link_hwss.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/amd/display/dc/virtual/virtual_link_hwss.h
Smatch reports this issue
gf108.c:147:1: warning: symbol 'gf108_gr_fwif'
was not declared. Should it be static?
gf108_gr_fwif is only used in gf108.c. Single
file variables should not be global so change
gf108_gr_fwif's storage-class specifier to static.
Signed-off-by: Tom Ri
Smatch reports this issue
base917c.c:26:1: warning: symbol 'base917c_format'
was not declared. Should it be static?
base917c_format is only used in base917.c. Single
file variables should not be global so change
base917c_format's storage-class specifier to static.
Signed-
nates.
Instead of using memset, initialize node to 0 at its
definitions.
Signed-off-by: Tom Rix
---
v2: restore clearing of flags
drivers/gpu/drm/i915/i915_gem.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
On 4/16/22 2:04 PM, Joe Perches wrote:
On Sat, 2022-04-16 at 13:48 -0700, Tom Rix wrote:
On 4/16/22 11:33 AM, Joe Perches wrote:
On Sat, 2022-04-16 at 13:23 -0400, Tom Rix wrote:
In insert_mappable_node(), the parameter node is
cleared late in node's use with memset.
insert_mappable
1 - 100 of 132 matches
Mail list logo