Commit 3d109770 authored by Yu Liao's avatar Yu Liao Committed by Heyuan Wang
Browse files

drm/amd/display: fix mixed declarations warning

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAU9N4


CVE: CVE-2024-46802

--------------------------------

The previous commit introduce a compile warning:
  drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:
  In function ‘dc_validate_stream’:
  drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:2920:2:
  warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    struct dc_link *link = stream->link;
    ^~~~~~

Fix this by moving those declarations before code.

Fixes: d61f7961de27 ("drm/amd/display: added NULL check at start of dc_validate_stream")
Signed-off-by: default avatarYu Liao <liaoyu15@huawei.com>
parent 05f5f1d4
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -2914,12 +2914,15 @@ void resource_build_bit_depth_reduction_params(struct dc_stream_state *stream,

enum dc_status dc_validate_stream(struct dc *dc, struct dc_stream_state *stream)
{
	struct dc_link *link;
	struct timing_generator *tg;
	enum dc_status res = DC_OK;

	if (dc == NULL || stream == NULL)
		return DC_ERROR_UNEXPECTED;

	struct dc_link *link = stream->link;
	struct timing_generator *tg = dc->res_pool->timing_generators[0];
	enum dc_status res = DC_OK;
	link = stream->link;
	tg = dc->res_pool->timing_generators[0];

	calculate_phy_pix_clks(stream);