Skip to contentSkip to conversation

drm/amd: Return NULL instead of false in dcn201_acquire_idle_pipe_for_layer()

PATCH Applied Nathan Chancellor 3 participants 4 messages Sep 30, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd: Return NULL instead of false in dcn201_acquire_idle_pipe_for_layer()

Clang warns:

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn201/dcn201_resource.c:1017:10: error: expression which evaluates to zero treated as a null pointer constant of type 'struct pipe_ctx *' [-Werror,-Wnon-literal-null-conversion]

                return false;
                       ^~~~~

1 error generated.

Use NULL instead of false since the function is returning a pointer rather than a boolean.

Fixes ff7e396f822f ("drm/amd/display: add cyan_skillfish display support")
---
 drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c +1 -1
index aec276e1db65..8523a048e6f6 100644
@@ -1014,7 +1014,7 @@ static struct pipe_ctx *dcn201_acquire_idle_pipe_for_layer(
 		ASSERT(0);
 
 	if (!idle_pipe)
-		return false;
+		return NULL;
 
 	idle_pipe->stream = head_pipe->stream;
 	idle_pipe->stream_res.tg = head_pipe->stream_res.tg;

base-commit: b47b99e30cca8906753c83205e8c6179045dd725

Signature · 1 line
2.33.0.591.gddb1055343
Applied
#1 lore raw

Applied. Thanks!

Alex

Quoted 36 lines · Nathan Chancellor

Clang warns:

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn201/dcn201_resource.c:1017:10: error: expression which evaluates to zero treated as a null pointer constant of type 'struct pipe_ctx *' [-Werror,-Wnon-literal-null-conversion]

                return false;
                       ^~~~~

1 error generated.

Use NULL instead of false since the function is returning a pointer rather than a boolean.

Fixes ff7e396f822f ("drm/amd/display: add cyan_skillfish display support")
---
 drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c +1 -1
index aec276e1db65..8523a048e6f6 100644
@@ -1014,7 +1014,7 @@ static struct pipe_ctx *dcn201_acquire_idle_pipe_for_layer(
                ASSERT(0);
 
        if (!idle_pipe)
-               return false;
+               return NULL;
 
        idle_pipe->stream = head_pipe->stream;
        idle_pipe->stream_res.tg = head_pipe->stream_res.tg;

base-commit: b47b99e30cca8906753c83205e8c6179045dd725 --
2.33.0.591.gddb1055343

#2 lore raw
Quoted 8 lines · Alex Deucher

Applied. Thanks!

Alex

Quoted 2 lines · Nathan Chancellor

Clang warns:

Any chance AMDGPU folks can look into adding clang to the CI roster?

Signature · 2 lines
Thanks,
~Nick Desaulniers
#3 lore raw
Quoted 5 lines · Nick Desaulniers
Quoted 3 lines · Alex Deucher

Applied. Thanks!

Quoted 7 lines
Quoted 5 lines

Alex

Quoted 2 lines · Nathan Chancellor

Clang warns:

Any chance AMDGPU folks can look into adding clang to the CI roster?

We can look into it. We may already be doing it for some groups.

Alex

Quoted 3 lines

--
Thanks,
~Nick Desaulniers