Re: [PATCH -next] drm/amdgpu: Remove a lot of unnecessary ternary operators

2023-07-31 Thread Tom Rix
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 :

[PATCH] drm/nouveau/acr: remove unused variable loc

2023-05-25 Thread Tom Rix
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

[PATCH] drm/radeon: remove unused variable rbo

2023-05-25 Thread 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

[PATCH] drm/amdgpu: move gfx9_cs_data definition

2023-05-25 Thread Tom Rix
[] = { |^~~~ 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

[PATCH] drm/amdkfd: remove unused function get_reserved_sdma_queues_bitmap

2023-05-25 Thread Tom Rix
) ^ 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_manager.c index

[PATCH] drm/i915: simplify switch to if-elseif

2023-05-23 Thread Tom Rix
it 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

[PATCH] drm/amd/display: remove unused variables res_create_maximus_funcs and debug_defaults_diags

2023-05-23 Thread Tom Rix
= { | ^~~~ 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

[PATCH] drm/amdgpu: remove unused variable mmhub_v1_8_mmea_cgtt_clk_cntl_reg

2023-05-22 Thread Tom Rix
[] = { | ^ 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

[PATCH] drm/amdgpu: remove unused variable num_xcc

2023-05-22 Thread Tom Rix
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

[PATCH] drm/mgag200: set variable mgag200_modeset storage-class-specifier to static

2023-05-17 Thread Tom Rix
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 file changed

[PATCH] drm/nouveau/acr/ga102: set variable ga102_gsps storage-class-specifier to static

2023-05-17 Thread Tom Rix
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/ga102.c | 2

[PATCH v2] phy: mediatek: rework the floating point comparisons to fixed point

2023-05-02 Thread Tom Rix
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

[PATCH] phy: mediatek: rework the floating point comparisons to fixed point

2023-04-30 Thread Tom Rix
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

[PATCH] agp/uninorth: remove unused variable size

2023-04-28 Thread Tom Rix
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 +++ b/drivers/char/agp

[PATCH] drm/amd/display: set variable custom_backlight_curve0 storage-class-specifier to static

2023-04-26 Thread Tom Rix
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/gpu/drm/amd

Re: [PATCH] drm/amd/display: return status of dmub_srv_get_fw_boot_status

2023-04-24 Thread Tom Rix
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

[PATCH] drm/meson: set variables meson_hdmi_* storage-class-specifier to static

2023-04-23 Thread Tom Rix
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/drm/meson

[PATCH] drm/amd/display: remove unused variables dispclk_delay_subtotal and dout

2023-04-20 Thread Tom Rix
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/gpu/drm/amd

[PATCH] drm/amdgpu: remove unused variable j

2023-04-20 Thread Tom Rix
’: 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

[PATCH] drm/amd/display: return status of dmub_srv_get_fw_boot_status

2023-04-20 Thread Tom Rix
*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_

[PATCH] drm/amd/display: return status of abm_feature_support

2023-04-20 Thread Tom Rix
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

[PATCH] drm/amd/display: remove unused variables otg_inst and cmd

2023-04-19 Thread Tom Rix
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

[PATCH] accel/qaic: initialize ret variable to 0

2023-04-18 Thread Tom Rix
: 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/

[PATCH] drm/amd/display: set variable dccg314_init storage-class-specifier to static

2023-04-15 Thread Tom Rix
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/dc/dcn314

[PATCH] drm/amd/display: remove unused variable oldest_index

2023-04-14 Thread Tom Rix
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 --- drivers/gpu/drm

[PATCH] phy: mediatek: fix returning garbage

2023-04-14 Thread Tom Rix
: 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 abfc077fb0a8..c6

[PATCH] drm/amd/pm: change pmfw_decoded_link_width, speed variables to globals

2023-04-14 Thread Tom Rix
, 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

[PATCH] accel/habanalabs: remove variable gaudi_irq_name

2023-04-11 Thread Tom Rix
is not 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

[PATCH] drm/qxl: remove variable count

2023-04-08 Thread Tom Rix
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 file changed

[PATCH] drm/amd/display: set variables dml*_funcs storage-class-specifier to static

2023-04-08 Thread Tom Rix
/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 for indents. Signed-off-by: Tom Rix --- .../drm/amd/display/dc/dml

[PATCH] drm/amd/display: set variables aperture_default_system and context0_default_system storage-class-specifier to static

2023-04-06 Thread Tom Rix
. 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/dcn10_hubp.c b/drivers

[PATCH] drm/amd/display: set variable dcn3_14_soc storage-class-specifier to static

2023-04-06 Thread Tom Rix
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/dml/dcn314

[PATCH] drm/vc4: remove unused render_wait variable

2023-04-06 Thread Tom Rix
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/gpu/drm/vc4

[PATCH] drm/nouveau/gr/tu102: remove unused tu102_gr_load function

2023-04-06 Thread Tom Rix
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 changed, 13

[PATCH] drm/msm/mdp5: set varaiable msm8x76_config storage-class-specifier to static

2023-04-04 Thread Tom Rix
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 changed, 1

[PATCH] drm/nouveau/disp: set varaiable gv100_disp_core_mthd_base storage-class-specifier to static

2023-04-03 Thread Tom Rix
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/disp/gv100.c

[PATCH] drm/nouveau/acr: remove unused loc variable

2023-03-31 Thread Tom Rix
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 --- drivers

[PATCH] drm/qxl: remove unused num_relocs variable

2023-03-31 Thread 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/gpu/drm/qxl

[PATCH] drm/amd/pm: remove unused num_of_active_display variable

2023-03-31 Thread Tom Rix
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-by: Tom Rix

[PATCH] drm/amd/display: remove unused average_render_time_in_us and i variables

2023-03-30 Thread Tom Rix
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/gpu/drm/amd

[PATCH] drm/amd/display: remove unused average_render_time_in_us and i variables

2023-03-30 Thread Tom Rix
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/gpu/drm/amd

[PATCH] drm/amdkfd: remove unused sq_int_priv variable

2023-03-30 Thread Tom Rix
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 0d53f6067422

[PATCH] drm/nouveau/svm: remove unused ret variable

2023-03-29 Thread Tom Rix
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 | 5 ++--- 1

[PATCH] drm/amd/display: remove unused matching_stream_ptrs variable

2023-03-25 Thread Tom Rix
-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 100644

[PATCH] drm/vmwgfx: remove unused mksstat_init_record function

2023-03-24 Thread Tom Rix
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-by: Tom Rix

[PATCH] drm/vmwgfx: remove unused vmw_overlay function

2023-03-21 Thread Tom Rix
-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/drivers/gpu

[PATCH] drm/gma500: remove unused gma_pipe_event function

2023-03-19 Thread Tom Rix
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/drm/gma500

[PATCH] drm/kmb: remove unused set_test_mode_src_osc_freq_target_low, hi_bits functions

2023-03-18 Thread Tom Rix
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/drm/kmb/kmb_dsi.c | 28

[PATCH] gpu: drm: bridge: sii9234: remove unused bridge_to_sii9234 function

2023-03-17 Thread Tom Rix
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/sii9234.c

[PATCH] drm/rockchip: vop2: fix uninitialized variable possible_crtcs

2023-03-16 Thread Tom Rix
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 changed, 4 insertions(+), 5 delet

[PATCH] drm/radeon: remove unused variable rbo

2023-03-14 Thread Tom Rix
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..0ea430ee5

[PATCH] drm/nouveau/mc: set ga100_mc_device storage-class-specifier to static

2023-03-12 Thread Tom Rix
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 | 2 +- 1

[PATCH] drm/amd/display: remove unused variable available

2023-03-08 Thread Tom Rix
, 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

[PATCH] drm/amd/display: remove unused variable res_pool

2023-03-08 Thread Tom Rix
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

[PATCH] drm/amd/display: change several dcn30 variables storage-class-specifier to static

2023-03-05 Thread Tom Rix
'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 static Signed-off-by: Tom Rix

[PATCH] drm/amd/display: change several dcn20 variables storage-class-specifier to static

2023-03-04 Thread Tom Rix
' 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 +- drivers/gpu/drm/amd/display/dc/dcn20

[PATCH] drm/amd/display: change several dcn201 variables storage-class-specifier to static

2023-03-04 Thread Tom Rix
' 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_mpc.c| 2 +- drivers/gpu/drm

[PATCH] drm/nouveau/fifo: set gf100_fifo_nonstall_block_dump storage-class-specifier to static

2023-03-03 Thread Tom Rix
) | ^ 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

[PATCH] drm/nouveau/nvfw/acr: set wpr_generic_header_dump storage-class-specifier to static

2023-03-02 Thread Tom Rix
, 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

[PATCH] drm/amd/pm: set vangogh_set_apu_thermal_limit storage-class-specifier to static

2023-03-01 Thread Tom Rix
) | ^ 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

