[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADnq5_Nj1f+6mhd-w9XC62vuvA8Ndep9dV=AQED4v7D6YjzH4w@mail.gmail.com>
Date: Tue, 22 Feb 2022 11:29:14 -0500
From: Alex Deucher <alexdeucher@...il.com>
To: Maíra Canal <maira.canal@....br>
Cc: "Deucher, Alexander" <alexander.deucher@....com>,
Christian Koenig <christian.koenig@....com>,
xinhui pan <Xinhui.Pan@....com>,
Hawking Zhang <Hawking.Zhang@....com>,
John Clements <john.clements@....com>,
Tao Zhou <tao.zhou1@....com>,
"Chai, Thomas" <YiPeng.Chai@....com>,
"Tuikov, Luben" <luben.tuikov@....com>,
"Stanley.Yang" <Stanley.Yang@....com>,
Dennis Li <Dennis.Li@....com>,
"Joshi, Mukul" <mukul.joshi@....com>,
"Wentland, Harry" <harry.wentland@....com>,
"Leo (Sunpeng) Li" <sunpeng.li@....com>,
"Siqueira, Rodrigo" <Rodrigo.Siqueira@....com>,
Anthony Koo <Anthony.Koo@....com>,
Magali Lemes <magalilemes00@...il.com>,
LKML <linux-kernel@...r.kernel.org>,
Maling list - DRI developers
<dri-devel@...ts.freedesktop.org>, mwen@...lia.com,
amd-gfx list <amd-gfx@...ts.freedesktop.org>,
Isabella Basso <isabbasso@...eup.net>
Subject: Re: [PATCH 02/10] drm/amdgpu: Remove tmp unused variable
On Tue, Feb 22, 2022 at 8:17 AM Maíra Canal <maira.canal@....br> wrote:
>
> The variable tmp is not used in the dce_v6_0_hpd_fini and
> dce_v8_0_hpd_fini functions. Therefor, the variable is removed in order to
> avoid the following Clang warnings:
>
> drivers/gpu/drm/amd/amdgpu/dce_v6_0.c:331:6: warning: variable 'tmp' set but
> not used [-Wunused-but-set-variable]
> u32 tmp;
> ^
> drivers/gpu/drm/amd/amdgpu/dce_v8_0.c:325:6: warning: variable 'tmp' set but
> not used [-Wunused-but-set-variable]
> u32 tmp;
> ^
>
> Signed-off-by: Maíra Canal <maira.canal@....br>
> ---
> drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 4 +---
> drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 4 +---
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> index b90bc2adf778..2c61f0c2e709 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> @@ -328,7 +328,6 @@ static void dce_v6_0_hpd_fini(struct amdgpu_device *adev)
> struct drm_device *dev = adev_to_drm(adev);
> struct drm_connector *connector;
> struct drm_connector_list_iter iter;
> - u32 tmp;
>
> drm_connector_list_iter_begin(dev, &iter);
> drm_for_each_connector_iter(connector, &iter) {
> @@ -337,8 +336,7 @@ static void dce_v6_0_hpd_fini(struct amdgpu_device *adev)
> if (amdgpu_connector->hpd.hpd >= adev->mode_info.num_hpd)
> continue;
>
> - tmp = RREG32(mmDC_HPD1_CONTROL + hpd_offsets[amdgpu_connector->hpd.hpd]);
> - tmp &= ~DC_HPD1_CONTROL__DC_HPD1_EN_MASK;
> + RREG32(mmDC_HPD1_CONTROL + hpd_offsets[amdgpu_connector->hpd.hpd]);
> WREG32(mmDC_HPD1_CONTROL + hpd_offsets[amdgpu_connector->hpd.hpd], 0);
We should be writing tmp out here rather than 0.
>
> amdgpu_irq_put(adev, &adev->hpd_irq, amdgpu_connector->hpd.hpd);
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
> index 7c1379b02f94..c5e9c5dbd165 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
> @@ -322,7 +322,6 @@ static void dce_v8_0_hpd_fini(struct amdgpu_device *adev)
> struct drm_device *dev = adev_to_drm(adev);
> struct drm_connector *connector;
> struct drm_connector_list_iter iter;
> - u32 tmp;
>
> drm_connector_list_iter_begin(dev, &iter);
> drm_for_each_connector_iter(connector, &iter) {
> @@ -331,8 +330,7 @@ static void dce_v8_0_hpd_fini(struct amdgpu_device *adev)
> if (amdgpu_connector->hpd.hpd >= adev->mode_info.num_hpd)
> continue;
>
> - tmp = RREG32(mmDC_HPD1_CONTROL + hpd_offsets[amdgpu_connector->hpd.hpd]);
> - tmp &= ~DC_HPD1_CONTROL__DC_HPD1_EN_MASK;
> + RREG32(mmDC_HPD1_CONTROL + hpd_offsets[amdgpu_connector->hpd.hpd]);
> WREG32(mmDC_HPD1_CONTROL + hpd_offsets[amdgpu_connector->hpd.hpd], 0);
Same here. Care to send a patch to fix this up?
Thanks,
Alex
>
> amdgpu_irq_put(adev, &adev->hpd_irq, amdgpu_connector->hpd.hpd);
> --
> 2.35.1
>
Powered by blists - more mailing lists