From patchwork Thu Aug 22 07:30:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Ruibin <11162571@vivo.com> X-Patchwork-Id: 13772898 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 225BCC531DF for ; Thu, 22 Aug 2024 07:49:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C5F6910E114; Thu, 22 Aug 2024 07:49:10 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=vivo.com header.i=@vivo.com header.b="fJfVRaU3"; dkim-atps=neutral Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2044.outbound.protection.outlook.com [40.107.215.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9CD0910E7CE; Thu, 22 Aug 2024 07:30:27 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MrBEqOa6t8GY3mzBUftD6zQrrxlPFuRbBVzjeeR2dJe/QagCNdLr2ZDuEfYj111QOAnZ9L4J6XOOXngfvrlZ4raq345uYS+8/KLUKtGVqby8LGhBKPVmk4hDGDD8KBBJ/bWVHHiQaJiV4aUVqo7RyHq79QDukUl/1ulXl01Q/mHyGUbFIIDP86HDsfG4RcYM2Lbmlc+bLCHIU8csCtO9hJ0N9LmA5zamzGUa25zNBpXH48MKlq8+C7Nozj+aByCT7pWD+R4s1yPEHfc+twLLT1vrsMtVB6LxgY+6LakGU2UKuAS+U0GwUrHQxD2GXC0XLkbIyRuBArAja16q2JixOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+6Bc6JgjaL1DliBAVYLTXWq/ys63GjfzrTK1N0acZDA=; b=EW7yrYh6uJc8hy9kcuHwUO4fDVF5Y6ubvAaZMvltRfN801GP4GPh2b9rgDaZZ6RqFN68yjeqg10E+CqJjib6V+wRvb1M4BdlKItoE7bLd5CZh86zKFRVN/S60mtYBjsUI6UGqkKv+zRyo/ZnOsEsfr6Pn9BnVrRH/xjYsSTLl/vhKTTcAKWC7IXhHsDdkSZ4hmqHscSIXSQXVIEuEarla1oRVTaEB35HHNlWxja293lqRA+UvnCG8Wk7dZ6No9Z4I3hp15QwrkSsc0LPhvqeSjCflu0/ngXWwYL6eDSQKaIH8wS/U2YWnrn9pLtiYSSuhmYYDfVoSa0ne6TxrL/W0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+6Bc6JgjaL1DliBAVYLTXWq/ys63GjfzrTK1N0acZDA=; b=fJfVRaU3nVBLDOEYUF7zp/UlV+6rtJ1xSo7wbOEa2nKY8hk1eDF1cmIE7E/u4kHqtSROxw8KQ3FlMsJ2AV3+n/2FBXhfl1QvlZN8axbd8nTDW0TVgIwIJlS8RRLpXgoOPAERtzceRyY0sxrT45yFeR9b8gQdbmGDm6egFKy0OamSb/Z99NgnXFMOr65NLWs96/i/b5qDtsQ5RZmOiSmJkH8zD5Q5q+izGptpmDiXoUCGIGd44xXJMdgJ8069Yu23JgjFkmVb0LYRWlBTDyDenVHj2vuWPPSSsibfgUKPSp/3f47I7Lr5+Rfi4ImmHFqWm32/Z3EndslYUS/DG07VRw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB6263.apcprd06.prod.outlook.com (2603:1096:400:33d::14) by KL1PR06MB6964.apcprd06.prod.outlook.com (2603:1096:820:121::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Thu, 22 Aug 2024 07:30:21 +0000 Received: from TYZPR06MB6263.apcprd06.prod.outlook.com ([fe80::bd8:d8ed:8dd5:3268]) by TYZPR06MB6263.apcprd06.prod.outlook.com ([fe80::bd8:d8ed:8dd5:3268%6]) with mapi id 15.20.7875.019; Thu, 22 Aug 2024 07:30:21 +0000 From: Yang Ruibin <11162571@vivo.com> To: Kenneth Feng , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , Xinhui Pan , David Airlie , Daniel Vetter , Stephen Rothwell , Yang Ruibin <11162571@vivo.com>, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com Subject: [PATCH v1] drivers:smumgr:Variable names should be consistent Date: Thu, 22 Aug 2024 15:30:10 +0800 Message-Id: <20240822073011.1352849-1-11162571@vivo.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SI2PR04CA0017.apcprd04.prod.outlook.com (2603:1096:4:197::15) To TYZPR06MB6263.apcprd06.prod.outlook.com (2603:1096:400:33d::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB6263:EE_|KL1PR06MB6964:EE_ X-MS-Office365-Filtering-Correlation-Id: b78c7bcd-f5e6-47e1-7644-08dcc27c47cc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040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v51arDj01EeUbnMi9y7B7a+f+tUIAzQBJOLwqt594LXSaN/H3vTYkXrnPb37SxuVlmUAh8Bc49YX1hH7vGKTBDm4jnE1NDaMVsnbA4foZA9A1mgs8kylps3V/KFaqBqII+MfqxvAAHjiLVF+9/Qp5u2fV5vs8Wna1WGatFxBMBGVLNeuqzmBIZhkVJ3HMdo7GGtleMebyDZgdvZcoDsOxF/wpPtAivnKHzabwaxZFOMRMQjMqiXT7arb1owZO9IAv7QoWy+zOTyMSOqvEiHq6lnoTVOdCrXxj5BJ2ZWSKGl4ldsnUepytq2/tUfzXvzQgow9zqlj9JJ2mMgBq7C3VUdBUNAl1odQAiVvCRa1k9kdf9pKEjnflUWOaUGNfOxNUvmCqPPMIHXEmk5uSmtEwiox2LDRAIQB/ustTuDNGuCTR+5CfCG4558tNmL6qZd/f2d+uZFvN X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB6263.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(52116014)(7416014)(921020)(38350700014)(81742002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: h4Ku9pAc+5ogDInMVRr+3TkGgDLGPhuEjxOHZVzDAERN8RAFXIHffBLMxvrTxExEdXozwwt/XA0WP4EA8tuu0n4ic4+IQhC6fP1dRDD6jKR8xSUbFuJpntWzJ5KrO64aumI6bBsgXbZJCNUf0xVoJKKJrtTQUgtPvLMvDO5BDWEYFiT19OzYhqDsWXcHUdEIddkt9QEE1xACCl7NfmumSLWk3X+52fWdFEGbGKjEaoFMyZejvtlb8/JWNFyVmlMMYkas4+4ulb4oXxsvxzLWBlDOD/bw3BfWjhztRu7R+kep2fLubTX2tadOjTPfwbE8pdcpVKCs1/A5IRcNJFATGNc0HNiAmytAl2qFxBpYd/X3fLUJiq6ARgi7YQpM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9wLbARUMcmNP+NS4r9EP6idgaeovQzqyaeFy2SmNaWnovI6qvOVKb4dvYugd1p1ykyfo1xXr7akcaksvvWckq567H5yeTybbnkUtCQcxucLmw6FbtIxFa3w6 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b78c7bcd-f5e6-47e1-7644-08dcc27c47cc X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB6263.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 07:30:21.8057 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: l38wv/8DR7gSG9w1MWy81j+YxdJUW+Cj1Pjy9eKTF/Pze4+u5mV5INdv0nfIHzRJY/pqMauvJugrlt+qHcpXBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6964 X-Mailman-Approved-At: Thu, 22 Aug 2024 07:49:09 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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@vivo.com> --- .../drm/amd/pm/powerplay/smumgr/tonga_smumgr.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c index 6fe6e6abb..60b1387f6 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c @@ -700,7 +700,7 @@ static int tonga_populate_all_graphic_levels(struct pp_hwmgr *hwmgr) SMU72_Discrete_GraphicsLevel *levels = smu_data->smc_state_table.GraphicsLevel; uint32_t i, max_entry; - 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; @@ -747,8 +747,8 @@ static int tonga_populate_all_graphic_levels(struct pp_hwmgr *hwmgr) while (data->dpm_level_enable_mask.pcie_dpm_enable_mask && ((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 && @@ -757,18 +757,19 @@ static int tonga_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*/ smu_data->smc_state_table.GraphicsLevel[0].pcieDpmLevel = lowest_pcie_level_enabled;