linux/drivers/gpu/drm/amd/display
Nathan Chancellor fc71f615fd drm/amd/display: Fix -Wuninitialized in dm_helpers_dp_mst_send_payload_allocation()
When building with clang, there is a warning (or error when
CONFIG_WERROR is set):

  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:368:21: error: variable 'old_payload' is uninitialized when used here [-Werror,-Wuninitialized]
    368 |                                                  new_payload, old_payload);
        |                                                               ^~~~~~~~~~~
  drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:344:61: note: initialize the variable 'old_payload' to silence this warning
    344 |         struct drm_dp_mst_atomic_payload *new_payload, *old_payload;
        |                                                                    ^
        |                                                                     = NULL
  1 error generated.

This variable is not required outside of this function so allocate
old_payload on the stack and pass it by reference to
dm_helpers_construct_old_payload(), resolving the warning.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1931
Fixes: 5aa1dfcdf0 ("drm/mst: Refactor the flow for payload allocation/removement")
Reviewed-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230913-fix-wuninitialized-dm_helpers_dp_mst_send_payload_allocation-v1-1-2d1b0a3ef16c@kernel.org
2023-09-13 17:07:18 -04:00
..
amdgpu_dm drm/amd/display: Fix -Wuninitialized in dm_helpers_dp_mst_send_payload_allocation() 2023-09-13 17:07:18 -04:00
dc drm/amd/display: 3.2.241 2023-06-30 13:12:16 -04:00
dmub drm/amd/display: Set minimum requirement for using PSR-SU on Phoenix 2023-06-30 13:11:36 -04:00
include drm/amd/display: fix compilation error due to shifting negative value 2023-06-09 12:38:19 -04:00
modules Revert "drm/amd: Disable PSR-SU on Parade 0803 TCON" 2023-06-30 13:11:36 -04:00
Kconfig Merge tag 'amd-drm-next-6.5-2023-06-09' of https://gitlab.freedesktop.org/agd5f/linux into drm-next 2023-06-15 14:11:22 +10:00
Makefile drm/amd/display: Drop CONFIG_DRM_AMD_DC_HDCP 2023-03-07 14:22:39 -05:00
TODO