Skip to contentSkip to conversation

ACPI: Replace kernel.h with the necessary inclusions

PATCH In review Andy Shevchenko 2 participants 4 messages Nov 10, 2021 – Nov 23, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: Replace kernel.h with the necessary inclusions

When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved.

Replace kernel.h inclusion with the list of what is really being used.

---
 include/acpi/acpi_numa.h | 1 -
 include/acpi/processor.h | 7 ++++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
include/acpi/acpi_numa.h +0 -1
index 68e4d80c1b32..b5f594754a9e 100644
@@ -3,7 +3,6 @@
 #define __ACPI_NUMA_H
 
 #ifdef CONFIG_ACPI_NUMA
-#include <linux/kernel.h>
 #include <linux/numa.h>
 
 /* Proximity bitmap length */
include/acpi/processor.h +6 -1
index 683e124ad517..194027371928 100644
@@ -2,11 +2,16 @@
 #ifndef __ACPI_PROCESSOR_H
 #define __ACPI_PROCESSOR_H
 
-#include <linux/kernel.h>
 #include <linux/cpu.h>
 #include <linux/cpufreq.h>
 #include <linux/pm_qos.h>
+#include <linux/printk.h>
+#include <linux/sched.h>
+#include <linux/smp.h>
 #include <linux/thermal.h>
+#include <linux/types.h>
+#include <linux/workqueue.h>
+
 #include <asm/acpi.h>
 
 #define ACPI_PROCESSOR_CLASS		"processor"
Signature · 1 line
2.33.0
#1 lore raw
Quoted 4 lines · Andy Shevchenko

When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved.

Replace kernel.h inclusion with the list of what is really being used.

Anybody any comments on this? I really want to shrink kernel.h usage in headers rather sooner than later...

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 9 lines · Andy Shevchenko
Quoted 4 lines · Andy Shevchenko

When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved.

Replace kernel.h inclusion with the list of what is really being used.

Anybody any comments on this? I really want to shrink kernel.h usage in headers rather sooner than later...

Patch applied as 5.17 material, thanks!

#3 lore raw
Quoted 7 lines · Rafael J. Wysocki
Quoted 5 lines · Andy Shevchenko
Quoted 3 lines · Andy Shevchenko

When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Replace kernel.h inclusion with the list of what is really being used.

Anybody any comments on this? I really want to shrink kernel.h usage in headers rather sooner than later...

Patch applied as 5.17 material, thanks!

Thank you for the prompt acceptance!

Signature · 2 lines
With Best Regards,
Andy Shevchenko