[PATCH] drm/nouveau/fifo: set nvkm_engn_cgrp_get storage-class-specifier to static

2023-02-28 Thread Tom Rix
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/runl.c | 2

[PATCH] drm/amdgpu: remove unused variable ring

2023-02-24 Thread Tom Rix
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

[PATCH] drm/amdgpu: remove unused variable channel_index

2023-02-24 Thread 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

[PATCH] drm/msm: return early when allocating fbdev fails

2023-02-22 Thread Tom Rix
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 changed, 1 insertion(+),

[PATCH] habanalabs: set hl_capture_*_err storage-class-specifier to static

2023-02-13 Thread Tom Rix
, 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..a5f5ee102823 100644

[PATCH] drm/amd/display: set should_disable_otg storage-class-specifier to static

2023-02-09 Thread Tom Rix
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 --- drivers/gpu/drm

[PATCH] habanalabs: change unused extern decl of hdev to forward decl of hl_device

2023-02-08 Thread Tom Rix
, |^ 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 234b4a6ed8bc

[PATCH] drm/amd/display: reduce else-if to else in dcn10_blank_pixel_data()

2023-01-26 Thread Tom Rix
: 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_sequencer.c

[PATCH] drm/amd/display: reduce else-if to else in dcn32_calculate_dlg_params()

