hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/cpufreq/powernow-k8.c
....@@ -1,8 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * (c) 2003-2012 Advanced Micro Devices, Inc.
3
- * Your use of this code is subject to the terms and conditions of the
4
- * GNU general public license version 2. See "COPYING" or
5
- * http://www.gnu.org/licenses/gpl.html
64 *
75 * Maintainer:
86 * Andreas Herrmann <herrmann.der.user@googlemail.com>
....@@ -11,7 +9,6 @@
119 * (C) 2003 Dave Jones on behalf of SuSE Labs
1210 * (C) 2004 Dominik Brodowski <linux@brodo.de>
1311 * (C) 2004 Pavel Machek <pavel@ucw.cz>
14
- * Licensed under the terms of the GNU GPL License version 2.
1512 * Based upon datasheets & sample CPUs kindly provided by AMD.
1613 *
1714 * Valuable input gratefully received from Dave Jones, Pavel Machek,
....@@ -89,7 +86,7 @@
8986 */
9087 static int pending_bit_stuck(void)
9188 {
92
- u32 lo, hi;
89
+ u32 lo, hi __always_unused;
9390
9491 rdmsr(MSR_FIDVID_STATUS, lo, hi);
9592 return lo & MSR_S_LO_CHANGE_PENDING ? 1 : 0;
....@@ -285,7 +282,7 @@
285282 {
286283 u32 rvosteps = data->rvo;
287284 u32 savefid = data->currfid;
288
- u32 maxvid, lo, rvomult = 1;
285
+ u32 maxvid, lo __always_unused, rvomult = 1;
289286
290287 pr_debug("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, reqvid 0x%x, rvo 0x%x\n",
291288 smp_processor_id(),
....@@ -455,7 +452,7 @@
455452
456453 static const struct x86_cpu_id powernow_k8_ids[] = {
457454 /* IO based frequency switching */
458
- { X86_VENDOR_AMD, 0xf },
455
+ X86_MATCH_VENDOR_FAM(AMD, 0xf, NULL),
459456 {}
460457 };
461458 MODULE_DEVICE_TABLE(x86cpu, powernow_k8_ids);
....@@ -1104,7 +1101,8 @@
11041101
11051102 kfree(data->powernow_table);
11061103 kfree(data);
1107
- for_each_cpu(cpu, pol->cpus)
1104
+ /* pol->cpus will be empty here, use related_cpus instead. */
1105
+ for_each_cpu(cpu, pol->related_cpus)
11081106 per_cpu(powernow_data, cpu) = NULL;
11091107
11101108 return 0;
....@@ -1175,7 +1173,7 @@
11751173 unsigned int i, supported_cpus = 0;
11761174 int ret;
11771175
1178
- if (static_cpu_has(X86_FEATURE_HW_PSTATE)) {
1176
+ if (boot_cpu_has(X86_FEATURE_HW_PSTATE)) {
11791177 __request_acpi_cpufreq();
11801178 return -ENODEV;
11811179 }