dri-devel Archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Return value of function
@ 2023-08-03 14:11 Denis Arefev
  2023-08-07 16:06 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Arefev @ 2023-08-03 14:11 UTC (permalink / raw
  To: Harry Wentland
  Cc: trufanov, lvc-project, Leo Li, Wenjing Liu, Pan, Xinhui,
	Rodrigo Siqueira, linux-kernel, amd-gfx, vfh, dri-devel,
	Alex Deucher, Jun Lei, Christian König

Added return value check hpd_enable

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Denis Arefev <arefev@swemel.ru>
---
 drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
index fa314493ffc5..bf2f620aeb66 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
@@ -1645,7 +1645,7 @@ void dce110_link_encoder_enable_hpd(struct link_encoder *enc)
 	uint32_t hpd_enable = 0;
 	uint32_t value = dm_read_reg(ctx, addr);
 
-	get_reg_field_value(hpd_enable, DC_HPD_CONTROL, DC_HPD_EN);
+	hpd_enable = get_reg_field_value(hpd_enable, DC_HPD_CONTROL, DC_HPD_EN);
 
 	if (hpd_enable == 0)
 		set_reg_field_value(value, 1, DC_HPD_CONTROL, DC_HPD_EN);
-- 
2.25.1


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

* Re: [PATCH] drm/amd/display: Return value of function
  2023-08-03 14:11 [PATCH] drm/amd/display: Return value of function Denis Arefev
@ 2023-08-07 16:06 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2023-08-07 16:06 UTC (permalink / raw
  To: Denis Arefev
  Cc: trufanov, lvc-project, Leo Li, Rodrigo Siqueira, Pan, Xinhui,
	Wenjing Liu, linux-kernel, amd-gfx, vfh, dri-devel, Alex Deucher,
	Jun Lei, Christian König

Applied.  Thanks!

On Thu, Aug 3, 2023 at 10:18 AM Denis Arefev <arefev@swemel.ru> wrote:
>
> Added return value check hpd_enable
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Denis Arefev <arefev@swemel.ru>
> ---
>  drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
> index fa314493ffc5..bf2f620aeb66 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c
> @@ -1645,7 +1645,7 @@ void dce110_link_encoder_enable_hpd(struct link_encoder *enc)
>         uint32_t hpd_enable = 0;
>         uint32_t value = dm_read_reg(ctx, addr);
>
> -       get_reg_field_value(hpd_enable, DC_HPD_CONTROL, DC_HPD_EN);
> +       hpd_enable = get_reg_field_value(hpd_enable, DC_HPD_CONTROL, DC_HPD_EN);
>
>         if (hpd_enable == 0)
>                 set_reg_field_value(value, 1, DC_HPD_CONTROL, DC_HPD_EN);
> --
> 2.25.1
>

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

end of thread, other threads:[~2023-08-07 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03 14:11 [PATCH] drm/amd/display: Return value of function Denis Arefev
2023-08-07 16:06 ` 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 read-only IMAP folder(s) and NNTP newsgroup(s).