UPSTREAM: 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: 5aa1dfcd ("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
(cherry picked from commit fc71f615)
BUG=b:332903004, b:322223603
TEST=Verify the link training fallback for UHBR<->non-UHBR rates
Change-Id: I918fa2a9ca40456364487228d6f8da5eb7de373b
Signed-off-by:
Rakshith M O <rakshith.m.o@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5802896
Reviewed-by:
Manasi Navare <navaremanasi@chromium.org>
Reviewed-by:
Sean Paul <sean@poorly.run>
Signed-off-by:
Hubert Mazur <hmazur@google.com>
Loading
Please sign in to comment