Skip to contentSkip to conversation

mfd: intel-lpss: Move linux/pm.h to the local header

PATCH Applied Andy Shevchenko 4 participants 8 messages Jan 24, 2019 – Feb 12, 2019

Subsystems (2)
lore
Share & tools
lore

Andy Shevchenko

author reviewer
#0 lore raw

PATCH 1/1 mfd: intel-lpss: Move linux/pm.h to the local header

We now using a common macro for PM operations in Intel LPSS driver, and, since that macro relies on the definition and macro from linux/pm.h header file, it's logical to include it directly in intel-lpss.h. Otherwise it's a bit fragile and requires a proper ordering of header inclusion in C files.

---
 drivers/mfd/intel-lpss-acpi.c | 1 -
 drivers/mfd/intel-lpss-pci.c  | 1 -
 drivers/mfd/intel-lpss.h      | 2 ++
 3 files changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/intel-lpss-acpi.c +0 -1
index 7911b0a14a6d..6d9f03363ee7 100644
@@ -15,7 +15,6 @@
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/pm.h>
 #include <linux/pm_runtime.h>
 #include <linux/platform_device.h>
 #include <linux/property.h>
drivers/mfd/intel-lpss-pci.c +0 -1
index 0e5282fc1467..cba2eb166650 100644
@@ -15,7 +15,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
-#include <linux/pm.h>
 #include <linux/pm_runtime.h>
 #include <linux/property.h>
 
drivers/mfd/intel-lpss.h +2 -0
index 865bbeaaf00c..3a120fecd2dc 100644
@@ -14,6 +14,8 @@
 #ifndef __MFD_INTEL_LPSS_H
 #define __MFD_INTEL_LPSS_H
 
+#include <linux/pm.h>
+
 struct device;
 struct resource;
 struct property_entry;
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Andy Shevchenko

We now using a common macro for PM operations in Intel LPSS driver, and, since that macro relies on the definition and macro from linux/pm.h header file, it's logical to include it directly in intel-lpss.h. Otherwise it's a bit fragile and requires a proper ordering of header inclusion in C files.

#2 lore raw
In reply to Andy Shevchenko
Quoted 5 lines · Andy Shevchenko

We now using a common macro for PM operations in Intel LPSS driver, and, since that macro relies on the definition and macro from linux/pm.h header file, it's logical to include it directly in intel-lpss.h. Otherwise it's a bit fragile and requires a proper ordering of header inclusion in C files.

I don't agree with this. File which use various headers should explicitly include them. Inheriting header files is non-optimal.

Quoted 6 lines
---
 drivers/mfd/intel-lpss-acpi.c | 1 -
 drivers/mfd/intel-lpss-pci.c  | 1 -
 drivers/mfd/intel-lpss.h      | 2 ++
 3 files changed, 2 insertions(+), 2 deletions(-)
Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#3 lore raw
Quoted 12 lines · Lee Jones
Quoted 5 lines · Andy Shevchenko

We now using a common macro for PM operations in Intel LPSS driver, and, since that macro relies on the definition and macro from linux/pm.h header file, it's logical to include it directly in intel-lpss.h. Otherwise it's a bit fragile and requires a proper ordering of header inclusion in C files.

I don't agree with this. File which use various headers should explicitly include them. Inheriting header files is non-optimal.

intel-lpss.h _is_ using pm.h.
I don't see a contradiction here.

Quoted 12 lines
Quoted 6 lines
---
 drivers/mfd/intel-lpss-acpi.c | 1 -
 drivers/mfd/intel-lpss-pci.c  | 1 -
 drivers/mfd/intel-lpss.h      | 2 ++
 3 files changed, 2 insertions(+), 2 deletions(-)

--
Lee Jones [李琼斯]
Linaro Services Technical Lead

Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw
Quoted 10 lines · Andy Shevchenko
Quoted 9 lines · Lee Jones
Quoted 5 lines · Andy Shevchenko

