* [PATCH][next] drm/amd/display: remove redundant variable status
@ 2019-11-08 16:29 Colin King
[not found] ` <20191108162945.180624-1-colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2019-11-08 16:29 UTC (permalink / raw)
To: Leo Li, Alex Deucher, Christian König, David Zhou,
David Airlie, Daniel Vetter, amd-gfx, dri-devel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Variable status is redundant, it is being initialized with a value
that is over-written later and this is being returned immediately
after the assignment. Clean up the code by removing status and
just returning the value returned from the call to function
dc->hwss.dmdata_status_done.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
index 371d49e9b745..88a84bfaea6f 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -565,7 +565,6 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,
bool dc_stream_dmdata_status_done(struct dc *dc, struct dc_stream_state *stream)
{
- bool status = true;
struct pipe_ctx *pipe = NULL;
int i;
@@ -581,8 +580,7 @@ bool dc_stream_dmdata_status_done(struct dc *dc, struct dc_stream_state *stream)
if (i == MAX_PIPES)
return true;
- status = dc->hwss.dmdata_status_done(pipe);
- return status;
+ return dc->hwss.dmdata_status_done(pipe);
}
bool dc_stream_set_dynamic_metadata(struct dc *dc,
--
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH][next] drm/amd/display: remove redundant variable status
[not found] ` <20191108162945.180624-1-colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
@ 2019-11-08 16:34 ` Alex Deucher
2019-11-08 16:34 ` Alex Deucher
0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2019-11-08 16:34 UTC (permalink / raw)
To: Colin King
Cc: David Zhou, Leo Li, kernel-janitors-u79uwXL29TY76Z2rM5mHXA, LKML,
amd-gfx list, David Airlie, Maling list - DRI developers,
Daniel Vetter, Alex Deucher, Christian König
On Fri, Nov 8, 2019 at 11:29 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> Variable status is redundant, it is being initialized with a value
> that is over-written later and this is being returned immediately
> after the assignment. Clean up the code by removing status and
> just returning the value returned from the call to function
> dc->hwss.dmdata_status_done.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied. thanks!
Alex
> ---
> drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> index 371d49e9b745..88a84bfaea6f 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> @@ -565,7 +565,6 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,
>
> bool dc_stream_dmdata_status_done(struct dc *dc, struct dc_stream_state *stream)
> {
> - bool status = true;
> struct pipe_ctx *pipe = NULL;
> int i;
>
> @@ -581,8 +580,7 @@ bool dc_stream_dmdata_status_done(struct dc *dc, struct dc_stream_state *stream)
> if (i == MAX_PIPES)
> return true;
>
> - status = dc->hwss.dmdata_status_done(pipe);
> - return status;
> + return dc->hwss.dmdata_status_done(pipe);
> }
>
> bool dc_stream_set_dynamic_metadata(struct dc *dc,
> --
> 2.20.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][next] drm/amd/display: remove redundant variable status
2019-11-08 16:34 ` Alex Deucher
@ 2019-11-08 16:34 ` Alex Deucher
0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2019-11-08 16:34 UTC (permalink / raw)
To: Colin King
Cc: Leo Li, kernel-janitors, LKML, amd-gfx list, David Airlie,
Maling list - DRI developers, Alex Deucher, Christian König
On Fri, Nov 8, 2019 at 11:29 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> Variable status is redundant, it is being initialized with a value
> that is over-written later and this is being returned immediately
> after the assignment. Clean up the code by removing status and
> just returning the value returned from the call to function
> dc->hwss.dmdata_status_done.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied. thanks!
Alex
> ---
> drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> index 371d49e9b745..88a84bfaea6f 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> @@ -565,7 +565,6 @@ bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,
>
> bool dc_stream_dmdata_status_done(struct dc *dc, struct dc_stream_state *stream)
> {
> - bool status = true;
> struct pipe_ctx *pipe = NULL;
> int i;
>
> @@ -581,8 +580,7 @@ bool dc_stream_dmdata_status_done(struct dc *dc, struct dc_stream_state *stream)
> if (i == MAX_PIPES)
> return true;
>
> - status = dc->hwss.dmdata_status_done(pipe);
> - return status;
> + return dc->hwss.dmdata_status_done(pipe);
> }
>
> bool dc_stream_set_dynamic_metadata(struct dc *dc,
> --
> 2.20.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-08 16:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-08 16:29 [PATCH][next] drm/amd/display: remove redundant variable status Colin King
[not found] ` <20191108162945.180624-1-colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2019-11-08 16:34 ` Alex Deucher
2019-11-08 16:34 ` Alex Deucher
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).