OPP: remove some duplicated includes
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Quoted 81 lines · Yangtao Li
Some header files are included twice.It's unnecessary, so just remove them.
Signed-off-by Yangtao Li <[email protected]>--- 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@@ -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@@ -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@@ -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@@ -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@@ -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
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