linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Use NULL for pointer assignment in copy_stream_update_to_stream
@ 2019-11-23 19:36 Nathan Chancellor
  2019-11-25 14:28 ` Harry Wentland
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2019-11-23 19:36 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Alex Deucher, Christian König,
	David (ChunMing) Zhou
  Cc: Dmytro Laktyushkin, Rodrigo Siqueira, Nikola Cornij, amd-gfx,
	dri-devel, linux-kernel, clang-built-linux, Nathan Chancellor

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
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index c7db4f4810c6..2645d20e8c4c 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -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;
 		}
 	}
 }
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amd/display: Use NULL for pointer assignment in copy_stream_update_to_stream
  2019-11-23 19:36 [PATCH] drm/amd/display: Use NULL for pointer assignment in copy_stream_update_to_stream Nathan Chancellor
@ 2019-11-25 14:28 ` Harry Wentland
  0 siblings, 0 replies; 2+ messages in thread
From: Harry Wentland @ 2019-11-25 14:28 UTC (permalink / raw)
  To: Nathan Chancellor, Harry Wentland, Leo Li, Alex Deucher,
	Christian König, David (ChunMing) Zhou
  Cc: Dmytro Laktyushkin, Rodrigo Siqueira, Nikola Cornij, amd-gfx,
	dri-devel, linux-kernel, clang-built-linux

On 2019-11-23 2:36 p.m., Nathan Chancellor wrote:
> 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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FClangBuiltLinux%2Flinux%2Fissues%2F777&amp;data=02%7C01%7Charry.wentland%40amd.com%7Ceb5e55813307456cf7d608d7704c79c4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C1%7C637101346080296409&amp;sdata=6HK3wWYMoILbiBisjoHkFwopV%2BuJYUh8wCDhMSvRQQ8%3D&amp;reserved=0
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> ---
>  drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
> index c7db4f4810c6..2645d20e8c4c 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
> @@ -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;
>  		}
>  	}
>  }
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-25 14:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-23 19:36 [PATCH] drm/amd/display: Use NULL for pointer assignment in copy_stream_update_to_stream Nathan Chancellor
2019-11-25 14:28 ` Harry Wentland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).