Skip to contentSkip to conversation

drm/amdgpu: Drop unused variable and statement

PATCH Applied Austin Kim 2 participants 2 messages Oct 2, 2019

Subsystems (2)
lore
Share & tools
lore

Austin Kim

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Drop unused variable and statement

Even though 'smu8_smu' is declared, it is not used after below statement.

   smu8_smu = hwmgr->smu_backend;

So 'unused variable' could be safely removed
to stop warning message as below:

drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu8_smumgr.c:180:22:
warning: variable ‘smu8_smu’ set but not used [-Wunused-but-set-variable]

   struct smu8_smumgr *smu8_smu;
             ^
---
 drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c +0 -2
index 4728aa2..7dca04a 100644
@@ -177,12 +177,10 @@ static int smu8_load_mec_firmware(struct pp_hwmgr *hwmgr)
 	uint32_t tmp;
 	int ret = 0;
 	struct cgs_firmware_info info = {0};
-	struct smu8_smumgr *smu8_smu;
 
 	if (hwmgr == NULL || hwmgr->device == NULL)
 		return -EINVAL;
 
-	smu8_smu = hwmgr->smu_backend;
 	ret = cgs_get_firmware_info(hwmgr->device,
 						CGS_UCODE_ID_CP_MEC, &info);
 
Signature · 1 line
2.6.2
Applied
#1 lore raw
Quoted 8 lines · Austin Kim

Even though 'smu8_smu' is declared, it is not used after below statement.

   smu8_smu = hwmgr->smu_backend;

So 'unused variable' could be safely removed
to stop warning message as below:

Quoted 7 lines
   drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu8_smumgr.c:180:22:
   warning: variable ‘smu8_smu’ set but not used
   [-Wunused-but-set-variable]

   struct smu8_smumgr *smu8_smu;
             ^

Applied. Thanks!

Alex

Quoted 24 lines
---
 drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c +0 -3
index 4728aa2..7dca04a 100644
@@ -177,12 +177,10 @@ static int smu8_load_mec_firmware(struct pp_hwmgr *hwmgr)
        uint32_t tmp;
        int ret = 0;
        struct cgs_firmware_info info = {0};
-       struct smu8_smumgr *smu8_smu;
 
        if (hwmgr == NULL || hwmgr->device == NULL)
                return -EINVAL;
 
-       smu8_smu = hwmgr->smu_backend;
        ret = cgs_get_firmware_info(hwmgr->device,
                                                CGS_UCODE_ID_CP_MEC, &info);
 
--

2.6.2

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx