lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_O-7r-zsRechjuy2NatJ=kRVnRiq5366RDdvMfbGB9u+g@mail.gmail.com>
Date:   Thu, 20 May 2021 15:28:52 -0400
From:   Alex Deucher <alexdeucher@...il.com>
To:     Wei Yongjun <weiyongjun1@...wei.com>
Cc:     Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>, Leo Liu <leo.liu@....com>,
        James Zhu <James.Zhu@....com>,
        Deepak R Varma <mh12gx2825@...il.com>,
        Colin Ian King <colin.king@...onical.com>,
        Hulk Robot <hulkci@...wei.com>,
        kernel-janitors@...r.kernel.org,
        Maling list - DRI developers 
        <dri-devel@...ts.freedesktop.org>,
        amd-gfx list <amd-gfx@...ts.freedesktop.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] drm/amdgpu: fix unused-but-set-variable warnings

Applied.  Thanks!

On Thu, May 20, 2021 at 9:32 AM Wei Yongjun <weiyongjun1@...wei.com> wrote:
>
> GCC reports the following warnings with W=1:
>
> drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c:190:22: warning:
>  variable 'ring' set but not used [-Wunused-but-set-variable]
>   190 |  struct amdgpu_ring *ring;
>       |                      ^~~~
> drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c:162:22: warning:
>  variable 'ring' set but not used [-Wunused-but-set-variable]
>   162 |  struct amdgpu_ring *ring;
>       |                      ^~~~
> drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c:383:22: warning:
>  variable 'ring' set but not used [-Wunused-but-set-variable]
>   383 |  struct amdgpu_ring *ring;
>       |                      ^~~~
>
> Those variables are not really used, so remove them
> to fix the warnings.
>
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 2 --
>  drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 2 --
>  drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c  | 3 ---
>  3 file changed, 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
> index 938ef4ce5b76..af6f45c3f6fc 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
> @@ -187,14 +187,12 @@ static int jpeg_v2_5_hw_init(void *handle)
>  static int jpeg_v2_5_hw_fini(void *handle)
>  {
>         struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> -       struct amdgpu_ring *ring;
>         int i;
>
>         for (i = 0; i < adev->jpeg.num_jpeg_inst; ++i) {
>                 if (adev->jpeg.harvest_config & (1 << i))
>                         continue;
>
> -               ring = &adev->jpeg.inst[i].ring_dec;
>                 if (adev->jpeg.cur_state != AMD_PG_STATE_GATE &&
>                       RREG32_SOC15(JPEG, i, mmUVD_JRBC_STATUS))
>                         jpeg_v2_5_set_powergating_state(adev, AMD_PG_STATE_GATE);
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
> index 94be35357f7d..b4d53d1a6123 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
> @@ -159,9 +159,7 @@ static int jpeg_v3_0_hw_init(void *handle)
>  static int jpeg_v3_0_hw_fini(void *handle)
>  {
>         struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> -       struct amdgpu_ring *ring;
>
> -       ring = &adev->jpeg.inst->ring_dec;
>         if (adev->jpeg.cur_state != AMD_PG_STATE_GATE &&
>               RREG32_SOC15(JPEG, 0, mmUVD_JRBC_STATUS))
>                 jpeg_v3_0_set_powergating_state(adev, AMD_PG_STATE_GATE);
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
> index 946335d0f19c..d60358767d10 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
> @@ -380,15 +380,12 @@ static int vcn_v3_0_hw_init(void *handle)
>  static int vcn_v3_0_hw_fini(void *handle)
>  {
>         struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> -       struct amdgpu_ring *ring;
>         int i;
>
>         for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
>                 if (adev->vcn.harvest_config & (1 << i))
>                         continue;
>
> -               ring = &adev->vcn.inst[i].ring_dec;
> -
>                 if (!amdgpu_sriov_vf(adev)) {
>                         if ((adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) ||
>                                         (adev->vcn.cur_state != AMD_PG_STATE_GATE &&

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