Skip to contentSkip to conversation

OPP: remove some duplicated includes

PATCH In review Yangtao Li 2 participants 2 messages Nov 26, 2018 – Nov 27, 2018 Operating performance points (OPP)

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 OPP: remove some duplicated includes

Some header files are included twice.It's unnecessary, so just remove them.

---
 drivers/opp/core.c          | 2 --
 drivers/opp/cpu.c           | 1 -
 drivers/opp/debugfs.c       | 2 --
 drivers/opp/of.c            | 1 -
 drivers/opp/opp.h           | 1 -
 drivers/opp/ti-opp-supply.c | 1 -
 6 files changed, 8 deletions(-)
drivers/opp/core.c +0 -2
index 2c2df4e4fc14..31fc2cbb9d1f 100644
@@ -15,9 +15,7 @@
 
 #include <linux/clk.h>
 #include <linux/errno.h>
-#include <linux/err.h>
 #include <linux/slab.h>
-#include <linux/device.h>
 #include <linux/export.h>
 #include <linux/pm_domain.h>
 #include <linux/regulator/consumer.h>
drivers/opp/cpu.c +0 -1
index ab6d07e78945..778ac771ce93 100644
@@ -15,7 +15,6 @@
 
 #include <linux/cpu.h>
 #include <linux/cpufreq.h>
-#include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/export.h>
 #include <linux/slab.h>
drivers/opp/debugfs.c +0 -2
index e6828e5f81b0..05670aeebecd 100644
@@ -11,8 +11,6 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/debugfs.h>
-#include <linux/device.h>
-#include <linux/err.h>
 #include <linux/init.h>
 #include <linux/limits.h>
 #include <linux/slab.h>
drivers/opp/of.c +0 -1
index 5a4b47958073..ea510e350682 100644
@@ -15,7 +15,6 @@
 
 #include <linux/cpu.h>
 #include <linux/errno.h>
-#include <linux/device.h>
 #include <linux/of_device.h>
 #include <linux/pm_domain.h>
 #include <linux/slab.h>
drivers/opp/opp.h +0 -1
index 9c6544b4f4f9..558c5e638d97 100644
@@ -20,7 +20,6 @@
 #include <linux/list.h>
 #include <linux/limits.h>
 #include <linux/pm_opp.h>
-#include <linux/notifier.h>
 
 struct clk;
 struct regulator;
drivers/opp/ti-opp-supply.c +0 -1
index 3f4fb4dbbe33..b1d7442960e3 100644
@@ -13,7 +13,6 @@
 #include <linux/device.h>
 #include <linux/io.h>
 #include <linux/module.h>
-#include <linux/notifier.h>
 #include <linux/of_device.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
Signature · 1 line
2.17.0
#1 lore raw
Quoted 81 lines · Yangtao Li

Some header files are included twice.It's unnecessary, so just remove them.

---
 drivers/opp/core.c          | 2 --
 drivers/opp/cpu.c           | 1 -
 drivers/opp/debugfs.c       | 2 --
 drivers/opp/of.c            | 1 -
 drivers/opp/opp.h           | 1 -
 drivers/opp/ti-opp-supply.c | 1 -
 6 files changed, 8 deletions(-)
drivers/opp/core.c +0 -2
index 2c2df4e4fc14..31fc2cbb9d1f 100644
@@ -15,9 +15,7 @@
 
 #include <linux/clk.h>
 #include <linux/errno.h>
-#include <linux/err.h>
 #include <linux/slab.h>
-#include <linux/device.h>
 #include <linux/export.h>
 #include <linux/pm_domain.h>
 #include <linux/regulator/consumer.h>
drivers/opp/cpu.c +0 -1
index ab6d07e78945..778ac771ce93 100644
@@ -15,7 +15,6 @@
 
 #include <linux/cpu.h>
 #include <linux/cpufreq.h>
-#include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/export.h>
 #include <linux/slab.h>
drivers/opp/debugfs.c +0 -2
index e6828e5f81b0..05670aeebecd 100644
@@ -11,8 +11,6 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/debugfs.h>
-#include <linux/device.h>
-#include <linux/err.h>
 #include <linux/init.h>
 #include <linux/limits.h>
 #include <linux/slab.h>
drivers/opp/of.c +0 -1
index 5a4b47958073..ea510e350682 100644
@@ -15,7 +15,6 @@
 
 #include <linux/cpu.h>
 #include <linux/errno.h>
-#include <linux/device.h>
 #include <linux/of_device.h>
 #include <linux/pm_domain.h>
 #include <linux/slab.h>
drivers/opp/opp.h +0 -1
index 9c6544b4f4f9..558c5e638d97 100644
@@ -20,7 +20,6 @@
 #include <linux/list.h>
 #include <linux/limits.h>
 #include <linux/pm_opp.h>
-#include <linux/notifier.h>
 
 struct clk;
 struct regulator;
drivers/opp/ti-opp-supply.c +0 -0
index 3f4fb4dbbe33..b1d7442960e3 100644

drivers/opp/ti-opp-supply.c line 18

Quoted 7 lines
drivers/opp/ti-opp-supply.c +0 -1
@@ -13,7 +13,6 @@
 #include <linux/device.h>
 #include <linux/io.h>
 #include <linux/module.h>
-#include <linux/notifier.h>
 #include <linux/of_device.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>

AFAICT, none of these files have included any of the files twice directly. Yes, they may have included some .h files (like opp.h) which may have included files like err.h, etc. But that is fine. Each file in kernel should normally include all its dependencies directly and should avoid depending on other .h files to do so.

For example, kernel.h includes so many .h files, like types.h, etc. Should all files that include kernel.h stop including types.h directly? What will happen if kernel.h stops including types.h in future? Many other files will stop building, because they indirectly depended on kernel.h which is incorrect in my opinion.

Signature · 1 line
viresh