drm/amd/powerplay: Remove unneeded variable 'ret' in amdgpu_smu.c
authorzhengbin <zhengbin13@huawei.com>
Wed, 27 Nov 2019 09:33:42 +0000 (17:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 2 Dec 2019 22:55:08 +0000 (17:55 -0500)
Fixes coccicheck warning:

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c:1192:5-8: Unneeded variable: "ret". Return "0" on line 1195
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c:1945:5-8: Unneeded variable: "ret". Return "0" on line 1961

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

index 36001a4..98691d4 100644 (file)
@@ -1189,10 +1189,9 @@ static int smu_free_memory_pool(struct smu_context *smu)
 {
        struct smu_table_context *smu_table = &smu->smu_table;
        struct smu_table *memory_pool = &smu_table->memory_pool;
-       int ret = 0;
 
        if (memory_pool->size == SMU_MEMORY_POOL_SIZE_ZERO)
-               return ret;
+               return 0;
 
        amdgpu_bo_free_kernel(&memory_pool->bo,
                              &memory_pool->mc_address,
@@ -1200,7 +1199,7 @@ static int smu_free_memory_pool(struct smu_context *smu)
 
        memset(memory_pool, 0, sizeof(struct smu_table));
 
-       return ret;
+       return 0;
 }
 
 static int smu_start_smc_engine(struct smu_context *smu)
@@ -1942,7 +1941,6 @@ int smu_write_watermarks_table(struct smu_context *smu)
 int smu_set_watermarks_for_clock_ranges(struct smu_context *smu,
                struct dm_pp_wm_sets_with_clock_ranges_soc15 *clock_ranges)
 {
-       int ret = 0;
        struct smu_table *watermarks = &smu->smu_table.tables[SMU_TABLE_WATERMARKS];
        void *table = watermarks->cpu_addr;
 
@@ -1958,7 +1956,7 @@ int smu_set_watermarks_for_clock_ranges(struct smu_context *smu,
 
        mutex_unlock(&smu->mutex);
 
-       return ret;
+       return 0;
 }
 
 const struct amd_ip_funcs smu_ip_funcs = {