thermal: Move default governor config option to the internal header
PATCH v2 1/9 thermal: Move default governor config option to the internal header
The default governor set at compilation time is a thermal internal business, no need to export to the global thermal header.
Move the config options to the internal header.
--- drivers/thermal/thermal_core.h | 11 +++++++++++ include/linux/thermal.h | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-)
drivers/thermal/thermal_core.h +11 -0
@@ -12,6 +12,17 @@#include <linux/device.h> #include <linux/thermal.h> +/* Default Thermal Governor */ +#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE ) +#define DEFAULT_THERMAL_GOVERNOR "step_wise" +#elif defined(CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE ) +#define DEFAULT_THERMAL_GOVERNOR "fair_share" +#elif defined(CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE ) +#define DEFAULT_THERMAL_GOVERNOR "user_space" +#elif defined(CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR ) +#define DEFAULT_THERMAL_GOVERNOR "power_allocator" +#endif +/* Initial state of a cooling device during binding */ #define THERMAL_NO_TARGET -1UL
include/linux/thermal.h +0 -11
@@ -32,17 +32,6 @@/* use value, which < 0K, to indicate an invalid/uninitialized temperature */ #define THERMAL_TEMP_INVALID -274000 -/* Default Thermal Governor */ -#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE ) -#define DEFAULT_THERMAL_GOVERNOR "step_wise" -#elif defined(CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE ) -#define DEFAULT_THERMAL_GOVERNOR "fair_share" -#elif defined(CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE ) -#define DEFAULT_THERMAL_GOVERNOR "user_space" -#elif defined(CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR ) -#define DEFAULT_THERMAL_GOVERNOR "power_allocator" -#endif -struct thermal_zone_device ;struct thermal_cooling_device ;struct thermal_instance ;
Signature · 1 line
2.17.1
PATCH v2 2/9 thermal: Move struct thermal_attr to the private header
The structure belongs to the thermal core internals but it is exported in the include/linux/thermal.h
For better self-encapsulation and less impact for the compilation if a change is made on it. Move the structure in the thermal core internal header file.
--- drivers/thermal/thermal_core.h | 5 +++++ include/linux/thermal.h | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/thermal/thermal_core.h +5 -0
@@ -41,6 +41,11 @@ extern struct thermal_governor *__governor_thermal_table_end[]; __governor < __governor_thermal_table_end; \ __governor++) +struct thermal_attr { +struct device_attribute attr; +char name[THERMAL_NAME_LENGTH ]; +}; +/* * This structure is used to describe the behavior of * a certain cooling device on a certain trip point
include/linux/thermal.h +1 -5
@@ -35,6 +35,7 @@struct thermal_zone_device ;struct thermal_cooling_device ;struct thermal_instance ; +struct thermal_attr ;enum thermal_device_mode {THERMAL_DEVICE_DISABLED =0 ,
@@ -119,11 +120,6 @@ struct thermal_cooling_device {struct list_head node; }; -struct thermal_attr { -struct device_attribute attr; -char name[THERMAL_NAME_LENGTH ]; -}; -/** * struct thermal_zone_device - structure for a thermal zone * @id: unique id number for each thermal zone
Signature · 1 line
2.17.1
Re: [PATCH V2 2/9] thermal: Move struct thermal_attr to the private header
Quoted 9 lines · Daniel Lezcano
The structure belongs to the thermal core internals but it is exported in the
include/linux/thermal.hFor better self-encapsulation and less impact for the compilation if a change is made on it. Move the structure in the thermal core internal header file.
Signed-off-by Daniel Lezcano <[email protected]>
Quoted 48 lines
--- drivers/thermal/thermal_core.h | 5 +++++ include/linux/thermal.h | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-)drivers/thermal/thermal_core.h +5
-0@@ -41,6 +41,11 @@ extern struct thermal_governor *__governor_thermal_table_end[]; __governor < __governor_thermal_table_end; \ __governor++) +struct thermal_attr { +struct device_attribute attr; +char name[THERMAL_NAME_LENGTH ]; +}; +/* * This structure is used to describe the behavior of * a certain cooling device on a certain trip point include/linux/thermal.h +1
-6@@ -35,6 +35,7 @@struct thermal_zone_device ;struct thermal_cooling_device ;struct thermal_instance ; +struct thermal_attr ;enum thermal_device_mode {THERMAL_DEVICE_DISABLED =0 ,@@ -119,11 +120,6 @@ struct thermal_cooling_device {struct list_head node; }; -struct thermal_attr { -struct device_attribute attr; -char name[THERMAL_NAME_LENGTH ]; -}; -/** * struct thermal_zone_device - structure for a thermal zone * @id: unique id number for each thermal zone -- 2.17.1
PATCH v2 3/9 thermal: Move internal IPA functions
In reply to Daniel LezcanoThe exported IPA functions are used by the IPA. It is pointless to declare the functions in the thermal.h file.
For better self-encapsulation and less impact for the compilation if a change is made on it. Move the code in the thermal core internal header file.
As the users depends on THERMAL then it is pointless to have the stub, remove them.
Take also the opportunity to fix checkpatch warnings/errors when moving the code around.
--- drivers/thermal/thermal_core.h | 13 +++++++++++++ include/linux/thermal.h | 24 ------------------------ 2 files changed, 13 insertions(+), 24 deletions(-)
drivers/thermal/thermal_core.h +13 -0
@@ -46,6 +46,19 @@ struct thermal_attr {char name[THERMAL_NAME_LENGTH ]; }; +static inline bool cdev_is_power_actor (struct thermal_cooling_device *cdev) +{ +return cdev->ops->get_requested_power && cdev->ops->state2power && + cdev->ops->power2state; +} + +int power_actor_get_max_power (struct thermal_cooling_device *cdev, +struct thermal_zone_device *tz,u32 *max_power); +int power_actor_get_min_power (struct thermal_cooling_device *cdev, +struct thermal_zone_device *tz,u32 *min_power); +int power_actor_set_power (struct thermal_cooling_device *cdev, +struct thermal_instance *ti,u32 power); +/* * This structure is used to describe the behavior of * a certain cooling device on a certain trip point
include/linux/thermal.h +0 -24
@@ -399,18 +399,6 @@ void devm_thermal_zone_of_sensor_unregister(struct device *dev,#endif #if IS_ENABLED (CONFIG_THERMAL ) -static inline bool cdev_is_power_actor (struct thermal_cooling_device *cdev) -{ -return cdev->ops->get_requested_power && cdev->ops->state2power && - cdev->ops->power2state; -} - -int power_actor_get_max_power (struct thermal_cooling_device *, -struct thermal_zone_device *tz,u32 *max_power); -int power_actor_get_min_power (struct thermal_cooling_device *, -struct thermal_zone_device *tz,u32 *min_power); -int power_actor_set_power (struct thermal_cooling_device *, -struct thermal_instance *,u32 );struct thermal_zone_device *thermal_zone_device_register (const char *,int ,int ,void *,struct thermal_zone_device_ops *,struct thermal_zone_params *,int ,int );
@@ -447,18 +435,6 @@ struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,void thermal_cdev_update (struct thermal_cooling_device *);void thermal_notify_framework (struct thermal_zone_device *,int );#else -static inline bool cdev_is_power_actor (struct thermal_cooling_device *cdev) -{return false; } -static inline int power_actor_get_max_power (struct thermal_cooling_device *cdev, -struct thermal_zone_device *tz,u32 *max_power) -{return 0 ; } -static inline int power_actor_get_min_power (struct thermal_cooling_device *cdev, -struct thermal_zone_device *tz, -u32 *min_power) -{return -ENODEV ; } -static inline int power_actor_set_power (struct thermal_cooling_device *cdev, -struct thermal_instance *tz,u32 power) -{return 0 ; } static inline struct thermal_zone_device *thermal_zone_device_register( const char *type, int trips, int mask, void *devdata, struct thermal_zone_device_ops *ops,
Signature · 1 line
2.17.1
Re: [PATCH V2 3/9] thermal: Move internal IPA functions
Quoted 8 lines · Daniel Lezcano
The exported IPA functions are used by the IPA. It is pointless to declare the functions in the
thermal.hfile.For better self-encapsulation and less impact for the compilation if a change is made on it. Move the code in the thermal core internal header file.
Quoted 7 lines
As the users depends on THERMAL then it is pointless to have the stub, remove them.
Take also the opportunity to fix checkpatch warnings/errors when moving the code around.
Signed-off-by Daniel Lezcano <[email protected]>
Quoted 74 lines
--- drivers/thermal/thermal_core.h | 13 +++++++++++++ include/linux/thermal.h | 24 ------------------------ 2 files changed, 13 insertions(+), 24 deletions(-)drivers/thermal/thermal_core.h +13
-0@@ -46,6 +46,19 @@ struct thermal_attr {char name[THERMAL_NAME_LENGTH ]; }; +static inline bool cdev_is_power_actor (struct thermal_cooling_device *cdev) +{ +return cdev->ops->get_requested_power && cdev->ops->state2power && + cdev->ops->power2state; +} + +int power_actor_get_max_power (struct thermal_cooling_device *cdev, +struct thermal_zone_device *tz,u32 *max_power); +int power_actor_get_min_power (struct thermal_cooling_device *cdev, +struct thermal_zone_device *tz,u32 *min_power); +int power_actor_set_power (struct thermal_cooling_device *cdev, +struct thermal_instance *ti,u32 power); +/* * This structure is used to describe the behavior of * a certain cooling device on a certain trip point include/linux/thermal.h +0
-25@@ -399,18 +399,6 @@ void devm_thermal_zone_of_sensor_unregister(struct device *dev,#endif #if IS_ENABLED (CONFIG_THERMAL ) -static inline bool cdev_is_power_actor (struct thermal_cooling_device *cdev) -{ -return cdev->ops->get_requested_power && cdev->ops->state2power && - cdev->ops->power2state; -} - -int power_actor_get_max_power (struct thermal_cooling_device *, -struct thermal_zone_device *tz,u32 *max_power); -int power_actor_get_min_power (struct thermal_cooling_device *, -struct thermal_zone_device *tz,u32 *min_power); -int power_actor_set_power (struct thermal_cooling_device *, -struct thermal_instance *,u32 );struct thermal_zone_device *thermal_zone_device_register (const char *,int ,int ,void *,struct thermal_zone_device_ops *,struct thermal_zone_params *,int ,int );@@ -447,18 +435,6 @@ struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,void thermal_cdev_update (struct thermal_cooling_device *);void thermal_notify_framework (struct thermal_zone_device *,int );#else -static inline bool cdev_is_power_actor (struct thermal_cooling_device *cdev) -{return false; } -static inline int power_actor_get_max_power (struct thermal_cooling_device *cdev, -struct thermal_zone_device *tz,u32 *max_power) -{return 0 ; } -static inline int power_actor_get_min_power (struct thermal_cooling_device *cdev, -struct thermal_zone_device *tz, -u32 *min_power) -{return -ENODEV ; } -static inline int power_actor_set_power (struct thermal_cooling_device *cdev, -struct thermal_instance *tz,u32 power) -{return 0 ; } static inline struct thermal_zone_device *thermal_zone_device_register( const char *type, int trips, int mask, void *devdata, struct thermal_zone_device_ops *ops, --2.17.1
PATCH v2 4/9 thermal: Move trip point structure definition to private header
In reply to Daniel LezcanoThe struct thermal_trip is only used by the thermal internals, it is pointless to export the definition in the global header.
Move the structure to the thermal_core.h internal header.
--- drivers/thermal/thermal_core.h | 13 +++++++++++++ include/linux/thermal.h | 15 --------------- 2 files changed, 13 insertions(+), 15 deletions(-)
drivers/thermal/thermal_core.h +13 -0
@@ -58,6 +58,19 @@ int power_actor_get_min_power(struct thermal_cooling_device *cdev, struct thermal_zone_device *tz, u32 *min_power);int power_actor_set_power (struct thermal_cooling_device *cdev,struct thermal_instance *ti,u32 power); +/** +* struct thermal_trip - representation of a point in temperature domain +* @np: pointer to struct device_node that this trip point was created from +* @temperature: temperature value in miliCelsius +* @hysteresis: relative hysteresis in miliCelsius +* @type: trip point type +*/ +struct thermal_trip { +struct device_node *np; +int temperature; +int hysteresis; +enum thermal_trip_type type; +};/* * This structure is used to describe the behavior of
include/linux/thermal.h +0 -15
@@ -332,21 +332,6 @@ struct thermal_zone_of_device_ops {int (*set_trip_temp)(void *,int ,int ); }; -/** -* struct thermal_trip - representation of a point in temperature domain -* @np: pointer to struct device_node that this trip point was created from -* @temperature: temperature value in miliCelsius -* @hysteresis: relative hysteresis in miliCelsius -* @type: trip point type -*/ - -struct thermal_trip { -struct device_node *np; -int temperature; -int hysteresis; -enum thermal_trip_type type; -}; -/* Function declarations */ #ifdef CONFIG_THERMAL_OF int thermal_zone_of_get_sensor_id(struct device_node *tz_np,
Signature · 1 line
2.17.1
Re: [PATCH V2 4/9] thermal: Move trip point structure definition to private header
Quoted 7 lines · Daniel Lezcano
The struct
thermal_tripis only used by the thermal internals, it is pointless to export the definition in the global header.Move the structure to the
thermal_core.hinternal header.Signed-off-by Daniel Lezcano <[email protected]>
Quoted 58 lines
--- drivers/thermal/thermal_core.h | 13 +++++++++++++ include/linux/thermal.h | 15 --------------- 2 files changed, 13 insertions(+), 15 deletions(-)drivers/thermal/thermal_core.h +13
-0@@ -58,6 +58,19 @@ int power_actor_get_min_power(struct thermal_cooling_device *cdev, struct thermal_zone_device *tz, u32 *min_power);int power_actor_set_power (struct thermal_cooling_device *cdev,struct thermal_instance *ti,u32 power); +/** +* struct thermal_trip - representation of a point in temperature domain +* @np: pointer to struct device_node that this trip point was created from +* @temperature: temperature value in miliCelsius +* @hysteresis: relative hysteresis in miliCelsius +* @type: trip point type +*/ +struct thermal_trip { +struct device_node *np; +int temperature; +int hysteresis; +enum thermal_trip_type type; +};/* * This structure is used to describe the behavior of include/linux/thermal.h +0
-16@@ -332,21 +332,6 @@ struct thermal_zone_of_device_ops {int (*set_trip_temp)(void *,int ,int ); }; -/** -* struct thermal_trip - representation of a point in temperature domain -* @np: pointer to struct device_node that this trip point was created from -* @temperature: temperature value in miliCelsius -* @hysteresis: relative hysteresis in miliCelsius -* @type: trip point type -*/ - -struct thermal_trip { -struct device_node *np; -int temperature; -int hysteresis; -enum thermal_trip_type type; -}; -/* Function declarations */ #ifdef CONFIG_THERMAL_OF int thermal_zone_of_get_sensor_id(struct device_node *tz_np, --2.17.1
PATCH v2 5/9 thermal: Move get_tz_trend to the internal header
In reply to Daniel LezcanoThe function is not used any place other than the thermal directory. It does not make sense to export its definition in the global header as there is no use of it.
Move the definition to the internal header and allow better self-encapsulation.
Take the opportunity to add the parameter names to make checkpatch happy and remove the pointless stubs.
--- drivers/thermal/thermal_core.h | 2 ++ include/linux/thermal.h | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/thermal/thermal_core.h +2 -0
@@ -72,6 +72,8 @@ struct thermal_trip {enum thermal_trip_type type; }; +int get_tz_trend (struct thermal_zone_device *tz,int trip); +/* * This structure is used to describe the behavior of * a certain cooling device on a certain trip point
include/linux/thermal.h +1 -3
@@ -414,7 +414,6 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);int thermal_zone_get_slope (struct thermal_zone_device *tz);int thermal_zone_get_offset (struct thermal_zone_device *tz); -int get_tz_trend (struct thermal_zone_device *,int );struct thermal_instance *get_thermal_instance (struct thermal_zone_device *,struct thermal_cooling_device *,int );void thermal_cdev_update (struct thermal_cooling_device *);
@@ -473,8 +472,7 @@ static inline int thermal_zone_get_slope(static inline int thermal_zone_get_offset (struct thermal_zone_device *tz) {return -ENODEV ; } -static inline int get_tz_trend (struct thermal_zone_device *tz,int trip) -{return -ENODEV ; } +static inline struct thermal_instance *get_thermal_instance (struct thermal_zone_device *tz,struct thermal_cooling_device *cdev,int trip)
Signature · 1 line
2.17.1
Re: [PATCH V2 5/9] thermal: Move get_tz_trend to the internal header
Quoted 5 lines · Daniel Lezcano
The function is not used any place other than the thermal directory. It does not make sense to export its definition in the global header as there is no use of it.
Quoted 7 lines
Move the definition to the internal header and allow better self-encapsulation.
Take the opportunity to add the parameter names to make checkpatch happy and remove the pointless stubs.
Signed-off-by Daniel Lezcano <[email protected]>
Quoted 43 lines
--- drivers/thermal/thermal_core.h | 2 ++ include/linux/thermal.h | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-)drivers/thermal/thermal_core.h +2
-0@@ -72,6 +72,8 @@ struct thermal_trip {enum thermal_trip_type type; }; +int get_tz_trend (struct thermal_zone_device *tz,int trip); +/* * This structure is used to describe the behavior of * a certain cooling device on a certain trip point include/linux/thermal.h +1
-4@@ -414,7 +414,6 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);int thermal_zone_get_slope (struct thermal_zone_device *tz);int thermal_zone_get_offset (struct thermal_zone_device *tz); -int get_tz_trend (struct thermal_zone_device *,int );struct thermal_instance *get_thermal_instance (struct thermal_zone_device *,struct thermal_cooling_device *,int );void thermal_cdev_update (struct thermal_cooling_device *);@@ -473,8 +472,7 @@ static inline int thermal_zone_get_slope(static inline int thermal_zone_get_offset (struct thermal_zone_device *tz) {return -ENODEV ; } -static inline int get_tz_trend (struct thermal_zone_device *tz,int trip) -{return -ENODEV ; } +static inline struct thermal_instance *get_thermal_instance (struct thermal_zone_device *tz,struct thermal_cooling_device *cdev,int trip) --2.17.1
PATCH v2 6/9 thermal: Move get_thermal_instance to the internal header
In reply to Daniel LezcanoThe function is not used any place other than the thermal directory. It does not make sense to export its definition in the global header as there is no use of it.
Move the definition to the internal header and allow better self-encapsulation.
Take the opportunity to add the parameter names to make checkpatch happy and remove the pointless stubs.
--- drivers/thermal/thermal_core.h | 5 +++++ include/linux/thermal.h | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-)
drivers/thermal/thermal_core.h +5 -0
@@ -74,6 +74,11 @@ struct thermal_trip {int get_tz_trend (struct thermal_zone_device *tz,int trip); +struct thermal_instance * +get_thermal_instance (struct thermal_zone_device *tz, +struct thermal_cooling_device *cdev, +int trip); +/* * This structure is used to describe the behavior of * a certain cooling device on a certain trip point
include/linux/thermal.h +0 -6
@@ -414,8 +414,6 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);int thermal_zone_get_slope (struct thermal_zone_device *tz);int thermal_zone_get_offset (struct thermal_zone_device *tz); -struct thermal_instance *get_thermal_instance (struct thermal_zone_device *, -struct thermal_cooling_device *,int );void thermal_cdev_update (struct thermal_cooling_device *);void thermal_notify_framework (struct thermal_zone_device *,int );#else
@@ -473,10 +471,6 @@ static inline int thermal_zone_get_offset( struct thermal_zone_device *tz) {return -ENODEV ; } -static inline struct thermal_instance * -get_thermal_instance (struct thermal_zone_device *tz, -struct thermal_cooling_device *cdev,int trip) -{return ERR_PTR (-ENODEV ); }static inline void thermal_cdev_update (struct thermal_cooling_device *cdev) { } static inline void thermal_notify_framework(struct thermal_zone_device *tz,
Signature · 1 line
2.17.1
Re: [PATCH V2 6/9] thermal: Move get_thermal_instance to the internal header
Quoted 5 lines · Daniel Lezcano
The function is not used any place other than the thermal directory. It does not make sense to export its definition in the global header as there is no use of it.
Quoted 7 lines
Move the definition to the internal header and allow better self-encapsulation.
Take the opportunity to add the parameter names to make checkpatch happy and remove the pointless stubs.
Signed-off-by Daniel Lezcano <[email protected]>
Quoted 48 lines
--- drivers/thermal/thermal_core.h | 5 +++++ include/linux/thermal.h | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-)drivers/thermal/thermal_core.h +5
-0@@ -74,6 +74,11 @@ struct thermal_trip {int get_tz_trend (struct thermal_zone_device *tz,int trip); +struct thermal_instance * +get_thermal_instance (struct thermal_zone_device *tz, +struct thermal_cooling_device *cdev, +int trip); +/* * This structure is used to describe the behavior of * a certain cooling device on a certain trip point include/linux/thermal.h +0
-7@@ -414,8 +414,6 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);int thermal_zone_get_slope (struct thermal_zone_device *tz);int thermal_zone_get_offset (struct thermal_zone_device *tz); -struct thermal_instance *get_thermal_instance (struct thermal_zone_device *, -struct thermal_cooling_device *,int );void thermal_cdev_update (struct thermal_cooling_device *);void thermal_notify_framework (struct thermal_zone_device *,int );#else @@ -473,10 +471,6 @@ static inline int thermal_zone_get_offset( struct thermal_zone_device *tz) {return -ENODEV ; } -static inline struct thermal_instance * -get_thermal_instance (struct thermal_zone_device *tz, -struct thermal_cooling_device *cdev,int trip) -{return ERR_PTR (-ENODEV ); }static inline void thermal_cdev_update (struct thermal_cooling_device *cdev) { } static inline void thermal_notify_framework(struct thermal_zone_device *tz, --2.17.1
PATCH v2 7/9 thermal: Change IS_ENABLED to IFDEF in the header file
In reply to Daniel LezcanoThe thermal framework can not be compiled as a module. The IS_ENABLED macro is useless here and can be replaced by an ifdef.
--- include/linux/thermal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/thermal.h +1 -1
@@ -383,7 +383,7 @@ void devm_thermal_zone_of_sensor_unregister(struct device *dev,#endif -#if IS_ENABLED (CONFIG_THERMAL ) +#ifdef CONFIG_THERMAL struct thermal_zone_device *thermal_zone_device_register (const char *,int ,int ,void *,struct thermal_zone_device_ops *,struct thermal_zone_params *,int ,int );
Signature · 1 line
2.17.1
Re: [PATCH V2 7/9] thermal: Change IS_ENABLED to IFDEF in the header file
Quoted 5 lines · Daniel Lezcano
The thermal framework can not be compiled as a module. The
IS_ENABLEDmacro is useless here and can be replaced by an ifdef.Signed-off-by Daniel Lezcano <[email protected]>
Quoted 20 lines
--- include/linux/thermal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/thermal.h +1
-2@@ -383,7 +383,7 @@ void devm_thermal_zone_of_sensor_unregister(struct device *dev,#endif -#if IS_ENABLED (CONFIG_THERMAL ) +#ifdef CONFIG_THERMAL struct thermal_zone_device *thermal_zone_device_register (const char *,int ,int ,void *,struct thermal_zone_device_ops *,struct thermal_zone_params *,int ,int ); --2.17.1
PATCH v2 8/9 thermal: Remove stubs for thermal_zone_[un]bind_cooling_device
In reply to Daniel LezcanoAll callers of the functions depends on THERMAL, it is pointless to define stubs. Remove them.
--- include/linux/thermal.h | 10 ---------- 1 file changed, 10 deletions(-)
include/linux/thermal.h +0 -10
@@ -426,16 +426,6 @@ static inline struct thermal_zone_device *thermal_zone_device_register(static inline void thermal_zone_device_unregister (struct thermal_zone_device *tz) { } -static inline int thermal_zone_bind_cooling_device ( -struct thermal_zone_device *tz,int trip, -struct thermal_cooling_device *cdev, -unsigned long upper,unsigned long lower, -unsigned int weight) -{return -ENODEV ; } -static inline int thermal_zone_unbind_cooling_device ( -struct thermal_zone_device *tz,int trip, -struct thermal_cooling_device *cdev) -{return -ENODEV ; }static inline void thermal_zone_device_update (struct thermal_zone_device *tz,enum thermal_notify_event event) { }
Signature · 1 line
2.17.1
Re: [PATCH V2 8/9] thermal: Remove stubs for thermal_zone_[un]bind_cooling_device
Quoted 5 lines · Daniel Lezcano
All callers of the functions depends on THERMAL, it is pointless to define stubs. Remove them.
Signed-off-by Daniel Lezcano <[email protected]>
Quoted 28 lines
--- include/linux/thermal.h | 10 ---------- 1 file changed, 10 deletions(-)include/linux/thermal.h +0
-11@@ -426,16 +426,6 @@ static inline struct thermal_zone_device *thermal_zone_device_register(static inline void thermal_zone_device_unregister (struct thermal_zone_device *tz) { } -static inline int thermal_zone_bind_cooling_device ( -struct thermal_zone_device *tz,int trip, -struct thermal_cooling_device *cdev, -unsigned long upper,unsigned long lower, -unsigned int weight) -{return -ENODEV ; } -static inline int thermal_zone_unbind_cooling_device ( -struct thermal_zone_device *tz,int trip, -struct thermal_cooling_device *cdev) -{return -ENODEV ; }static inline void thermal_zone_device_update (struct thermal_zone_device *tz,enum thermal_notify_event event) { } --2.17.1
PATCH v2 9/9 thermal: Remove thermal_zone_device_update() stub
In reply to Daniel LezcanoAll users of the function depends on THERMAL, no stub is needed. Remove it.
--- include/linux/thermal.h | 3 --- 1 file changed, 3 deletions(-)
include/linux/thermal.h +0 -3
@@ -426,9 +426,6 @@ static inline struct thermal_zone_device *thermal_zone_device_register(static inline void thermal_zone_device_unregister (struct thermal_zone_device *tz) { } -static inline void thermal_zone_device_update (struct thermal_zone_device *tz, -enum thermal_notify_event event) -{ }static inline struct thermal_cooling_device *thermal_cooling_device_register (char *type,void *devdata,const struct thermal_cooling_device_ops *ops)
Signature · 1 line
2.17.1
Re: [PATCH V2 9/9] thermal: Remove thermal_zone_device_update() stub
Quoted 5 lines · Daniel Lezcano
All users of the function depends on THERMAL, no stub is needed. Remove it.
Signed-off-by Daniel Lezcano <[email protected]>
Quoted 21 lines
--- include/linux/thermal.h | 3 --- 1 file changed, 3 deletions(-)include/linux/thermal.h +0
-4@@ -426,9 +426,6 @@ static inline struct thermal_zone_device *thermal_zone_device_register(static inline void thermal_zone_device_unregister (struct thermal_zone_device *tz) { } -static inline void thermal_zone_device_update (struct thermal_zone_device *tz, -enum thermal_notify_event event) -{ }static inline struct thermal_cooling_device *thermal_cooling_device_register (char *type,void *devdata,const struct thermal_cooling_device_ops *ops) --2.17.1
Quoted 7 lines · Daniel Lezcano
The default governor set at compilation time is a thermal internal business, no need to export to the global thermal header.
Move the config options to the internal header.
Signed-off-by Daniel Lezcano <[email protected]>
Quoted 52 lines
--- drivers/thermal/thermal_core.h | 11 +++++++++++ include/linux/thermal.h | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-)drivers/thermal/thermal_core.h +11
-0@@ -12,6 +12,17 @@#include <linux/device.h> #include <linux/thermal.h> +/* Default Thermal Governor */ +#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE ) +#define DEFAULT_THERMAL_GOVERNOR "step_wise" +#elif defined(CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE ) +#define DEFAULT_THERMAL_GOVERNOR "fair_share" +#elif defined(CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE ) +#define DEFAULT_THERMAL_GOVERNOR "user_space" +#elif defined(CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR ) +#define DEFAULT_THERMAL_GOVERNOR "power_allocator" +#endif +/* Initial state of a cooling device during binding */ #define THERMAL_NO_TARGET -1ULinclude/linux/thermal.h +0
-12@@ -32,17 +32,6 @@/* use value, which < 0K, to indicate an invalid/uninitialized temperature */ #define THERMAL_TEMP_INVALID -274000 -/* Default Thermal Governor */ -#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE ) -#define DEFAULT_THERMAL_GOVERNOR "step_wise" -#elif defined(CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE ) -#define DEFAULT_THERMAL_GOVERNOR "fair_share" -#elif defined(CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE ) -#define DEFAULT_THERMAL_GOVERNOR "user_space" -#elif defined(CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR ) -#define DEFAULT_THERMAL_GOVERNOR "power_allocator" -#endif -struct thermal_zone_device ;struct thermal_cooling_device ;struct thermal_instance ; --2.17.1
Zhang Rui
reviewerHi, Daniel,
please feel free to add my Acked-by for the whole patch set.
thanks,
rui
Quoted 57 lines · Daniel Lezcano
The default governor set at compilation time is a thermal internal business, no need to export to the global thermal header.
Move the config options to the internal header.
Signed-off-by Daniel Lezcano <[email protected]>--- drivers/thermal/thermal_core.h | 11 +++++++++++ include/linux/thermal.h | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-)drivers/thermal/thermal_core.h +11
-0@@ -12,6 +12,17 @@#include <linux/device.h> #include <linux/thermal.h> +/* Default Thermal Governor */ +#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE ) +#define DEFAULT_THERMAL_GOVERNOR "step_wise" +#elif defined(CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE ) +#define DEFAULT_THERMAL_GOVERNOR "fair_share" +#elif defined(CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE ) +#define DEFAULT_THERMAL_GOVERNOR "user_space" +#elif defined(CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR ) +#define DEFAULT_THERMAL_GOVERNOR "power_allocator" +#endif +/* Initial state of a cooling device during binding */ #define THERMAL_NO_TARGET -1ULinclude/linux/thermal.h +0
-0@@ -32,17 +32,6 @@/* use value, which < 0K, to indicate an invalid/uninitialized temperature */
#defineTHERMAL_TEMP_INVALID-274000include/linux/thermal.h +0
-11-/* Default Thermal Governor */ -#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE ) -#define DEFAULT_THERMAL_GOVERNOR "step_wise" -#elif defined(CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE ) -#define DEFAULT_THERMAL_GOVERNOR "fair_share" -#elif defined(CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE ) -#define DEFAULT_THERMAL_GOVERNOR "user_space" -#elif defined(CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR ) -#define DEFAULT_THERMAL_GOVERNOR "power_allocator" -#endif -struct thermal_zone_device ;struct thermal_cooling_device ;struct thermal_instance ;
Quoted 3 lines · Zhang Rui
Hi, Daniel,
please feel free to add my Acked-by for the whole patch set.
Great, 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