Skip to content

Commit

Permalink
drm/amd/display: Use NULL for pointer assignment in copy_stream_updat…
Browse files Browse the repository at this point in the history
…e_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: f6fe405 ("drm/amd/display: Use a temporary copy of the current state when updating DSC config")
Link: ClangBuiltLinux#777
Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Nathan Chancellor <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
  • Loading branch information
nathanchance authored and alexdeucher committed Nov 26, 2019
1 parent dde8c8d commit 07863a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/amd/display/dc/core/dc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1962,13 +1962,13 @@ static void copy_stream_update_to_stream(struct dc *dc,
if (!dc->res_pool->funcs->validate_bandwidth(dc, dsc_validate_context, true)) {
stream->timing.dsc_cfg = old_dsc_cfg;
stream->timing.flags.DSC = old_dsc_enabled;
update->dsc_config = false;
update->dsc_config = NULL;
}

dc_release_state(dsc_validate_context);
} else {
DC_ERROR("Failed to allocate new validate context for DSC change\n");
update->dsc_config = false;
update->dsc_config = NULL;
}
}
}
Expand Down

0 comments on commit 07863a6

Please sign in to comment.