We now using a common macro for PM operations in Intel LPSS driver, and, since that macro relies on the definition and macro from linux/pm.h header file, it's logical to include it directly in intel-lpss.h. Otherwise it's a bit fragile and requires a proper ordering of header inclusion in C files.

Quoted 6 lines
Quoted 3 lines

I don't agree with this. File which use various headers should explicitly include them. Inheriting header files is non-optimal.

intel-lpss.h _is_ using pm.h.
I don't see a contradiction here.

Then it should be including in there *also*.

My point is that if drivers/mfd/intel-lpss-{acpi,pci}.c use the header file, it should include it explicitly.

Quoted 10 lines
Quoted 7 lines
Quoted 6 lines
---
 drivers/mfd/intel-lpss-acpi.c | 1 -
 drivers/mfd/intel-lpss-pci.c  | 1 -
 drivers/mfd/intel-lpss.h      | 2 ++
 3 files changed, 2 insertions(+), 2 deletions(-)
Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#5 lore raw
Quoted 10 lines · Lee Jones
Quoted 9 lines · Andy Shevchenko
Quoted 8 lines · Lee Jones
Quoted 5 lines · Andy Shevchenko

We now using a common macro for PM operations in Intel LPSS driver, and, since that macro relies on the definition and macro from linux/pm.h header file, it's logical to include it directly in intel-lpss.h. Otherwise it's a bit fragile and requires a proper ordering of header inclusion in C files.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

I don't agree with this. File which use various headers should explicitly include them. Inheriting header files is non-optimal.

intel-lpss.h _is_ using pm.h.
I don't see a contradiction here.

Then it should be including in there *also*.

Why?

intel-lpss-*.c are not direct users of this header.

Quoted 2 lines

My point is that if drivers/mfd/intel-lpss-{acpi,pci}.c use the header file, it should include it explicitly.

They are using it indirectly.

As far as I know we don't, for example, include "asm/*.h" to each of our C-file because they are in _indirect_ use of.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#6 lore raw
Quoted 15 lines · Andy Shevchenko
Quoted 14 lines · Lee Jones
Quoted 13 lines · Andy Shevchenko
Quoted 11 lines · Lee Jones
Quoted 5 lines · Andy Shevchenko

We now using a common macro for PM operations in Intel LPSS driver, and, since that macro relies on the definition and macro from linux/pm.h header file, it's logical to include it directly in intel-lpss.h. Otherwise it's a bit fragile and requires a proper ordering of header inclusion in C files.

I don't agree with this. File which use various headers should explicitly include them. Inheriting header files is non-optimal.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

intel-lpss.h _is_ using pm.h.
I don't see a contradiction here.

Then it should be including in there *also*.

Why?

intel-lpss-*.c are not direct users of this header.

They're not? That's is where the miscommunication lies then.

If a C-file isn't using the offerings of a headerfile, obviously there is no need for the C-file to include it.

Quoted 4 lines
Quoted 2 lines

My point is that if drivers/mfd/intel-lpss-{acpi,pci}.c use the header file, it should include it explicitly.

They are using it indirectly.

Indirectly is fine.

Quoted 2 lines

As far as I know we don't, for example, include "asm/*.h" to each of our C-file because they are in _indirect_ use of.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Applied
#7 lore raw
In reply to Andy Shevchenko
Quoted 6 lines · Andy Shevchenko

We now using a common macro for PM operations in Intel LPSS driver, and, since that macro relies on the definition and macro from linux/pm.h header file, it's logical to include it directly in intel-lpss.h. Otherwise it's a bit fragile and requires a proper ordering of header inclusion in C files.

Quoted 6 lines
---
 drivers/mfd/intel-lpss-acpi.c | 1 -
 drivers/mfd/intel-lpss-pci.c  | 1 -
 drivers/mfd/intel-lpss.h      | 2 ++
 3 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog