lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240822071056.1342551-1-11162571@vivo.com>
Date: Thu, 22 Aug 2024 15:10:55 +0800
From: Yang Ruibin <11162571@...o.com>
To: Kenneth Feng <kenneth.feng@....com>,
	Alex Deucher <alexander.deucher@....com>,
	Christian König <christian.koenig@....com>,
	Xinhui Pan <Xinhui.Pan@....com>,
	David Airlie <airlied@...il.com>,
	Daniel Vetter <daniel@...ll.ch>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	Yang Ruibin <11162571@...o.com>,
	amd-gfx@...ts.freedesktop.org,
	dri-devel@...ts.freedesktop.org,
	linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com
Subject: [PATCH v1] drivers:smumgr:Variable names should be consistent with other modules

The variable highest_pcie_level_enabled is named 
hightest_pcie_level_enabled in other modules. 
Please ensure the consistency of variable naming
and use min macros instead of the triadic operator.

Signed-off-by: Yang Ruibin <11162571@...o.com>
---
 .../amd/pm/powerplay/smumgr/iceland_smumgr.c    | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c
index 17d2f5bff..165fbfa2e 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c
@@ -970,7 +970,7 @@ static int iceland_populate_all_graphic_levels(struct pp_hwmgr *hwmgr)
 	SMU71_Discrete_GraphicsLevel *levels = smu_data->smc_state_table.GraphicsLevel;
 
 	uint32_t i;
-	uint8_t highest_pcie_level_enabled = 0;
+	uint8_t hightest_pcie_level_enabled = 0;
 	uint8_t lowest_pcie_level_enabled = 0, mid_pcie_level_enabled = 0;
 	uint8_t count = 0;
 	int result = 0;
@@ -1003,8 +1003,8 @@ static int iceland_populate_all_graphic_levels(struct pp_hwmgr *hwmgr)
 		phm_get_dpm_level_enable_mask_value(&dpm_table->sclk_table);
 
 	while ((data->dpm_level_enable_mask.pcie_dpm_enable_mask &
-				(1 << (highest_pcie_level_enabled + 1))) != 0) {
-		highest_pcie_level_enabled++;
+				(1 << (hightest_pcie_level_enabled + 1))) != 0) {
+		hightest_pcie_level_enabled++;
 	}
 
 	while ((data->dpm_level_enable_mask.pcie_dpm_enable_mask &
@@ -1012,19 +1012,18 @@ static int iceland_populate_all_graphic_levels(struct pp_hwmgr *hwmgr)
 		lowest_pcie_level_enabled++;
 	}
 
-	while ((count < highest_pcie_level_enabled) &&
+	while ((count < hightest_pcie_level_enabled) &&
 			((data->dpm_level_enable_mask.pcie_dpm_enable_mask &
 				(1 << (lowest_pcie_level_enabled + 1 + count))) == 0)) {
 		count++;
 	}
 
-	mid_pcie_level_enabled = (lowest_pcie_level_enabled+1+count) < highest_pcie_level_enabled ?
-		(lowest_pcie_level_enabled+1+count) : highest_pcie_level_enabled;
+	mid_pcie_level_enabled = min(lowest_pcie_level_enabled + 1 + count,
+					hightest_pcie_level_enabled);
 
-
-	/* set pcieDpmLevel to highest_pcie_level_enabled*/
+	/* set pcieDpmLevel to hightest_pcie_level_enabled*/
 	for (i = 2; i < dpm_table->sclk_table.count; i++) {
-		smu_data->smc_state_table.GraphicsLevel[i].pcieDpmLevel = highest_pcie_level_enabled;
+		smu_data->smc_state_table.GraphicsLevel[i].pcieDpmLevel =
+					hightest_pcie_level_enabled;
 	}
 
 	/* set pcieDpmLevel to lowest_pcie_level_enabled*/
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