Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Use NULL for pointer assignment in copy_stream_update_to_stream

Clang warns:

../drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1965:26: warning:
expression which evaluates to zero treated as a null pointer constant of
type 'struct dc_dsc_config *' [-Wnon-literal-null-conversion]
update->dsc_config = false;
^~~~~
../drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:1971:25: warning:
expression which evaluates to zero treated as a null pointer constant of
type 'struct dc_dsc_config *' [-Wnon-literal-null-conversion]
update->dsc_config = false;
^~~~~
2 warnings generated.

Fixes: f6fe4053b91f ("drm/amd/display: Use a temporary copy of the current state when updating DSC config")
Link: https://github.com/ClangBuiltLinux/linux/issues/777
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Nathan Chancellor and committed by
Alex Deucher
07863a6c dde8c8df

+2 -2
+2 -2
drivers/gpu/drm/amd/display/dc/core/dc.c
··· 1962 1962 if (!dc->res_pool->funcs->validate_bandwidth(dc, dsc_validate_context, true)) { 1963 1963 stream->timing.dsc_cfg = old_dsc_cfg; 1964 1964 stream->timing.flags.DSC = old_dsc_enabled; 1965 - update->dsc_config = false; 1965 + update->dsc_config = NULL; 1966 1966 } 1967 1967 1968 1968 dc_release_state(dsc_validate_context); 1969 1969 } else { 1970 1970 DC_ERROR("Failed to allocate new validate context for DSC change\n"); 1971 - update->dsc_config = false; 1971 + update->dsc_config = NULL; 1972 1972 } 1973 1973 } 1974 1974 }