mfd: intel-lpss: Move linux/pm.h to the local header
Andy Shevchenko
reviewerPATCH 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
@@ -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
@@ -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
@@ -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
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.hheader file, it's logical to include it directly inintel-lpss.h. Otherwise it's a bit fragile and requires a proper ordering of header inclusion in C files.Signed-off-by Andy Shevchenko <[email protected]>
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.hheader file, it's logical to include it directly inintel-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
Signed-off-by Andy Shevchenko <[email protected]>--- 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
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.hheader file, it's logical to include it directly inintel-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
Signed-off-by Andy Shevchenko <[email protected]>--- 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 LeadLinaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Signature · 2 lines
With Best Regards, Andy Shevchenko
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.hheader file, it's logical to include it directly inintel-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_ usingpm.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
Signed-off-by Andy Shevchenko <[email protected]>--- 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
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.hheader file, it's logical to include it directly inintel-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_ usingpm.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}.cuse 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
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.hheader file, it's logical to include it directly inintel-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_ usingpm.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}.cuse 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
Lee Jones
AppliedQuoted 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.hheader file, it's logical to include it directly inintel-lpss.h. Otherwise it's a bit fragile and requires a proper ordering of header inclusion in C files.
Quoted 6 lines
Signed-off-by Andy Shevchenko <[email protected]>--- 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