2023-01-26 Thread Tom Rix
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 --git a/dr

[PATCH] habanalabs: remove redundant memset

2023-01-07 Thread Tom Rix
>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

[PATCH] drm/amd/display: remove redundant CalculateRemoteSurfaceFlipDelay's

2022-09-19 Thread Tom Rix
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

[PATCH] drm/amd/display: remove redundant CalculateTWait's

2022-09-18 Thread Tom Rix
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

[PATCH] drm/amd/display: refactor CalculateWriteBackDelay to use vba_vars_st ptr

2022-09-17 Thread Tom Rix
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

Re: [PATCH 1/2] drm/amd/display: Reduce number of arguments of dml314's CalculateWatermarksAndDRAMSpeedChangeSupport()

2022-09-16 Thread Tom Rix
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

[PATCH] drm/vmwgfx: cleanup comments

2022-07-30 Thread Tom Rix
l 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.c

Re: [PATCH] drm/nouveau/bios: set info only when the return is not 0

2022-07-16 Thread Tom Rix
, 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 a garbage value

[PATCH] drm/nouveau/bios: set info only when the return is not 0

2022-07-02 Thread Tom Rix
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-by: Tom Rix

[PATCH] drm/i915/display: clean up comments

2022-07-01 Thread Tom Rix
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/drm/

[PATCH] drm/vc4: change vc4_dma_range_matches from a global to static

2022-06-29 Thread Tom Rix
ation 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/drivers/gpu/drm/vc4

[PATCH] drm/amd/display: change to_dal_irq_source_dnc32() storage class specifier to static

2022-06-26 Thread Tom Rix
. 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.c b/drive

[PATCH] drm/amd/display: Remove unused globals FORCE_RATE and FORCE_LANE_COUNT

2022-06-26 Thread Tom Rix
? 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 --- drivers/gpu/drm/amd/displ

[PATCH] drm/nouveau/fifo/gv100-: set gv100_fifo_runlist storage-class to static

2022-05-28 Thread Tom Rix
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/gv100.c | 2

[PATCH] xen: remove setting of 'transp' parameter

2022-05-21 Thread Tom Rix
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 changed, 1

[PATCH] drm/rockchip: remove vop_writel

2022-05-21 Thread Tom Rix
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 deletions

[PATCH] drm/nouveau/disp/gv100: make gv100_disp_wndw and gv100_disp_wndw_mthd static

2022-04-25 Thread Tom Rix
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/gpu/drm/nouveau/nvkm

[PATCH] drm/nouveau/disp/gv100: make gv100_disp_wimm static

2022-04-25 Thread Tom Rix
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 --- drivers/gpu/drm

[PATCH] drm/radeon: change cac_weights_* to static

2022-04-23 Thread Tom Rix
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 3add39c1a689..fbf968e3f6d7

[PATCH] drm/kmb: remove layer_irqs variable

2022-04-23 Thread Tom Rix
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/gpu/drm/kmb

[PATCH] drm/radeon: change cik_default_state table from global to static

2022-04-23 Thread Tom Rix
. 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/radeon/cik_blit_shaders.c

[PATCH] fbcon: change fbcon_*registered_fb variables to static

2022-04-23 Thread Tom Rix
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 c4e91715ef00..225ac0fe0143

[PATCH] drm/nouveau/kms/gv100: use static for gv100_disp_core_mthd_[base|sor]

2022-04-22 Thread Tom Rix
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.c b/drivers/gpu/drm

[PATCH] drm/rockchip: cdn-dp: change rk3399_cdn_dp from global to static

2022-04-21 Thread Tom Rix
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 +- 1 file

[PATCH] drm/qxl: remove qxl_log_level global

2022-04-21 Thread Tom Rix
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/drivers/gpu

[PATCH] drm/nouveau/gsp: change gv100_gsp from global to static

2022-04-21 Thread Tom Rix
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 changed, 1

[PATCH] drm/msm: change msm_sched_ops from global to static

2022-04-21 Thread Tom Rix
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 | 2 +- 1

[PATCH] drm/amd/display: add virtual_setup_stream_attribute decl to header

2022-04-18 Thread Tom Rix
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 b/drivers

[PATCH] drm/nouveau/gr/gf100-: change gf108_gr_fwif from global to static

2022-04-18 Thread Tom Rix
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 Rix --- drivers

[PATCH] drm/nouveau: change base917c_format from global to static

2022-04-18 Thread Tom Rix
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-off-by: Tom Rix

[PATCH v2] drm/i915: change node clearing from memset to initialization

2022-04-16 Thread Tom Rix
. 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 index

Re: [PATCH] drm/i915: change node clearing from memset to initialization

2022-04-16 Thread Tom Rix
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_node

  1   2   >