]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amd/display: Use NULL for pointer assignment in copy_stream_update_to_stream
authorNathan Chancellor <natechancellor@gmail.com>
Sat, 23 Nov 2019 19:36:39 +0000 (12:36 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Nov 2019 14:48:57 +0000 (09:48 -0500)
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>
drivers/gpu/drm/amd/display/dc/core/dc.c

index c7db4f4810c6bfc88c3110507990f996a30ee128..2645d20e8c4ced6a364727eb74e063a437c452fc 100644 (file)
@@ -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;
                }
        }
 }