From: "Ahmed S. Darwish" <darwi@linutronix.de>
To: Borislav Petkov <bp@alien8.de>, Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Andrew Cooper <andrew.cooper3@citrix.com>,
John Ogness <john.ogness@linutronix.de>,
x86@kernel.org, x86-cpuid@lists.linux.dev,
LKML <linux-kernel@vger.kernel.org>,
"Ahmed S. Darwish" <darwi@linutronix.de>
Subject: [PATCH v2 4/6] drivers: Reorder headers alphabetically
Date: Wed, 9 Jul 2025 22:30:30 +0200 [thread overview]
Message-ID: <20250709203033.90125-5-darwi@linutronix.de> (raw)
In-Reply-To: <20250709203033.90125-1-darwi@linutronix.de>
Multiple drivers use the cpuid_*() macros, but implicitly include the
main CPUID header through <asm/processor.h> instead.
Sort their include lines so that <asm/cpuid/api.h> can be explicitly
included next.
Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
---
drivers/cpufreq/longrun.c | 6 +++---
drivers/cpufreq/powernow-k7.c | 13 ++++++-------
drivers/cpufreq/powernow-k8.c | 16 ++++++++--------
drivers/cpufreq/speedstep-lib.c | 5 +++--
drivers/hwmon/fam15h_power.c | 13 +++++++------
drivers/hwmon/k8temp.c | 11 ++++++-----
drivers/thermal/intel/x86_pkg_temp_thermal.c | 14 +++++++-------
7 files changed, 40 insertions(+), 38 deletions(-)
diff --git a/drivers/cpufreq/longrun.c b/drivers/cpufreq/longrun.c
index 1caaec7c280b..263c48b8f628 100644
--- a/drivers/cpufreq/longrun.c
+++ b/drivers/cpufreq/longrun.c
@@ -5,15 +5,15 @@
* BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous*
*/
+#include <linux/cpufreq.h>
+#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/cpufreq.h>
#include <linux/timex.h>
+#include <asm/cpu_device_id.h>
#include <asm/msr.h>
#include <asm/processor.h>
-#include <asm/cpu_device_id.h>
static struct cpufreq_driver longrun_driver;
diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c
index 31039330a3ba..0608040fcd1e 100644
--- a/drivers/cpufreq/powernow-k7.c
+++ b/drivers/cpufreq/powernow-k7.c
@@ -15,20 +15,20 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#include <linux/cpufreq.h>
+#include <linux/dmi.h>
+#include <linux/init.h>
+#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
-#include <linux/init.h>
-#include <linux/cpufreq.h>
#include <linux/slab.h>
#include <linux/string.h>
-#include <linux/dmi.h>
#include <linux/timex.h>
-#include <linux/io.h>
-#include <asm/timer.h> /* Needed for recalibrate_cpu_khz() */
-#include <asm/msr.h>
#include <asm/cpu_device_id.h>
+#include <asm/msr.h>
+#include <asm/timer.h> /* Needed for recalibrate_cpu_khz() */
#ifdef CONFIG_X86_POWERNOW_K7_ACPI
#include <linux/acpi.h>
@@ -691,4 +691,3 @@ MODULE_LICENSE("GPL");
late_initcall(powernow_init);
module_exit(powernow_exit);
-
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c
index f7512b4e923e..2b5cdd8f1c0a 100644
--- a/drivers/cpufreq/powernow-k8.c
+++ b/drivers/cpufreq/powernow-k8.c
@@ -26,22 +26,22 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#include <linux/acpi.h>
+#include <linux/cpufreq.h>
+#include <linux/cpumask.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/io.h>
#include <linux/kernel.h>
-#include <linux/smp.h>
#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/cpufreq.h>
+#include <linux/mutex.h>
#include <linux/slab.h>
+#include <linux/smp.h>
#include <linux/string.h>
-#include <linux/cpumask.h>
-#include <linux/io.h>
-#include <linux/delay.h>
#include <asm/msr.h>
#include <asm/cpu_device_id.h>
-#include <linux/acpi.h>
-#include <linux/mutex.h>
#include <acpi/processor.h>
#define VERSION "version 2.20.00"
diff --git a/drivers/cpufreq/speedstep-lib.c b/drivers/cpufreq/speedstep-lib.c
index 0b66df4ed513..f08817331aec 100644
--- a/drivers/cpufreq/speedstep-lib.c
+++ b/drivers/cpufreq/speedstep-lib.c
@@ -9,14 +9,15 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#include <linux/cpufreq.h>
+#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
-#include <linux/init.h>
-#include <linux/cpufreq.h>
#include <asm/msr.h>
#include <asm/tsc.h>
+
#include "speedstep-lib.h"
#define PFX "speedstep-lib: "
diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c
index 8ecebea53651..5a5674e85f63 100644
--- a/drivers/hwmon/fam15h_power.c
+++ b/drivers/hwmon/fam15h_power.c
@@ -6,20 +6,21 @@
* Author: Andreas Herrmann <herrmann.der.user@googlemail.com>
*/
+#include <linux/bitops.h>
+#include <linux/cpu.h>
+#include <linux/cpumask.h>
#include <linux/err.h>
-#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
+#include <linux/hwmon.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/pci.h>
-#include <linux/bitops.h>
-#include <linux/cpu.h>
-#include <linux/cpumask.h>
-#include <linux/time.h>
#include <linux/sched.h>
+#include <linux/time.h>
#include <linux/topology.h>
-#include <asm/processor.h>
+
#include <asm/msr.h>
+#include <asm/processor.h>
MODULE_DESCRIPTION("AMD Family 15h CPU processor power monitor");
MODULE_AUTHOR("Andreas Herrmann <herrmann.der.user@googlemail.com>");
diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c
index 2b80ac410cd1..8c1efce9a04b 100644
--- a/drivers/hwmon/k8temp.c
+++ b/drivers/hwmon/k8temp.c
@@ -7,13 +7,14 @@
* Inspired from the w83785 and amd756 drivers.
*/
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/slab.h>
-#include <linux/pci.h>
-#include <linux/hwmon.h>
#include <linux/err.h>
+#include <linux/hwmon.h>
+#include <linux/init.h>
+#include <linux/module.h>
#include <linux/mutex.h>
+#include <linux/pci.h>
+#include <linux/slab.h>
+
#include <asm/processor.h>
#define TEMP_FROM_REG(val) (((((val) >> 16) & 0xff) - 49) * 1000)
diff --git a/drivers/thermal/intel/x86_pkg_temp_thermal.c b/drivers/thermal/intel/x86_pkg_temp_thermal.c
index 3fc679b6f11b..c843cb5fc5c3 100644
--- a/drivers/thermal/intel/x86_pkg_temp_thermal.c
+++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c
@@ -5,19 +5,19 @@
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#include <linux/module.h>
+#include <linux/cpu.h>
+#include <linux/debugfs.h>
+#include <linux/device.h>
+#include <linux/err.h>
#include <linux/init.h>
#include <linux/intel_tcc.h>
-#include <linux/err.h>
+#include <linux/module.h>
#include <linux/param.h>
-#include <linux/device.h>
#include <linux/platform_device.h>
-#include <linux/cpu.h>
-#include <linux/smp.h>
-#include <linux/slab.h>
#include <linux/pm.h>
+#include <linux/slab.h>
+#include <linux/smp.h>
#include <linux/thermal.h>
-#include <linux/debugfs.h>
#include <asm/cpu_device_id.h>
#include <asm/msr.h>
--
2.49.0
next prev parent reply other threads:[~2025-07-09 20:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-09 17:04 [PATCH v1 0/7] x86: Disentangle <asm/processor.h> dependency on CPUID APIs Ahmed S. Darwish
2025-07-09 17:04 ` [PATCH v1 1/7] x86/cpuid: Remove transitional <asm/cpuid.h> header Ahmed S. Darwish
2025-07-09 17:04 ` [PATCH v1 2/7] ASoC: Intel: avs: Include CPUID header at file scope Ahmed S. Darwish
2025-07-09 17:04 ` [PATCH v1 3/7] x86: Reorder headers alphabetically Ahmed S. Darwish
2025-07-09 17:04 ` [PATCH v1 4/7] drivers: " Ahmed S. Darwish
2025-07-09 17:04 ` [PATCH v1 5/7] treewide: Explicitly include <asm/cpuid/api.h> Ahmed S. Darwish
2025-07-09 17:04 ` [PATCH v1 6/7] x86/cpu: <asm/processor.h>: Do not include CPUID API header Ahmed S. Darwish
2025-07-09 17:04 ` [PATCH v1 7/7] x86/cpuid: Rename cpuid_leaf()/cpuid_subleaf() APIs Ahmed S. Darwish
2025-07-09 17:13 ` [PATCH v1 0/7] x86: Disentangle <asm/processor.h> dependency on CPUID APIs Sean Christopherson
2025-07-09 17:48 ` Ahmed S. Darwish
2025-07-09 20:30 ` [PATCH v2 0/6] x86: Disentangle <asm/processor.h> dependency on CPUID headers Ahmed S. Darwish
2025-07-09 20:30 ` [PATCH v2 1/6] x86/cpuid: Remove transitional <asm/cpuid.h> header Ahmed S. Darwish
2025-07-09 20:30 ` [PATCH v2 2/6] ASoC: Intel: avs: Include CPUID header at file scope Ahmed S. Darwish
2025-07-09 20:30 ` [PATCH v2 3/6] x86: Reorder headers alphabetically Ahmed S. Darwish
2025-07-09 20:30 ` Ahmed S. Darwish [this message]
2025-07-09 20:30 ` [PATCH v2 5/6] treewide: Explicitly include CPUID headers Ahmed S. Darwish
2025-07-09 20:30 ` [PATCH v2 6/6] x86/cpu: <asm/processor.h>: Do not include CPUID API header Ahmed S. Darwish
2025-07-14 20:34 ` kernel test robot
2025-07-16 17:17 ` Ahmed S. Darwish
-- strict thread matches above, loose matches on Subject: below --
2025-06-12 23:39 [PATCH v3 00/44] x86: Introduce a centralized CPUID data model Ahmed S. Darwish
2025-07-09 20:26 ` [PATCH v2 0/6] x86: Disentangle <asm/processor.h> dependency on CPUID headers Ahmed S. Darwish
2025-07-09 20:26 ` [PATCH v2 4/6] drivers: Reorder headers alphabetically Ahmed S. Darwish
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250709203033.90125-5-darwi@linutronix.de \
--to=darwi@linutronix.de \
--cc=andrew.cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86-cpuid@lists.linux.dev \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®