* [PATCH] drm/amd/display: remove redundant initialization of variable result
@ 2021-03-11 16:34 Colin King
2021-03-15 18:20 ` Alex Deucher
0 siblings, 1 reply; 6+ messages in thread
From: Colin King @ 2021-03-11 16:34 UTC (permalink / raw)
To: Harry Wentland, Alex Deucher, Christian König, David Airlie,
Daniel Vetter, amd-gfx, dri-devel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable result is being initialized with a value that is
never read and it is being updated later with a new value. The
initialization 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_dp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index 099f43709060..47e6c33f73cb 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -4281,7 +4281,7 @@ void dp_set_panel_mode(struct dc_link *link, enum dp_panel_mode panel_mode)
if (edp_config_set.bits.PANEL_MODE_EDP
!= panel_mode_edp) {
- enum dc_status result = DC_ERROR_UNEXPECTED;
+ enum dc_status result;
edp_config_set.bits.PANEL_MODE_EDP =
panel_mode_edp;
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/amd/display: remove redundant initialization of variable result
2021-03-11 16:34 [PATCH] drm/amd/display: remove redundant initialization of variable result Colin King
@ 2021-03-15 18:20 ` Alex Deucher
0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2021-03-15 18:20 UTC (permalink / raw)
To: Colin King
Cc: Harry Wentland, Alex Deucher, Christian König, David Airlie,
Daniel Vetter, amd-gfx list, Maling list - DRI developers,
kernel-janitors, LKML
Applied. Thanks!
Alex
On Thu, Mar 11, 2021 at 11:34 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable result is being initialized with a value that is
> never read and it is being updated later with a new value. The
> initialization 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_dp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> index 099f43709060..47e6c33f73cb 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> @@ -4281,7 +4281,7 @@ void dp_set_panel_mode(struct dc_link *link, enum dp_panel_mode panel_mode)
>
> if (edp_config_set.bits.PANEL_MODE_EDP
> != panel_mode_edp) {
> - enum dc_status result = DC_ERROR_UNEXPECTED;
> + enum dc_status result;
>
> edp_config_set.bits.PANEL_MODE_EDP =
> panel_mode_edp;
> --
> 2.30.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/amd/display: remove redundant initialization of variable result
2020-07-23 14:36 ` Colin King
@ 2020-07-23 20:23 ` Alex Deucher
0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2020-07-23 20:23 UTC (permalink / raw)
To: Colin King
Cc: Leo Li, kernel-janitors, LKML, amd-gfx list, David Airlie,
Maling list - DRI developers, Daniel Vetter, Alex Deucher,
Harry Wentland, Christian König
Applied. Thanks!
Alex
On Thu, Jul 23, 2020 at 10:36 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable result is being initialized with a value that is never read
> and it is being updated later with a new value. The initialization is
> redundant and can be removed.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
> index 5d83e8174005..0853bc9917c7 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
> @@ -1017,7 +1017,7 @@ enum dc_status dce112_add_stream_to_ctx(
> struct dc_state *new_ctx,
> struct dc_stream_state *dc_stream)
> {
> - enum dc_status result = DC_ERROR_UNEXPECTED;
> + enum dc_status result;
>
> result = resource_map_pool_resources(dc, new_ctx, dc_stream);
>
> --
> 2.27.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] drm/amd/display: remove redundant initialization of variable result
2017-12-15 10:53 [PATCH] drm/amd/display: remove redundant null check of array 'data' Colin King
2020-07-01 14:59 ` [PATCH] drm/amd/display: remove redundant initialization of variable result Colin King
@ 2020-07-23 14:36 ` Colin King
2020-07-23 20:23 ` Alex Deucher
1 sibling, 1 reply; 6+ messages in thread
From: Colin King @ 2020-07-23 14:36 UTC (permalink / raw)
To: Harry Wentland, Leo Li, Alex Deucher, Christian König,
David Airlie, Daniel Vetter, amd-gfx, dri-devel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable result is being initialized with a value that is never read
and it is being updated later with a new value. The initialization is
redundant and can be removed.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
index 5d83e8174005..0853bc9917c7 100644
--- a/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
@@ -1017,7 +1017,7 @@ enum dc_status dce112_add_stream_to_ctx(
struct dc_state *new_ctx,
struct dc_stream_state *dc_stream)
{
- enum dc_status result = DC_ERROR_UNEXPECTED;
+ enum dc_status result;
result = resource_map_pool_resources(dc, new_ctx, dc_stream);
--
2.27.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/amd/display: remove redundant initialization of variable result
2020-07-01 14:59 ` [PATCH] drm/amd/display: remove redundant initialization of variable result Colin King
@ 2020-07-01 17:05 ` Alex Deucher
0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2020-07-01 17:05 UTC (permalink / raw)
To: Colin King
Cc: Leo Li, kernel-janitors, LKML, amd-gfx list, David Airlie,
Maling list - DRI developers, Daniel Vetter, Alex Deucher,
Harry Wentland, Christian König
On Wed, Jul 1, 2020 at 10:59 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable result is being initialized with a value that is never read
> and it is being updated later with a new value. The initialization is
> redundant and can be removed.
>
> 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_link_hwss.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
> index 1b3474aa380d..d0a23b72e604 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
> @@ -151,7 +151,8 @@ bool edp_receiver_ready_T9(struct dc_link *link)
> unsigned int tries = 0;
> unsigned char sinkstatus = 0;
> unsigned char edpRev = 0;
> - enum dc_status result = DC_OK;
> + enum dc_status result;
> +
> result = core_link_read_dpcd(link, DP_EDP_DPCD_REV, &edpRev, sizeof(edpRev));
>
> /* start from eDP version 1.2, SINK_STAUS indicate the sink is ready.*/
> @@ -177,7 +178,7 @@ bool edp_receiver_ready_T7(struct dc_link *link)
> {
> unsigned char sinkstatus = 0;
> unsigned char edpRev = 0;
> - enum dc_status result = DC_OK;
> + enum dc_status result;
>
> /* use absolute time stamp to constrain max T7*/
> unsigned long long enter_timestamp = 0;
> --
> 2.27.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] drm/amd/display: remove redundant initialization of variable result
2017-12-15 10:53 [PATCH] drm/amd/display: remove redundant null check of array 'data' Colin King
@ 2020-07-01 14:59 ` Colin King
2020-07-01 17:05 ` Alex Deucher
2020-07-23 14:36 ` Colin King
1 sibling, 1 reply; 6+ messages in thread
From: Colin King @ 2020-07-01 14:59 UTC (permalink / raw)
To: Harry Wentland, Leo Li, Alex Deucher, Christian König,
David Airlie, Daniel Vetter, amd-gfx, dri-devel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable result is being initialized with a value that is never read
and it is being updated later with a new value. The initialization 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_hwss.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
index 1b3474aa380d..d0a23b72e604 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
@@ -151,7 +151,8 @@ bool edp_receiver_ready_T9(struct dc_link *link)
unsigned int tries = 0;
unsigned char sinkstatus = 0;
unsigned char edpRev = 0;
- enum dc_status result = DC_OK;
+ enum dc_status result;
+
result = core_link_read_dpcd(link, DP_EDP_DPCD_REV, &edpRev, sizeof(edpRev));
/* start from eDP version 1.2, SINK_STAUS indicate the sink is ready.*/
@@ -177,7 +178,7 @@ bool edp_receiver_ready_T7(struct dc_link *link)
{
unsigned char sinkstatus = 0;
unsigned char edpRev = 0;
- enum dc_status result = DC_OK;
+ enum dc_status result;
/* use absolute time stamp to constrain max T7*/
unsigned long long enter_timestamp = 0;
--
2.27.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-03-15 18:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 16:34 [PATCH] drm/amd/display: remove redundant initialization of variable result Colin King
2021-03-15 18:20 ` Alex Deucher
-- strict thread matches above, loose matches on Subject: below --
2017-12-15 10:53 [PATCH] drm/amd/display: remove redundant null check of array 'data' Colin King
2020-07-01 14:59 ` [PATCH] drm/amd/display: remove redundant initialization of variable result Colin King
2020-07-01 17:05 ` Alex Deucher
2020-07-23 14:36 ` Colin King
2020-07-23 20:23 ` 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).