Skip to content

Commit 6ecccc0

Browse files
S-Bhavinalexdeucher
authored andcommitted
drm/amd/pm: remove redundant tools_size check
The check for tools_size being non-zero is redundant as tools_size is explicitly set to a non-zero value (0x19000). Removing the if condition simplifies the code without altering functionality. Signed-off-by: Bhavin Sharma <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 2abf2f7 commit 6ecccc0

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -257,20 +257,18 @@ static int vega12_smu_init(struct pp_hwmgr *hwmgr)
257257
priv->smu_tables.entry[TABLE_WATERMARKS].size = sizeof(Watermarks_t);
258258

259259
tools_size = 0x19000;
260-
if (tools_size) {
261-
ret = amdgpu_bo_create_kernel((struct amdgpu_device *)hwmgr->adev,
262-
tools_size,
263-
PAGE_SIZE,
264-
AMDGPU_GEM_DOMAIN_VRAM,
265-
&priv->smu_tables.entry[TABLE_PMSTATUSLOG].handle,
266-
&priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr,
267-
&priv->smu_tables.entry[TABLE_PMSTATUSLOG].table);
268-
if (ret)
269-
goto err1;
260+
ret = amdgpu_bo_create_kernel((struct amdgpu_device *)hwmgr->adev,
261+
tools_size,
262+
PAGE_SIZE,
263+
AMDGPU_GEM_DOMAIN_VRAM,
264+
&priv->smu_tables.entry[TABLE_PMSTATUSLOG].handle,
265+
&priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr,
266+
&priv->smu_tables.entry[TABLE_PMSTATUSLOG].table);
267+
if (ret)
268+
goto err1;
270269

271-
priv->smu_tables.entry[TABLE_PMSTATUSLOG].version = 0x01;
272-
priv->smu_tables.entry[TABLE_PMSTATUSLOG].size = tools_size;
273-
}
270+
priv->smu_tables.entry[TABLE_PMSTATUSLOG].version = 0x01;
271+
priv->smu_tables.entry[TABLE_PMSTATUSLOG].size = tools_size;
274272

275273
/* allocate space for AVFS Fuse table */
276274
ret = amdgpu_bo_create_kernel((struct amdgpu_device *)hwmgr->adev,

0 commit comments

Comments
 (0)