Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp153460pxj; Thu, 20 May 2021 06:34:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyeP4O0NRKEKPRWGhBO6zLtAOwtBFAMJojj5OdfD/oGOyMqaSduz1gNypn5NozNauiO4CN X-Received: by 2002:a92:340a:: with SMTP id b10mr5263991ila.301.1621517689184; Thu, 20 May 2021 06:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621517689; cv=none; d=google.com; s=arc-20160816; b=nrweBhbjRsT6hYp/UAn82kmYRxmD9BrjdI0pDWqi6NeALpv82nA/a7OUN0NiiNvNxw KdnnImMSWen4I4dDL5V1EWZZxdxyP00ZCYEL6OX6YYTbXwaU0RhySjrQmeDaB6q40gw/ zu3+fiFVHQ34yy8oVWbJ5bPXcwEjNqemP9c8+goiSbNqF2ztiTcvHEfcaan7Wai86cJl Iadd88bT8RFIDP/vcYgzgB1OGkpmGxq+063jcICStgjQEhrxXOUZ7eL06rqpPM9BgU5p F0Z8m2Lv1eirHktbcnC4cTmMB5kYCPC3Fdp7ZI2hOUVpmcMqZH5Ywf/0y1zWYo/XswFM WM+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=1U9UlWFx925iZj0kgV2UHm358nQMZolIdONWYi7ELcE=; b=03DL06ikl9Tsk4Colgo+B9zMAcmxM4rm6MPDu86Ayoj2mznH2W5P2J38SicbuetVvX 2U0RLZjUKgE/WeNJYA55mOdg6mI2f9sBFQXEnr1JucPiqHnL+Pw7tB0B0VjM6V7/n0zE i3ksu6Oun1AfX0b0HQC1Pw+5Y8Wjg/BIMH7Gh7GBPVBE4i66Y3ZTDO6nCvK+0w1I8tIi 1Rlf2FZLwmi1qSC0cAOBmJcM/Z+wXYaBau0Jy9etDl8chKEO8fPkE67sqIBjEHZUQOie 0NTj2Jp1sqzsunyron4wwienuVPnX11m8XgsVtbY6G8sVVrq4ovOR0GwRfK9SZD6wz8O IfOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r18si2469130ilm.131.2021.05.20.06.34.35; Thu, 20 May 2021 06:34:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239530AbhETNem (ORCPT + 99 others); Thu, 20 May 2021 09:34:42 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:3630 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238616AbhETNeK (ORCPT ); Thu, 20 May 2021 09:34:10 -0400 Received: from dggems703-chm.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4Fm9bV6TjxzmXVT; Thu, 20 May 2021 21:30:30 +0800 (CST) Received: from dggeml759-chm.china.huawei.com (10.1.199.138) by dggems703-chm.china.huawei.com (10.3.19.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Thu, 20 May 2021 21:32:46 +0800 Received: from localhost.localdomain (10.175.102.38) by dggeml759-chm.china.huawei.com (10.1.199.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 20 May 2021 21:32:46 +0800 From: Wei Yongjun To: , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Leo Liu , James Zhu , Deepak R Varma , Colin Ian King CC: , , , , Hulk Robot Subject: [PATCH -next] drm/amdgpu: fix unused-but-set-variable warnings Date: Thu, 20 May 2021 13:41:59 +0000 Message-ID: <20210520134159.1665467-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Originating-IP: [10.175.102.38] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggeml759-chm.china.huawei.com (10.1.199.138) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Wei Yongjun --- 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 &&