* [PATCH 0/7] various '-Wunused-but-set-variable' gcc warning fixes
@ 2019-11-13 12:44 yu kuai
2019-11-13 12:44 ` [PATCH 1/7] drm/amdgpu: remove set but not used variable 'mc_shared_chmap' from 'gfx_v6_0.c' and 'gfx_v7_0.c' yu kuai
` (7 more replies)
0 siblings, 8 replies; 11+ messages in thread
From: yu kuai @ 2019-11-13 12:44 UTC (permalink / raw)
To: alexander.deucher, Felix.Kuehling, christian.koenig, David1.Zhou,
airlied, daniel, Rex.Zhu, evan.quan
Cc: linux-kernel, dri-devel, amd-gfx, yukuai3, zhengbin13, yi.zhang
This patch set fixes various unrelated gcc '-Wunused-but-set-variable'
warnings.
yu kuai (7):
drm/amdgpu: remove set but not used variable 'mc_shared_chmap' from
'gfx_v6_0.c' and 'gfx_v7_0.c'
drm/amdgpu: remove set but not used variable 'amdgpu_connector'
drm/amdgpu: remove set but not used variable 'count'
drm/amdgpu: remove set but not used variable 'invalid'
drm/amdgpu: remove set but not used variable 'threshold'
drm/amdgpu: remove set but not used variable 'state'
drm/amdgpu: remove set but not used variable 'us_mvdd'
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++--
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 --
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 3 +--
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 3 +--
drivers/gpu/drm/amd/amdkfd/kfd_device.c | 4 ++--
drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 7 ++-----
drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 12 ------------
7 files changed, 8 insertions(+), 27 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/7] drm/amdgpu: remove set but not used variable 'mc_shared_chmap' from 'gfx_v6_0.c' and 'gfx_v7_0.c'
2019-11-13 12:44 [PATCH 0/7] various '-Wunused-but-set-variable' gcc warning fixes yu kuai
@ 2019-11-13 12:44 ` yu kuai
2019-11-13 16:55 ` Joe Perches
2019-11-13 12:44 ` [PATCH 2/7] drm/amdgpu: remove set but not used variable 'amdgpu_connector' yu kuai
` (6 subsequent siblings)
7 siblings, 1 reply; 11+ messages in thread
From: yu kuai @ 2019-11-13 12:44 UTC (permalink / raw)
To: alexander.deucher, Felix.Kuehling, christian.koenig, David1.Zhou,
airlied, daniel, Rex.Zhu, evan.quan
Cc: linux-kernel, dri-devel, amd-gfx, yukuai3, zhengbin13, yi.zhang
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c: In function
‘gfx_v6_0_constants_init’:
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c:1579:6: warning: variable
‘mc_shared_chmap’ set but not used [-Wunused-but-set-variable]
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c: In function
‘gfx_v7_0_gpu_early_init’:
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c:4262:6: warning: variable
‘mc_shared_chmap’ set but not used [-Wunused-but-set-variable]
Fixes: 2cd46ad22383 ("drm/amdgpu: add graphic pipeline implementation for si v8")
Fixes: d93f3ca706b8 ("drm/amdgpu/gfx7: rework gpu_init()")
Signed-off-by: yu kuai <yukuai3@huawei.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 3 +--
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
index e83b6e0..95bb242 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
@@ -1576,7 +1576,7 @@ static void gfx_v6_0_config_init(struct amdgpu_device *adev)
static void gfx_v6_0_constants_init(struct amdgpu_device *adev)
{
u32 gb_addr_config = 0;
- u32 mc_shared_chmap, mc_arb_ramcfg;
+ u32 mc_arb_ramcfg;
u32 sx_debug_1;
u32 hdp_host_path_cntl;
u32 tmp;
@@ -1678,7 +1678,6 @@ static void gfx_v6_0_constants_init(struct amdgpu_device *adev)
WREG32(mmBIF_FB_EN, BIF_FB_EN__FB_READ_EN_MASK | BIF_FB_EN__FB_WRITE_EN_MASK);
- mc_shared_chmap = RREG32(mmMC_SHARED_CHMAP);
adev->gfx.config.mc_arb_ramcfg = RREG32(mmMC_ARB_RAMCFG);
mc_arb_ramcfg = adev->gfx.config.mc_arb_ramcfg;
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
index 6b1c5ef..43ae8fc 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
@@ -4259,7 +4259,7 @@ static int gfx_v7_0_late_init(void *handle)
static void gfx_v7_0_gpu_early_init(struct amdgpu_device *adev)
{
u32 gb_addr_config;
- u32 mc_shared_chmap, mc_arb_ramcfg;
+ u32 mc_arb_ramcfg;
u32 dimm00_addr_map, dimm01_addr_map, dimm10_addr_map, dimm11_addr_map;
u32 tmp;
@@ -4336,7 +4336,6 @@ static void gfx_v7_0_gpu_early_init(struct amdgpu_device *adev)
break;
}
- mc_shared_chmap = RREG32(mmMC_SHARED_CHMAP);
adev->gfx.config.mc_arb_ramcfg = RREG32(mmMC_ARB_RAMCFG);
mc_arb_ramcfg = adev->gfx.config.mc_arb_ramcfg;
--
2.7.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/7] drm/amdgpu: remove set but not used variable 'amdgpu_connector'
2019-11-13 12:44 [PATCH 0/7] various '-Wunused-but-set-variable' gcc warning fixes yu kuai
2019-11-13 12:44 ` [PATCH 1/7] drm/amdgpu: remove set but not used variable 'mc_shared_chmap' from 'gfx_v6_0.c' and 'gfx_v7_0.c' yu kuai
@ 2019-11-13 12:44 ` yu kuai
2019-11-13 12:44 ` [PATCH 3/7] drm/amdgpu: remove set but not used variable 'count' yu kuai
` (5 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: yu kuai @ 2019-11-13 12:44 UTC (permalink / raw)
To: alexander.deucher, Felix.Kuehling, christian.koenig, David1.Zhou,
airlied, daniel, Rex.Zhu, evan.quan
Cc: linux-kernel, dri-devel, amd-gfx, yukuai3, zhengbin13, yi.zhang
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c: In function
‘amdgpu_display_crtc_scaling_mode_fixup’:
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c:693:27: warning: variable
‘amdgpu_connector’ set but not used [-Wunused-but-set-variable]
Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)")
Signed-off-by: yu kuai <yukuai3@huawei.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index d2dd59a..6a27027 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -690,7 +690,6 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
struct amdgpu_encoder *amdgpu_encoder;
struct drm_connector *connector;
- struct amdgpu_connector *amdgpu_connector;
u32 src_v = 1, dst_v = 1;
u32 src_h = 1, dst_h = 1;
@@ -702,7 +701,6 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
continue;
amdgpu_encoder = to_amdgpu_encoder(encoder);
connector = amdgpu_get_connector_for_encoder(encoder);
- amdgpu_connector = to_amdgpu_connector(connector);
/* set scaling */
if (amdgpu_encoder->rmx_type == RMX_OFF)
--
2.7.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/7] drm/amdgpu: remove set but not used variable 'count'
2019-11-13 12:44 [PATCH 0/7] various '-Wunused-but-set-variable' gcc warning fixes yu kuai
2019-11-13 12:44 ` [PATCH 1/7] drm/amdgpu: remove set but not used variable 'mc_shared_chmap' from 'gfx_v6_0.c' and 'gfx_v7_0.c' yu kuai
2019-11-13 12:44 ` [PATCH 2/7] drm/amdgpu: remove set but not used variable 'amdgpu_connector' yu kuai
@ 2019-11-13 12:44 ` yu kuai
2019-11-13 12:44 ` [PATCH 4/7] drm/amdgpu: remove set but not used variable 'invalid' yu kuai
` (4 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: yu kuai @ 2019-11-13 12:44 UTC (permalink / raw)
To: alexander.deucher, Felix.Kuehling, christian.koenig, David1.Zhou,
airlied, daniel, Rex.Zhu, evan.quan
Cc: linux-kernel, dri-devel, amd-gfx, yukuai3, zhengbin13, yi.zhang
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/gpu/drm/amd/amdkfd/kfd_device.c: In function
‘kgd2kfd_post_reset’:
drivers/gpu/drm/amd/amdkfd/kfd_device.c:745:11: warning:
variable ‘count’ set but not used [-Wunused-but-set-variable]
'count' is never used, so can be removed. Thus 'atomic_dec_return'
can be replaced as 'atomic_dec'
Fixes: e42051d2133b ("drm/amdkfd: Implement GPU reset handlers in KFD")
Signed-off-by: yu kuai <yukuai3@huawei.com>
---
drivers/gpu/drm/amd/amdkfd/kfd_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 4fa8834..209bfc8 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -742,7 +742,7 @@ int kgd2kfd_pre_reset(struct kfd_dev *kfd)
int kgd2kfd_post_reset(struct kfd_dev *kfd)
{
- int ret, count;
+ int ret;
if (!kfd->init_complete)
return 0;
@@ -750,7 +750,7 @@ int kgd2kfd_post_reset(struct kfd_dev *kfd)
ret = kfd_resume(kfd);
if (ret)
return ret;
- count = atomic_dec_return(&kfd_locked);
+ atomic_dec(&kfd_locked);
atomic_set(&kfd->sram_ecc_flag, 0);
--
2.7.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/7] drm/amdgpu: remove set but not used variable 'invalid'
2019-11-13 12:44 [PATCH 0/7] various '-Wunused-but-set-variable' gcc warning fixes yu kuai
` (2 preceding siblings ...)
2019-11-13 12:44 ` [PATCH 3/7] drm/amdgpu: remove set but not used variable 'count' yu kuai
@ 2019-11-13 12:44 ` yu kuai
2019-11-13 12:44 ` [PATCH 5/7] drm/amd/powerplay: remove set but not used variable 'threshold' yu kuai
` (3 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: yu kuai @ 2019-11-13 12:44 UTC (permalink / raw)
To: alexander.deucher, Felix.Kuehling, christian.koenig, David1.Zhou,
airlied, daniel, Rex.Zhu, evan.quan
Cc: linux-kernel, dri-devel, amd-gfx, yukuai3, zhengbin13, yi.zhang
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c: In function
‘amdgpu_amdkfd_evict_userptr’:
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c:1665:6: warning:
variable ‘invalid’ set but not used [-Wunused-but-set-variable]
'invalid' is never used, so can be removed. Thus 'atomic_inc_return'
can be replaced as 'atomic_inc'
Fixes: 5ae0283e831a ("drm/amdgpu: Add userptr support for KFD")
Signed-off-by: yu kuai <yukuai3@huawei.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index ae6f544..a1ed8a8e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -1662,10 +1662,10 @@ int amdgpu_amdkfd_evict_userptr(struct kgd_mem *mem,
struct mm_struct *mm)
{
struct amdkfd_process_info *process_info = mem->process_info;
- int invalid, evicted_bos;
+ int evicted_bos;
int r = 0;
- invalid = atomic_inc_return(&mem->invalid);
+ atomic_inc(&mem->invalid);
evicted_bos = atomic_inc_return(&process_info->evicted_bos);
if (evicted_bos == 1) {
/* First eviction, stop the queues */
--
2.7.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 5/7] drm/amd/powerplay: remove set but not used variable 'threshold'
2019-11-13 12:44 [PATCH 0/7] various '-Wunused-but-set-variable' gcc warning fixes yu kuai
` (3 preceding siblings ...)
2019-11-13 12:44 ` [PATCH 4/7] drm/amdgpu: remove set but not used variable 'invalid' yu kuai
@ 2019-11-13 12:44 ` yu kuai
2019-11-13 12:44 ` [PATCH 6/7] drm/amd/powerplay: remove set but not used variable 'state' yu kuai
` (2 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: yu kuai @ 2019-11-13 12:44 UTC (permalink / raw)
To: alexander.deucher, Felix.Kuehling, christian.koenig, David1.Zhou,
airlied, daniel, Rex.Zhu, evan.quan
Cc: linux-kernel, dri-devel, amd-gfx, yukuai3, zhengbin13, yi.zhang
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c: In
function ‘fiji_populate_single_graphic_level’:
drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c:943:11:
warning: variable ‘threshold’ set but not used
[-Wunused-but-set-variable]
It is never used, so can be removed.
Fixes: 2e112b4ae3ba ("drm/amd/pp: remove fiji_smc/smumgr split.")
Signed-off-by: yu kuai <yukuai3@huawei.com>
---
drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
index da025b1..c3df3a3 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
@@ -940,7 +940,7 @@ static int fiji_populate_single_graphic_level(struct pp_hwmgr *hwmgr,
{
int result;
/* PP_Clocks minClocks; */
- uint32_t threshold, mvdd;
+ uint32_t mvdd;
struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
struct phm_ppt_v1_information *table_info =
(struct phm_ppt_v1_information *)(hwmgr->pptable);
@@ -973,8 +973,6 @@ static int fiji_populate_single_graphic_level(struct pp_hwmgr *hwmgr,
level->VoltageDownHyst = 0;
level->PowerThrottle = 0;
- threshold = clock * data->fast_watermark_threshold / 100;
-
data->display_timing.min_clock_in_sr = hwmgr->display_config->min_core_set_clock_in_sr;
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_SclkDeepSleep))
--
2.7.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 6/7] drm/amd/powerplay: remove set but not used variable 'state'
2019-11-13 12:44 [PATCH 0/7] various '-Wunused-but-set-variable' gcc warning fixes yu kuai
` (4 preceding siblings ...)
2019-11-13 12:44 ` [PATCH 5/7] drm/amd/powerplay: remove set but not used variable 'threshold' yu kuai
@ 2019-11-13 12:44 ` yu kuai
2019-11-13 12:44 ` [PATCH 7/7] drm/amd/powerplay: remove set but not used variable 'us_mvdd' yu kuai
2019-11-13 15:24 ` [PATCH 0/7] various '-Wunused-but-set-variable' gcc warning fixes Alex Deucher
7 siblings, 0 replies; 11+ messages in thread
From: yu kuai @ 2019-11-13 12:44 UTC (permalink / raw)
To: alexander.deucher, Felix.Kuehling, christian.koenig, David1.Zhou,
airlied, daniel, Rex.Zhu, evan.quan
Cc: linux-kernel, dri-devel, amd-gfx, yukuai3, zhengbin13, yi.zhang
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c: In
function ‘fiji_populate_memory_timing_parameters’:
drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c:1504:8:
warning: variable ‘state’ set but not used [-Wunused-but-set-variable]
It is never used, so can be removed.
Fixes: 2e112b4ae3ba ("drm/amd/pp: remove fiji_smc/smumgr split.")
Signed-off-by: yu kuai <yukuai3@huawei.com>
---
drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
index c3df3a3..32ebb38 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
@@ -1499,7 +1499,7 @@ static int fiji_populate_memory_timing_parameters(struct pp_hwmgr *hwmgr,
uint32_t dram_timing;
uint32_t dram_timing2;
uint32_t burstTime;
- ULONG state, trrds, trrdl;
+ ULONG trrds, trrdl;
int result;
result = atomctrl_set_engine_dram_timings_rv770(hwmgr,
@@ -1511,7 +1511,6 @@ static int fiji_populate_memory_timing_parameters(struct pp_hwmgr *hwmgr,
dram_timing2 = cgs_read_register(hwmgr->device, mmMC_ARB_DRAM_TIMING2);
burstTime = cgs_read_register(hwmgr->device, mmMC_ARB_BURST_TIME);
- state = PHM_GET_FIELD(burstTime, MC_ARB_BURST_TIME, STATE0);
trrds = PHM_GET_FIELD(burstTime, MC_ARB_BURST_TIME, TRRDS0);
trrdl = PHM_GET_FIELD(burstTime, MC_ARB_BURST_TIME, TRRDL0);
--
2.7.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 7/7] drm/amd/powerplay: remove set but not used variable 'us_mvdd'
2019-11-13 12:44 [PATCH 0/7] various '-Wunused-but-set-variable' gcc warning fixes yu kuai
` (5 preceding siblings ...)
2019-11-13 12:44 ` [PATCH 6/7] drm/amd/powerplay: remove set but not used variable 'state' yu kuai
@ 2019-11-13 12:44 ` yu kuai
2019-11-13 15:24 ` [PATCH 0/7] various '-Wunused-but-set-variable' gcc warning fixes Alex Deucher
7 siblings, 0 replies; 11+ messages in thread
From: yu kuai @ 2019-11-13 12:44 UTC (permalink / raw)
To: alexander.deucher, Felix.Kuehling, christian.koenig, David1.Zhou,
airlied, daniel, Rex.Zhu, evan.quan
Cc: linux-kernel, dri-devel, amd-gfx, yukuai3, zhengbin13, yi.zhang
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c: In
function ‘vegam_populate_smc_acpi_level’:
drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c:1117:11:
warning: variable 'us_mvdd' set but not used [-Wunused-but-set-variable]
It is never used, so can be removed.
Fixes: ac7822b0026f ("drm/amd/powerplay: add smumgr support for VEGAM (v2)")
Signed-off-by: yu kuai <yukuai3@huawei.com>
---
drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c
index ae18fbc..2068eb0 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c
@@ -1114,7 +1114,6 @@ static int vegam_populate_smc_acpi_level(struct pp_hwmgr *hwmgr,
(struct phm_ppt_v1_information *)(hwmgr->pptable);
SMIO_Pattern vol_level;
uint32_t mvdd;
- uint16_t us_mvdd;
table->ACPILevel.Flags &= ~PPSMC_SWSTATE_FLAG_DC;
@@ -1168,17 +1167,6 @@ static int vegam_populate_smc_acpi_level(struct pp_hwmgr *hwmgr,
"in Clock Dependency Table",
);
- us_mvdd = 0;
- if ((SMU7_VOLTAGE_CONTROL_NONE == data->mvdd_control) ||
- (data->mclk_dpm_key_disabled))
- us_mvdd = data->vbios_boot_state.mvdd_bootup_value;
- else {
- if (!vegam_populate_mvdd_value(hwmgr,
- data->dpm_table.mclk_table.dpm_levels[0].value,
- &vol_level))
- us_mvdd = vol_level.Voltage;
- }
-
if (!vegam_populate_mvdd_value(hwmgr, 0, &vol_level))
table->MemoryACPILevel.MinMvdd = PP_HOST_TO_SMC_UL(vol_level.Voltage);
else
--
2.7.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/7] various '-Wunused-but-set-variable' gcc warning fixes
2019-11-13 12:44 [PATCH 0/7] various '-Wunused-but-set-variable' gcc warning fixes yu kuai
` (6 preceding siblings ...)
2019-11-13 12:44 ` [PATCH 7/7] drm/amd/powerplay: remove set but not used variable 'us_mvdd' yu kuai
@ 2019-11-13 15:24 ` Alex Deucher
7 siblings, 0 replies; 11+ messages in thread
From: Alex Deucher @ 2019-11-13 15:24 UTC (permalink / raw)
To: yu kuai
Cc: Deucher, Alexander, Kuehling, Felix, Christian Koenig,
Chunming Zhou, Dave Airlie, Daniel Vetter, Rex Zhu, Quan, Evan,
yi.zhang, LKML, amd-gfx list, zhengbin,
Maling list - DRI developers
Applied the series, although a couple of the patches were already
applied from a previous patch set.
Thanks,
Alex
On Wed, Nov 13, 2019 at 9:12 AM yu kuai <yukuai3@huawei.com> wrote:
>
> This patch set fixes various unrelated gcc '-Wunused-but-set-variable'
> warnings.
>
> yu kuai (7):
> drm/amdgpu: remove set but not used variable 'mc_shared_chmap' from
> 'gfx_v6_0.c' and 'gfx_v7_0.c'
> drm/amdgpu: remove set but not used variable 'amdgpu_connector'
> drm/amdgpu: remove set but not used variable 'count'
> drm/amdgpu: remove set but not used variable 'invalid'
> drm/amdgpu: remove set but not used variable 'threshold'
> drm/amdgpu: remove set but not used variable 'state'
> drm/amdgpu: remove set but not used variable 'us_mvdd'
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++--
> drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 --
> drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 3 +--
> drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 3 +--
> drivers/gpu/drm/amd/amdkfd/kfd_device.c | 4 ++--
> drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 7 ++-----
> drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 12 ------------
> 7 files changed, 8 insertions(+), 27 deletions(-)
>
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/7] drm/amdgpu: remove set but not used variable 'mc_shared_chmap' from 'gfx_v6_0.c' and 'gfx_v7_0.c'
2019-11-13 12:44 ` [PATCH 1/7] drm/amdgpu: remove set but not used variable 'mc_shared_chmap' from 'gfx_v6_0.c' and 'gfx_v7_0.c' yu kuai
@ 2019-11-13 16:55 ` Joe Perches
2019-11-13 19:22 ` Alex Deucher
0 siblings, 1 reply; 11+ messages in thread
From: Joe Perches @ 2019-11-13 16:55 UTC (permalink / raw)
To: yu kuai, alexander.deucher, Felix.Kuehling, christian.koenig,
David1.Zhou, airlied, daniel, Rex.Zhu, evan.quan
Cc: linux-kernel, dri-devel, amd-gfx, zhengbin13, yi.zhang
On Wed, 2019-11-13 at 20:44 +0800, yu kuai wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c: In function
> ‘gfx_v6_0_constants_init’:
> drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c:1579:6: warning: variable
> ‘mc_shared_chmap’ set but not used [-Wunused-but-set-variable]
[]
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
[]
> @@ -1678,7 +1678,6 @@ static void gfx_v6_0_constants_init(struct amdgpu_device *adev)
>
> WREG32(mmBIF_FB_EN, BIF_FB_EN__FB_READ_EN_MASK | BIF_FB_EN__FB_WRITE_EN_MASK);
>
> - mc_shared_chmap = RREG32(mmMC_SHARED_CHMAP);
I do not know the hardware but frequently hardware like
this has read ordering requirements and various registers
can not be read in a random order.
Does removing this read have no effect on the hardware?
> adev->gfx.config.mc_arb_ramcfg = RREG32(mmMC_ARB_RAMCFG);
> mc_arb_ramcfg = adev->gfx.config.mc_arb_ramcfg;
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
[]
> @@ -4336,7 +4336,6 @@ static void gfx_v7_0_gpu_early_init(struct amdgpu_device *adev)
> break;
> }
>
> - mc_shared_chmap = RREG32(mmMC_SHARED_CHMAP);
> adev->gfx.config.mc_arb_ramcfg = RREG32(mmMC_ARB_RAMCFG);
> mc_arb_ramcfg = adev->gfx.config.mc_arb_ramcfg;
Same question.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/7] drm/amdgpu: remove set but not used variable 'mc_shared_chmap' from 'gfx_v6_0.c' and 'gfx_v7_0.c'
2019-11-13 16:55 ` Joe Perches
@ 2019-11-13 19:22 ` Alex Deucher
0 siblings, 0 replies; 11+ messages in thread
From: Alex Deucher @ 2019-11-13 19:22 UTC (permalink / raw)
To: Joe Perches
Cc: yu kuai, Deucher, Alexander, Kuehling, Felix, Christian Koenig,
Chunming Zhou, Dave Airlie, Daniel Vetter, Rex Zhu, Quan, Evan,
zhengbin, amd-gfx list, LKML, Maling list - DRI developers,
yi.zhang
On Wed, Nov 13, 2019 at 11:56 AM Joe Perches <joe@perches.com> wrote:
>
> On Wed, 2019-11-13 at 20:44 +0800, yu kuai wrote:
> > Fixes gcc '-Wunused-but-set-variable' warning:
> >
> > drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c: In function
> > ‘gfx_v6_0_constants_init’:
> > drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c:1579:6: warning: variable
> > ‘mc_shared_chmap’ set but not used [-Wunused-but-set-variable]
> []
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
> []
> > @@ -1678,7 +1678,6 @@ static void gfx_v6_0_constants_init(struct amdgpu_device *adev)
> >
> > WREG32(mmBIF_FB_EN, BIF_FB_EN__FB_READ_EN_MASK | BIF_FB_EN__FB_WRITE_EN_MASK);
> >
> > - mc_shared_chmap = RREG32(mmMC_SHARED_CHMAP);
>
> I do not know the hardware but frequently hardware like
> this has read ordering requirements and various registers
> can not be read in a random order.
>
> Does removing this read have no effect on the hardware?
There is no dependency. It's safe. Same thing below.
Alex
>
> > adev->gfx.config.mc_arb_ramcfg = RREG32(mmMC_ARB_RAMCFG);
> > mc_arb_ramcfg = adev->gfx.config.mc_arb_ramcfg;
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> []
> > @@ -4336,7 +4336,6 @@ static void gfx_v7_0_gpu_early_init(struct amdgpu_device *adev)
> > break;
> > }
> >
> > - mc_shared_chmap = RREG32(mmMC_SHARED_CHMAP);
> > adev->gfx.config.mc_arb_ramcfg = RREG32(mmMC_ARB_RAMCFG);
> > mc_arb_ramcfg = adev->gfx.config.mc_arb_ramcfg;
>
> Same question.
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2019-11-13 19:22 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13 12:44 [PATCH 0/7] various '-Wunused-but-set-variable' gcc warning fixes yu kuai
2019-11-13 12:44 ` [PATCH 1/7] drm/amdgpu: remove set but not used variable 'mc_shared_chmap' from 'gfx_v6_0.c' and 'gfx_v7_0.c' yu kuai
2019-11-13 16:55 ` Joe Perches
2019-11-13 19:22 ` Alex Deucher
2019-11-13 12:44 ` [PATCH 2/7] drm/amdgpu: remove set but not used variable 'amdgpu_connector' yu kuai
2019-11-13 12:44 ` [PATCH 3/7] drm/amdgpu: remove set but not used variable 'count' yu kuai
2019-11-13 12:44 ` [PATCH 4/7] drm/amdgpu: remove set but not used variable 'invalid' yu kuai
2019-11-13 12:44 ` [PATCH 5/7] drm/amd/powerplay: remove set but not used variable 'threshold' yu kuai
2019-11-13 12:44 ` [PATCH 6/7] drm/amd/powerplay: remove set but not used variable 'state' yu kuai
2019-11-13 12:44 ` [PATCH 7/7] drm/amd/powerplay: remove set but not used variable 'us_mvdd' yu kuai
2019-11-13 15:24 ` [PATCH 0/7] various '-Wunused-but-set-variable' gcc warning fixes 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 NNTP newsgroup(s).