* [PATCH] drm/amd/display: Remove redundant initialization of variable eng_id
@ 2021-08-06 11:16 Colin King
2021-08-06 19:58 ` Alex Deucher
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-08-06 11:16 UTC (permalink / raw)
To: Harry Wentland, Leo Li, Alex Deucher, Christian König,
Xinhui.Pan, David Airlie, Daniel Vetter, Jun Lei, Jimmy Kizito,
amd-gfx, dri-devel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable eng_id is being initialized with a value that is never
read, it is being re-assigned on the next statment. The assignment
is redundant and can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
index 1a89d565c92e..de80a9ea4cfa 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
@@ -305,7 +305,7 @@ struct link_encoder *link_enc_cfg_get_next_avail_link_enc(
const struct dc_state *state)
{
struct link_encoder *link_enc = NULL;
- enum engine_id eng_id = ENGINE_ID_UNKNOWN;
+ enum engine_id eng_id;
eng_id = find_first_avail_link_enc(dc->ctx, state);
if (eng_id != ENGINE_ID_UNKNOWN)
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/amd/display: Remove redundant initialization of variable eng_id
2021-08-06 11:16 [PATCH] drm/amd/display: Remove redundant initialization of variable eng_id Colin King
@ 2021-08-06 19:58 ` Alex Deucher
0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2021-08-06 19:58 UTC (permalink / raw)
To: Colin King
Cc: Harry Wentland, Leo Li, Alex Deucher, Christian König,
xinhui pan, David Airlie, Daniel Vetter, Jun Lei, Jimmy Kizito,
amd-gfx list, Maling list - DRI developers, kernel-janitors,
LKML
Applied. Thanks!
Alex
On Fri, Aug 6, 2021 at 7:16 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable eng_id is being initialized with a value that is never
> read, it is being re-assigned on the next statment. The assignment
> is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
> index 1a89d565c92e..de80a9ea4cfa 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
> @@ -305,7 +305,7 @@ struct link_encoder *link_enc_cfg_get_next_avail_link_enc(
> const struct dc_state *state)
> {
> struct link_encoder *link_enc = NULL;
> - enum engine_id eng_id = ENGINE_ID_UNKNOWN;
> + enum engine_id eng_id;
>
> eng_id = find_first_avail_link_enc(dc->ctx, state);
> if (eng_id != ENGINE_ID_UNKNOWN)
> --
> 2.31.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-06 19:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06 11:16 [PATCH] drm/amd/display: Remove redundant initialization of variable eng_id Colin King
2021-08-06 19:58 ` 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).