From patchwork Thu May 23 18:26:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yazen Ghannam X-Patchwork-Id: 13672167 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2076.outbound.protection.outlook.com [40.107.223.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CF14839F4; Thu, 23 May 2024 18:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716488839; cv=fail; b=lMo4XQa0LxYJVbBA3Vd3dfY6MEKRVYVP5n6LeKXRSXMMik6uHiDRq4+o6HGJvn6qTAQJGakPL7iiXGjFIZF7qbPCWdVR8n+Msoax3a8C9+Q4GXUp1NLfZllnRNoJd0zWu9+UWIsRsump10aR9OVN0OXNuo+OofofLESg/fJfieI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716488839; c=relaxed/simple; bh=f6hqEN1VIsd63HVw54vGLB6GVd2Qpx/lRCj+1dUDUQc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=JTDQTM77KT1Llfxsxs77obtxa+egg/4FTPLpkZ5fQ0HlAlErpgFN6An1UBasCiLBfFmb80Y7KQYsWv7fEOWTh7sQmORJnxR6CC2M267oN+RhtewHv3RB1ncDj3G8y/PlgIlHaWnIsxGcIggQEmRIbLWxzqq3v3p6hc9l0ZSNLCs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=5U2ZjGoB; arc=fail smtp.client-ip=40.107.223.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="5U2ZjGoB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cwcYYdHGDnDUBfxZQGccEP+iF5bV40T96yeGzvBSYtIU6JwKJeJfZevMAeRVn7iPNs7vyH0Cv862wShDjNA8hYzqBwTMy1su8Wd+0cnooy/BRrsqLAHgAGNt43qEWty3dnXZPYz0qfUOs6OK1axmc8BV60ixcrre70i51Ge+Yobks6TnCg/zmYDdfVXuwZEya1xWP1gXgkT6EC+cp2RoagK0fBv01RV69zIJFxdEZWjiIBOHE4Rl63aP9/oZFMaK9rr6JjxCCwKoRlhAz8sjYeFtVkKwrmcyuFqc/Sz8uIpU/l4obJM12jj4TN0hH4KU+vzeLP4CvyTUv7OEbBhmBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=/bHFV0adVCqx/ezBMck7stOQmPqgwE41m48rs+rvyqc=; b=U6bybkYqTQjAVn61QTWG06VvTHkMH8diMTAL12AEs/MBYUUaxRU6Q+we5rWmKx6R0j0yJUBmSSYs2+LGnrnFuRGocv+pQgi2ZPiOTalK1Uf9YtI1wL8bDVGJRs90Uawlc87yqGEWGH0WWpN6l7WHeSCGSCHt/msNbzgRIPkYDVDSqxCX9nH4UPaYlCwbaCBeqhBM30KPwJP9NXSw0aqgp7WEZKOotH7Gxys+K6DUZZU0PLb8PhW0XJbaUoNC/GmowYdIzzyX6aB5wm92KrLigmt3gKWco9h34RhKDCM3gJeMWl2u6mEsHJOTAKqEEjzcO76dXO0lrBeEU0KlgATD+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/bHFV0adVCqx/ezBMck7stOQmPqgwE41m48rs+rvyqc=; b=5U2ZjGoBLlmQrbded+2iiJUAisacMk9pgE+8rf3VMKH2hfEbgibwjT7Q3KHTCyidUu6UEK5aWmlPCkjJ+Yrts3jX3/Y5QnnQwBlAn4mRHsl6FDaMKVUws2Y3PMArjAQvvnpoHSw5mKZF7hIOTXkXrfmXFQODVlUgmzTKZUx7yhU= Received: from DS7PR03CA0266.namprd03.prod.outlook.com (2603:10b6:5:3b3::31) by SJ0PR12MB7475.namprd12.prod.outlook.com (2603:10b6:a03:48d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.22; Thu, 23 May 2024 18:27:15 +0000 Received: from CH3PEPF00000011.namprd21.prod.outlook.com (2603:10b6:5:3b3:cafe::79) by DS7PR03CA0266.outlook.office365.com (2603:10b6:5:3b3::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36 via Frontend Transport; Thu, 23 May 2024 18:27:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CH3PEPF00000011.mail.protection.outlook.com (10.167.244.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.0 via Frontend Transport; Thu, 23 May 2024 18:27:15 +0000 Received: from quartz-7b1chost.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 23 May 2024 13:27:10 -0500 From: Yazen Ghannam Date: Thu, 23 May 2024 13:26:57 -0500 Subject: [PATCH v3 6/8] hwmon: (k10temp) Reduce k10temp_get_ccd_support() parameters Precedence: bulk X-Mailing-List: linux-edac@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240523-fix-smn-bad-read-v3-6-aa44c622de39@amd.com> References: <20240523-fix-smn-bad-read-v3-0-aa44c622de39@amd.com> In-Reply-To: <20240523-fix-smn-bad-read-v3-0-aa44c622de39@amd.com> To: Guenter Roeck , , Yazen Ghannam CC: Mario Limonciello , , , X-Mailer: b4 0.13.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PEPF00000011:EE_|SJ0PR12MB7475:EE_ X-MS-Office365-Filtering-Correlation-Id: ec0aeeae-b846-42d4-9ea7-08dc7b55f8e1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|36860700004|376005|1800799015; X-Microsoft-Antispam-Message-Info: =?utf-8?q?mAAkUnyLTWX9nGmMTXyQYKPTxQDewrU?= =?utf-8?q?ZNC7s/d//4AJWVN3beeqJfRmj60wu7+bXg0JhaE5NblvAqp2bomyUrYnC+C0DxkW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S+GQaMyDM?= =?utf-8?q?7eNm+o37GcOev7O8mc3+Qnso/BgrhJzAXa2WCaCluuwIESLEVjidBX2PjMO2MlzWS?= =?utf-8?q?lTlqnA/Ga4HFZw0lxZvEyrKcSz5baYO9CxkjqSUH3+4zCg5OPt+mQ0oh877TmFc1y?= =?utf-8?q?nE81QXVEBThHO/JY1cO9HPL6L/OnoBc5JdiuEaZYzboOmgrCRuzHmDDXwdnvrJUM8?= =?utf-8?q?s5BFq+/dAsmfzeSFVRd/bHFZmjXGuLCUfoEE8V1eu0IEQYVrj64tH6k6APiA4/tWq?= =?utf-8?q?aD7pm9qEv+kTekUqBwxL9iZp5HcK/Ri1kqOqTYMU3/PrTsf2QRs4aTkVfT4HmXdYz?= =?utf-8?q?hxCgUc1qC2uMQFfhDunWwaBtEYHw41HavW9d2SqqrHltA0gGOCWABsEWBsfp6WnLM?= =?utf-8?q?9d5PPZWBM+vm?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(82310400017)(36860700004)(376005)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2024 18:27:15.7115 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec0aeeae-b846-42d4-9ea7-08dc7b55f8e1 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH3PEPF00000011.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7475 Currently, k10temp_get_ccd_support() takes as input "pdev" and "data". However, "pdev" is already included in "data". Furthermore, the "pdev" parameter is no longer used in k10temp_get_ccd_support(), since its use was moved into read_ccd_temp_reg(). Drop the "pdev" input parameter as it is no longer needed. No functional change is intended. Signed-off-by: Yazen Ghannam Reviewed-by: Mario Limonciello Acked-by: Guenter Roeck --- drivers/hwmon/k10temp.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/hwmon/k10temp.c b/drivers/hwmon/k10temp.c index 315c52de6e54..6deb272c7cef 100644 --- a/drivers/hwmon/k10temp.c +++ b/drivers/hwmon/k10temp.c @@ -385,8 +385,7 @@ static const struct hwmon_chip_info k10temp_chip_info = { .info = k10temp_info, }; -static void k10temp_get_ccd_support(struct pci_dev *pdev, - struct k10temp_data *data, int limit) +static void k10temp_get_ccd_support(struct k10temp_data *data, int limit) { u32 regval; int i; @@ -456,18 +455,18 @@ static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id) case 0x11: /* Zen APU */ case 0x18: /* Zen+ APU */ data->ccd_offset = 0x154; - k10temp_get_ccd_support(pdev, data, 4); + k10temp_get_ccd_support(data, 4); break; case 0x31: /* Zen2 Threadripper */ case 0x60: /* Renoir */ case 0x68: /* Lucienne */ case 0x71: /* Zen2 */ data->ccd_offset = 0x154; - k10temp_get_ccd_support(pdev, data, 8); + k10temp_get_ccd_support(data, 8); break; case 0xa0 ... 0xaf: data->ccd_offset = 0x300; - k10temp_get_ccd_support(pdev, data, 8); + k10temp_get_ccd_support(data, 8); break; } } else if (boot_cpu_data.x86 == 0x19) { @@ -481,21 +480,21 @@ static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id) case 0x21: /* Zen3 Ryzen Desktop */ case 0x50 ... 0x5f: /* Green Sardine */ data->ccd_offset = 0x154; - k10temp_get_ccd_support(pdev, data, 8); + k10temp_get_ccd_support(data, 8); break; case 0x40 ... 0x4f: /* Yellow Carp */ data->ccd_offset = 0x300; - k10temp_get_ccd_support(pdev, data, 8); + k10temp_get_ccd_support(data, 8); break; case 0x60 ... 0x6f: case 0x70 ... 0x7f: data->ccd_offset = 0x308; - k10temp_get_ccd_support(pdev, data, 8); + k10temp_get_ccd_support(data, 8); break; case 0x10 ... 0x1f: case 0xa0 ... 0xaf: data->ccd_offset = 0x300; - k10temp_get_ccd_support(pdev, data, 12); + k10temp_get_ccd_support(data, 12); break; } } else if (boot_cpu_data.x86 == 0x1a) {