thermal core include cleanups
cover thermal core include cleanups
I noticed some remnants from when thermal core could be modular. While cleaning that up, I fixed up the includes to be sorted alphabetically and included export.h in files that were using EXPORT_SYMBOL* or THIS_MODULE while at the same time removing inclusion of module.h from core files.
Finally, the names of the source files for the governors and core have some inconsistencies and the last couple of patches rename them.
Build and boot tested on some ARM boards.
Amit Kucheria (14):
thermal/core: Get rid of MODULE_* tags
thermal/core: Replace module.h with export.h thermal/drivers/thermal_helpers: Sort headers alphabetically thermal/drivers/thermal_helpers: Include export.h thermal/drivers/thermal_hwmon: Sort headers alphabetically thermal/drivers/thermal_hwmon: Include export.h thermal/drivers/clock_cooling: Sort headers alphabetically thermal/drivers/clock_cooling: Include export.h thermal/drivers/cpufreq_cooling: Sort headers alphabetically thermal/drivers/cpufreq_cooling: Replace module.h with export.h thermal/drivers/of-thermal: Sort headers alphabetically thermal/drivers/user_space: Sort headers alphabetically thermal/governors: Prefix all source files with gov_ thermal/of: Rename of-thermal.c
drivers/thermal/Makefile | 10 +++++-----
drivers/thermal/clock_cooling.c | 3 ++-
drivers/thermal/cpufreq_cooling.c | 10 +++++-----
drivers/thermal/{fair_share.c => gov_fair_share.c} | 0
.../{power_allocator.c => gov_power_allocator.c} | 0
drivers/thermal/{step_wise.c => gov_step_wise.c} | 0
drivers/thermal/{user_space.c => gov_user_space.c} | 2 +-
drivers/thermal/thermal_core.c | 6 +-----
drivers/thermal/thermal_helpers.c | 3 ++-
drivers/thermal/thermal_hwmon.c | 6 ++++--
drivers/thermal/{of-thermal.c => thermal_of.c} | 10 +++++-----
11 files changed, 25 insertions(+), 25 deletions(-)
rename drivers/thermal/{fair_share.c => gov_fair_share.c} (100%)
rename drivers/thermal/{power_allocator.c => gov_power_allocator.c} (100%)
rename drivers/thermal/{step_wise.c => gov_step_wise.c} (100%)
rename drivers/thermal/{user_space.c => gov_user_space.c} (100%)
rename drivers/thermal/{of-thermal.c => thermal_of.c} (100%)Signature · 1 line
2.20.1
PATCH 1/14 thermal/core: Get rid of MODULE_* tags
The thermal framework can no longer be compiled as a module as of commit 554b3529fe01 ("thermal/drivers/core: Remove the module Kconfig's option"). Remove the MODULE_* tags.
Rui is mentioned in the copyright line at the top of the file and the license is mentioned in the SPDX tags. So no loss of information.
--- drivers/thermal/thermal_core.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/thermal/thermal_core.c +0 -4
@@ -27,10 +27,6 @@#include "thermal_core.h" #include "thermal_hwmon.h" -MODULE_AUTHOR ("Zhang Rui" ); -MODULE_DESCRIPTION ("Generic thermal management sysfs support" ); -MODULE_LICENSE ("GPL v2" ); -static DEFINE_IDA (thermal_tz_ida);static DEFINE_IDA (thermal_cdev_ida);
Signature · 1 line
2.20.1
PATCH 2/14 thermal/core: Replace module.h with export.h
In reply to Amit KucheriaThermal core cannot be modular, remove the unnecessary module.h include and replace with export.h to handle EXPORT_SYMBOL family of macros.
--- drivers/thermal/thermal_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/thermal_core.c +1 -1
@@ -9,9 +9,9 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt -#include <linux/module.h> #include <linux/device.h> #include <linux/err.h> +#include <linux/export.h> #include <linux/slab.h> #include <linux/kdev_t.h> #include <linux/idr.h>
Signature · 1 line
2.20.1
PATCH 3/14 thermal/drivers/thermal_helpers: Sort headers alphabetically
In reply to Amit KucheriaSort headers to make it easier to read and find duplicate headers.
--- drivers/thermal/thermal_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/thermal_helpers.c +1 -1
@@ -12,11 +12,11 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt -#include <linux/sysfs.h> #include <linux/device.h> #include <linux/err.h> #include <linux/slab.h> #include <linux/string.h> +#include <linux/sysfs.h> #include <trace/events/thermal.h>
Signature · 1 line
2.20.1
PATCH 4/14 thermal/drivers/thermal_helpers: Include export.h
In reply to Amit KucheriaIt is preferable to include export.h when you are using EXPORT_SYMBOL family of macros.
--- drivers/thermal/thermal_helpers.c | 1 + 1 file changed, 1 insertion(+)
drivers/thermal/thermal_helpers.c +1 -0
@@ -14,6 +14,7 @@#include <linux/device.h> #include <linux/err.h> +#include <linux/export.h> #include <linux/slab.h> #include <linux/string.h> #include <linux/sysfs.h>
Signature · 1 line
2.20.1
PATCH 5/14 thermal/drivers/thermal_hwmon: Sort headers alphabetically
In reply to Amit KucheriaSort headers to make it easier to read and find duplicate headers.
--- drivers/thermal/thermal_hwmon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/thermal/thermal_hwmon.c +3 -2
@@ -10,10 +10,11 @@* Copyright (C) 2013 Texas Instruments * Copyright (C) 2013 Eduardo Valentin <[email protected]> */ +#include <linux/err.h> #include <linux/hwmon.h> -#include <linux/thermal.h> #include <linux/slab.h> -#include <linux/err.h> +#include <linux/thermal.h> +#include "thermal_hwmon.h" /* hwmon sys I/F */
Signature · 1 line
2.20.1
PATCH 6/14 thermal/drivers/thermal_hwmon: Include export.h
In reply to Amit KucheriaIt is preferable to include export.h when you are using EXPORT_SYMBOL family of macros.
--- drivers/thermal/thermal_hwmon.c | 1 + 1 file changed, 1 insertion(+)
drivers/thermal/thermal_hwmon.c +1 -0
@@ -11,6 +11,7 @@* Copyright (C) 2013 Eduardo Valentin <[email protected]> */ #include <linux/err.h> +#include <linux/export.h> #include <linux/hwmon.h> #include <linux/slab.h> #include <linux/thermal.h>
Signature · 1 line
2.20.1
PATCH 7/14 thermal/drivers/clock_cooling: Sort headers alphabetically
In reply to Amit KucheriaSort headers to make it easier to read and find duplicate headers.
--- drivers/thermal/clock_cooling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/clock_cooling.c +1 -1
@@ -12,6 +12,7 @@* Copyright (C) 2012 Amit Daniel <[email protected]> */ #include <linux/clk.h> +#include <linux/clock_cooling.h> #include <linux/cpufreq.h> #include <linux/device.h> #include <linux/err.h>
@@ -20,7 +21,6 @@#include <linux/pm_opp.h> #include <linux/slab.h> #include <linux/thermal.h> -#include <linux/clock_cooling.h> /** * struct clock_cooling_device - data for cooling device with clock
Signature · 1 line
2.20.1
PATCH 8/14 thermal/drivers/clock_cooling: Include export.h
In reply to Amit KucheriaIt is preferrable to include export.h when you are using EXPORT_SYMBOL family of macros.
--- drivers/thermal/clock_cooling.c | 1 + 1 file changed, 1 insertion(+)
drivers/thermal/clock_cooling.c +1 -0
@@ -16,6 +16,7 @@#include <linux/cpufreq.h> #include <linux/device.h> #include <linux/err.h> +#include <linux/export.h> #include <linux/idr.h> #include <linux/mutex.h> #include <linux/pm_opp.h>
Signature · 1 line
2.20.1
PATCH 10/14 thermal/drivers/cpufreq_cooling: Replace module.h with export.h
In reply to Amit Kucheriacpufreq_cooling cannot be modular, remove the unnecessary module.h include and replace with export.h to handle EXPORT_SYMBOL family of macros.
--- drivers/thermal/cpufreq_cooling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/cpufreq_cooling.c +1 -1
@@ -10,12 +10,12 @@* Viresh Kumar <[email protected]> * */ -#include <linux/module.h> #include <linux/cpu.h> #include <linux/cpufreq.h> #include <linux/cpu_cooling.h> #include <linux/energy_model.h> #include <linux/err.h> +#include <linux/export.h> #include <linux/idr.h> #include <linux/pm_opp.h> #include <linux/pm_qos.h>
Signature · 1 line
2.20.1
PATCH 9/14 thermal/drivers/cpufreq_cooling: Sort headers alphabetically
In reply to Amit KucheriaSort headers to make it easier to read and find duplicate headers.
--- drivers/thermal/cpufreq_cooling.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/thermal/cpufreq_cooling.c +4 -4
@@ -11,16 +11,16 @@* */ #include <linux/module.h> -#include <linux/thermal.h> +#include <linux/cpu.h> #include <linux/cpufreq.h> +#include <linux/cpu_cooling.h> +#include <linux/energy_model.h> #include <linux/err.h> #include <linux/idr.h> #include <linux/pm_opp.h> #include <linux/pm_qos.h> #include <linux/slab.h> -#include <linux/cpu.h> -#include <linux/cpu_cooling.h> -#include <linux/energy_model.h> +#include <linux/thermal.h> #include <trace/events/thermal.h>
Signature · 1 line
2.20.1
PATCH 11/14 thermal/drivers/of-thermal: Sort headers alphabetically
In reply to Amit KucheriaSort headers to make it easier to read and find duplicate headers.
--- drivers/thermal/of-thermal.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/thermal/of-thermal.c +5 -5
@@ -8,13 +8,13 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt -#include <linux/thermal.h> -#include <linux/slab.h> -#include <linux/types.h> -#include <linux/of_device.h> -#include <linux/of_platform.h> #include <linux/err.h> #include <linux/export.h> +#include <linux/of_device.h> +#include <linux/of_platform.h> +#include <linux/slab.h> +#include <linux/thermal.h> +#include <linux/types.h> #include <linux/string.h> #include "thermal_core.h"
Signature · 1 line
2.20.1
PATCH 12/14 thermal/drivers/user_space: Sort headers alphabetically
In reply to Amit KucheriaSort headers to make it easier to read and find duplicate headers.
--- drivers/thermal/user_space.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/user_space.c +1 -1
@@ -10,8 +10,8 @@* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#include <linux/thermal.h> #include <linux/slab.h> +#include <linux/thermal.h> #include "thermal_core.h"
Signature · 1 line
2.20.1
PATCH 13/14 thermal/governors: Prefix all source files with gov_
In reply to Amit KucheriaBang-bang governor source file is prefixed with gov_. Do the same for other governors for consistency so they're easy to find in the sources.
---
drivers/thermal/Makefile | 8 ++++----
drivers/thermal/{fair_share.c => gov_fair_share.c} | 0
.../thermal/{power_allocator.c => gov_power_allocator.c} | 0
drivers/thermal/{step_wise.c => gov_step_wise.c} | 0
drivers/thermal/{user_space.c => gov_user_space.c} | 0
5 files changed, 4 insertions(+), 4 deletions(-)
rename drivers/thermal/{fair_share.c => gov_fair_share.c} (100%)
rename drivers/thermal/{power_allocator.c => gov_power_allocator.c} (100%)
rename drivers/thermal/{step_wise.c => gov_step_wise.c} (100%)
rename drivers/thermal/{user_space.c => gov_user_space.c} (100%)drivers/thermal/Makefile +4 -4
@@ -12,11 +12,11 @@ thermal_sys-$(CONFIG_THERMAL_HWMON) += thermal_hwmon.o thermal_sys-$(CONFIG_THERMAL_OF) += of-thermal.o # governors -thermal_sys-$(CONFIG_THERMAL_GOV_FAIR_SHARE) += fair_share.o +thermal_sys-$(CONFIG_THERMAL_GOV_FAIR_SHARE) += gov_fair_share.o thermal_sys-$(CONFIG_THERMAL_GOV_BANG_BANG) += gov_bang_bang.o -thermal_sys-$(CONFIG_THERMAL_GOV_STEP_WISE) += step_wise.o -thermal_sys-$(CONFIG_THERMAL_GOV_USER_SPACE) += user_space.o -thermal_sys-$(CONFIG_THERMAL_GOV_POWER_ALLOCATOR) += power_allocator.o +thermal_sys-$(CONFIG_THERMAL_GOV_STEP_WISE) += gov_step_wise.o +thermal_sys-$(CONFIG_THERMAL_GOV_USER_SPACE) += gov_user_space.o +thermal_sys-$(CONFIG_THERMAL_GOV_POWER_ALLOCATOR) += gov_power_allocator.o # cpufreq cooling thermal_sys-$(CONFIG_CPU_FREQ_THERMAL) += cpufreq_cooling.o
drivers/thermal/gov_fair_share.c renamed from drivers/thermal/fair_share.c +0 -0
drivers/thermal/gov_power_allocator.c renamed from drivers/thermal/power_allocator.c +0 -0
drivers/thermal/gov_step_wise.c renamed from drivers/thermal/step_wise.c +0 -0
drivers/thermal/gov_user_space.c renamed from drivers/thermal/user_space.c +0 -0
Signature · 1 line
2.20.1
PATCH 14/14 thermal/of: Rename of-thermal.c
In reply to Amit KucheriaCore thermal framework code files should start with thermal_*. of-thermal.c does not follow this pattern and can easily be confused with platform driver.
Fix this by renaming it to thermal_of.c
---
drivers/thermal/Makefile | 2 +-
drivers/thermal/{of-thermal.c => thermal_of.c} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename drivers/thermal/{of-thermal.c => thermal_of.c} (100%)drivers/thermal/Makefile +1 -1
@@ -9,7 +9,7 @@ thermal_sys-y += thermal_core.o thermal_sysfs.o \ # interface to/from other layers providing sensors thermal_sys-$(CONFIG_THERMAL_HWMON) += thermal_hwmon.o -thermal_sys-$(CONFIG_THERMAL_OF) += of-thermal.o +thermal_sys-$(CONFIG_THERMAL_OF) += thermal_of.o # governors thermal_sys-$(CONFIG_THERMAL_GOV_FAIR_SHARE) += gov_fair_share.o
drivers/thermal/thermal_of.c renamed from drivers/thermal/of-thermal.c +0 -0
Signature · 1 line
2.20.1
Quoted 9 lines · Amit Kucheria
I noticed some remnants from when thermal core could be modular. While cleaning that up, I fixed up the includes to be sorted alphabetically and included
export.hin files that were using EXPORT_SYMBOL* orTHIS_MODULEwhile at the same time removing inclusion ofmodule.hfrom core files.Finally, the names of the source files for the governors and core have some inconsistencies and the last couple of patches rename them.
Build and boot tested on some ARM boards.
Signature · 1 line
viresh
Quoted 9 lines · Amit Kucheria
I noticed some remnants from when thermal core could be modular. While cleaning that up, I fixed up the includes to be sorted alphabetically and included
export.hin files that were using EXPORT_SYMBOL* orTHIS_MODULEwhile at the same time removing inclusion ofmodule.hfrom core files.Finally, the names of the source files for the governors and core have some inconsistencies and the last couple of patches rename them.
Build and boot tested on some ARM boards.
Series applied, thanks !
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog