mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: remove unused variable ring
@ 2023-02-24 16:45 Tom Rix
  2023-02-24 22:22 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Rix @ 2023-02-24 16:45 UTC (permalink / raw)
  To: alexander.deucher, christian.koenig, Xinhui.Pan, airlied, daniel,
	ruijing.dong, Jane.Jian, James.Zhu, tao.zhou1, sonny.jiang,
	leo.liu
  Cc: amd-gfx, dri-devel, linux-kernel, Tom Rix

building with gcc and W=1 reports
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c:81:29: error: variable
  ‘ring’ set but not used [-Werror=unused-but-set-variable]
   81 |         struct amdgpu_ring *ring;
      |                             ^~~~

ring is not used so remove it.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
index 213b43670f23..023a1fffa6a9 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
@@ -78,12 +78,10 @@ static void vcn_v4_0_set_ras_funcs(struct amdgpu_device *adev);
 static int vcn_v4_0_early_init(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-	struct amdgpu_ring *ring;
 
 	if (amdgpu_sriov_vf(adev)) {
 		adev->vcn.harvest_config = VCN_HARVEST_MMSCH;
 		for (int i = 0; i < adev->vcn.num_vcn_inst; ++i) {
-			ring = &adev->vcn.inst[i].ring_enc[0];
 			if (amdgpu_vcn_is_disabled_vcn(adev, VCN_ENCODE_RING, i)) {
 				adev->vcn.harvest_config |= 1 << i;
 				dev_info(adev->dev, "VCN%d is disabled by hypervisor\n", i);
-- 
2.27.0


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

* Re: [PATCH] drm/amdgpu: remove unused variable ring
  2023-02-24 16:45 [PATCH] drm/amdgpu: remove unused variable ring Tom Rix
@ 2023-02-24 22:22 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2023-02-24 22:22 UTC (permalink / raw)
  To: Tom Rix
  Cc: alexander.deucher, christian.koenig, Xinhui.Pan, airlied, daniel,
	ruijing.dong, Jane.Jian, James.Zhu, tao.zhou1, sonny.jiang,
	leo.liu, dri-devel, amd-gfx, linux-kernel

Applied.  Thanks!

Alex

On Fri, Feb 24, 2023 at 11:45 AM Tom Rix <trix@redhat.com> wrote:
>
> building with gcc and W=1 reports
> drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c:81:29: error: variable
>   ‘ring’ set but not used [-Werror=unused-but-set-variable]
>    81 |         struct amdgpu_ring *ring;
>       |                             ^~~~
>
> ring is not used so remove it.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
> index 213b43670f23..023a1fffa6a9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
> @@ -78,12 +78,10 @@ static void vcn_v4_0_set_ras_funcs(struct amdgpu_device *adev);
>  static int vcn_v4_0_early_init(void *handle)
>  {
>         struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> -       struct amdgpu_ring *ring;
>
>         if (amdgpu_sriov_vf(adev)) {
>                 adev->vcn.harvest_config = VCN_HARVEST_MMSCH;
>                 for (int i = 0; i < adev->vcn.num_vcn_inst; ++i) {
> -                       ring = &adev->vcn.inst[i].ring_enc[0];
>                         if (amdgpu_vcn_is_disabled_vcn(adev, VCN_ENCODE_RING, i)) {
>                                 adev->vcn.harvest_config |= 1 << i;
>                                 dev_info(adev->dev, "VCN%d is disabled by hypervisor\n", i);
> --
> 2.27.0
>

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

end of thread, other threads:[~2023-02-24 22:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-24 16:45 [PATCH] drm/amdgpu: remove unused variable ring Tom Rix
2023-02-24 22:22 ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®