linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 1/9] thermal: Move default governor config option to the internal header
@ 2020-04-02 14:27 Daniel Lezcano
  2020-04-02 14:27 ` [PATCH V2 2/9] thermal: Move struct thermal_attr to the private header Daniel Lezcano
                   ` (9 more replies)
  0 siblings, 10 replies; 20+ messages in thread
From: Daniel Lezcano @ 2020-04-02 14:27 UTC (permalink / raw)
  To: daniel.lezcano, rui.zhang; +Cc: amit.kucheria, open list:THERMAL, open list

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 <daniel.lezcano@linaro.org>
---
 drivers/thermal/thermal_core.h | 11 +++++++++++
 include/linux/thermal.h        | 11 -----------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index 37cd4e2bead2..828305508556 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -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
 
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 448841ab0dca..71cff87dcb46 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -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


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH V2 2/9] thermal: Move struct thermal_attr to the private header
  2020-04-02 14:27 [PATCH V2 1/9] thermal: Move default governor config option to the internal header Daniel Lezcano
@ 2020-04-02 14:27 ` Daniel Lezcano
  2020-04-04  7:30   ` Amit Kucheria
  2020-04-02 14:27 ` [PATCH V2 3/9] thermal: Move internal IPA functions Daniel Lezcano
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Daniel Lezcano @ 2020-04-02 14:27 UTC (permalink / raw)
  To: daniel.lezcano, rui.zhang; +Cc: amit.kucheria, open list:THERMAL, open list

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.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/thermal/thermal_core.h | 5 +++++
 include/linux/thermal.h        | 6 +-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index 828305508556..5d08ad60d9df 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -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
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 71cff87dcb46..5aa80fb2fb61 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -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


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH V2 3/9] thermal: Move internal IPA functions
  2020-04-02 14:27 [PATCH V2 1/9] thermal: Move default governor config option to the internal header Daniel Lezcano
  2020-04-02 14:27 ` [PATCH V2 2/9] thermal: Move struct thermal_attr to the private header Daniel Lezcano
@ 2020-04-02 14:27 ` Daniel Lezcano
  2020-04-04  7:30   ` Amit Kucheria
  2020-04-02 14:27 ` [PATCH V2 4/9] thermal: Move trip point structure definition to private header Daniel Lezcano
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Daniel Lezcano @ 2020-04-02 14:27 UTC (permalink / raw)
  To: daniel.lezcano, rui.zhang; +Cc: amit.kucheria, open list:THERMAL, open list

The 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.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/thermal/thermal_core.h | 13 +++++++++++++
 include/linux/thermal.h        | 24 ------------------------
 2 files changed, 13 insertions(+), 24 deletions(-)

diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index 5d08ad60d9df..f99551ce9838 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -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
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 5aa80fb2fb61..e0279f7b43f4 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -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


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH V2 4/9] thermal: Move trip point structure definition to private header
  2020-04-02 14:27 [PATCH V2 1/9] thermal: Move default governor config option to the internal header Daniel Lezcano
  2020-04-02 14:27 ` [PATCH V2 2/9] thermal: Move struct thermal_attr to the private header Daniel Lezcano
  2020-04-02 14:27 ` [PATCH V2 3/9] thermal: Move internal IPA functions Daniel Lezcano
@ 2020-04-02 14:27 ` Daniel Lezcano
  2020-04-04  7:30   ` Amit Kucheria
  2020-04-02 14:27 ` [PATCH V2 5/9] thermal: Move get_tz_trend to the internal header Daniel Lezcano
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Daniel Lezcano @ 2020-04-02 14:27 UTC (permalink / raw)
  To: daniel.lezcano, rui.zhang; +Cc: amit.kucheria, open list:THERMAL, open list

The 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.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/thermal/thermal_core.h | 13 +++++++++++++
 include/linux/thermal.h        | 15 ---------------
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index f99551ce9838..d37de708c28a 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -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
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index e0279f7b43f4..7adbfe092281 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -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


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH V2 5/9] thermal: Move get_tz_trend to the internal header
  2020-04-02 14:27 [PATCH V2 1/9] thermal: Move default governor config option to the internal header Daniel Lezcano
                   ` (2 preceding siblings ...)
  2020-04-02 14:27 ` [PATCH V2 4/9] thermal: Move trip point structure definition to private header Daniel Lezcano
@ 2020-04-02 14:27 ` Daniel Lezcano
  2020-04-04  7:30   ` Amit Kucheria
  2020-04-02 14:27 ` [PATCH V2 6/9] thermal: Move get_thermal_instance " Daniel Lezcano
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Daniel Lezcano @ 2020-04-02 14:27 UTC (permalink / raw)
  To: daniel.lezcano, rui.zhang; +Cc: amit.kucheria, open list:THERMAL, open list

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.

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 <daniel.lezcano@linaro.org>
---
 drivers/thermal/thermal_core.h | 2 ++
 include/linux/thermal.h        | 4 +---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index d37de708c28a..5fb2bd9c7034 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -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
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 7adbfe092281..8006ba5de855 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -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


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH V2 6/9] thermal: Move get_thermal_instance to the internal header
  2020-04-02 14:27 [PATCH V2 1/9] thermal: Move default governor config option to the internal header Daniel Lezcano
                   ` (3 preceding siblings ...)
  2020-04-02 14:27 ` [PATCH V2 5/9] thermal: Move get_tz_trend to the internal header Daniel Lezcano
@ 2020-04-02 14:27 ` Daniel Lezcano
  2020-04-04  7:30   ` Amit Kucheria
  2020-04-02 14:27 ` [PATCH V2 7/9] thermal: Change IS_ENABLED to IFDEF in the header file Daniel Lezcano
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Daniel Lezcano @ 2020-04-02 14:27 UTC (permalink / raw)
  To: daniel.lezcano, rui.zhang; +Cc: amit.kucheria, open list:THERMAL, open list

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.

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 <daniel.lezcano@linaro.org>
---
 drivers/thermal/thermal_core.h | 5 +++++
 include/linux/thermal.h        | 6 ------
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index 5fb2bd9c7034..c95689586e19 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -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
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 8006ba5de855..47e745c5dfca 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -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


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH V2 7/9] thermal: Change IS_ENABLED to IFDEF in the header file
  2020-04-02 14:27 [PATCH V2 1/9] thermal: Move default governor config option to the internal header Daniel Lezcano
                   ` (4 preceding siblings ...)
  2020-04-02 14:27 ` [PATCH V2 6/9] thermal: Move get_thermal_instance " Daniel Lezcano
@ 2020-04-02 14:27 ` Daniel Lezcano
  2020-04-04  7:30   ` Amit Kucheria
  2020-04-02 14:27 ` [PATCH V2 8/9] thermal: Remove stubs for thermal_zone_[un]bind_cooling_device Daniel Lezcano
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Daniel Lezcano @ 2020-04-02 14:27 UTC (permalink / raw)
  To: daniel.lezcano, rui.zhang; +Cc: amit.kucheria, open list:THERMAL, open list

The thermal framework can not be compiled as a module. The IS_ENABLED
macro is useless here and can be replaced by an ifdef.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 include/linux/thermal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 47e745c5dfca..12df9ff0182d 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -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


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH V2 8/9] thermal: Remove stubs for thermal_zone_[un]bind_cooling_device
  2020-04-02 14:27 [PATCH V2 1/9] thermal: Move default governor config option to the internal header Daniel Lezcano
                   ` (5 preceding siblings ...)
  2020-04-02 14:27 ` [PATCH V2 7/9] thermal: Change IS_ENABLED to IFDEF in the header file Daniel Lezcano
@ 2020-04-02 14:27 ` Daniel Lezcano
  2020-04-04  7:30   ` Amit Kucheria
  2020-04-02 14:27 ` [PATCH V2 9/9] thermal: Remove thermal_zone_device_update() stub Daniel Lezcano
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Daniel Lezcano @ 2020-04-02 14:27 UTC (permalink / raw)
  To: daniel.lezcano, rui.zhang; +Cc: amit.kucheria, open list:THERMAL, open list

All callers of the functions depends on THERMAL, it is pointless to
define stubs. Remove them.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 include/linux/thermal.h | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 12df9ff0182d..7b3dbfe15b59 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -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


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH V2 9/9] thermal: Remove thermal_zone_device_update() stub
  2020-04-02 14:27 [PATCH V2 1/9] thermal: Move default governor config option to the internal header Daniel Lezcano
                   ` (6 preceding siblings ...)
  2020-04-02 14:27 ` [PATCH V2 8/9] thermal: Remove stubs for thermal_zone_[un]bind_cooling_device Daniel Lezcano
@ 2020-04-02 14:27 ` Daniel Lezcano
  2020-04-04  7:30   ` Amit Kucheria
  2020-04-04  7:30 ` [PATCH V2 1/9] thermal: Move default governor config option to the internal header Amit Kucheria
  2020-04-12  8:35 ` Zhang Rui
  9 siblings, 1 reply; 20+ messages in thread
From: Daniel Lezcano @ 2020-04-02 14:27 UTC (permalink / raw)
  To: daniel.lezcano, rui.zhang; +Cc: amit.kucheria, open list:THERMAL, open list

All users of the function depends on THERMAL, no stub is
needed. Remove it.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 include/linux/thermal.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 7b3dbfe15b59..216185bb3014 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -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


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 9/9] thermal: Remove thermal_zone_device_update() stub
  2020-04-02 14:27 ` [PATCH V2 9/9] thermal: Remove thermal_zone_device_update() stub Daniel Lezcano
@ 2020-04-04  7:30   ` Amit Kucheria
  0 siblings, 0 replies; 20+ messages in thread
From: Amit Kucheria @ 2020-04-04  7:30 UTC (permalink / raw)
  To: Daniel Lezcano; +Cc: Zhang Rui, open list:THERMAL, open list

On Thu, Apr 2, 2020 at 7:58 PM Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>
> All users of the function depends on THERMAL, no stub is
> needed. Remove it.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---
>  include/linux/thermal.h | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 7b3dbfe15b59..216185bb3014 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -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
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 4/9] thermal: Move trip point structure definition to private header
  2020-04-02 14:27 ` [PATCH V2 4/9] thermal: Move trip point structure definition to private header Daniel Lezcano
@ 2020-04-04  7:30   ` Amit Kucheria
  0 siblings, 0 replies; 20+ messages in thread
From: Amit Kucheria @ 2020-04-04  7:30 UTC (permalink / raw)
  To: Daniel Lezcano; +Cc: Zhang Rui, open list:THERMAL, open list

On Thu, Apr 2, 2020 at 7:58 PM Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>
> The 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.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---
>  drivers/thermal/thermal_core.h | 13 +++++++++++++
>  include/linux/thermal.h        | 15 ---------------
>  2 files changed, 13 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
> index f99551ce9838..d37de708c28a 100644
> --- a/drivers/thermal/thermal_core.h
> +++ b/drivers/thermal/thermal_core.h
> @@ -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
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index e0279f7b43f4..7adbfe092281 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -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
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 2/9] thermal: Move struct thermal_attr to the private header
  2020-04-02 14:27 ` [PATCH V2 2/9] thermal: Move struct thermal_attr to the private header Daniel Lezcano
@ 2020-04-04  7:30   ` Amit Kucheria
  0 siblings, 0 replies; 20+ messages in thread
From: Amit Kucheria @ 2020-04-04  7:30 UTC (permalink / raw)
  To: Daniel Lezcano; +Cc: Zhang Rui, open list:THERMAL, open list

On Thu, Apr 2, 2020 at 7:58 PM Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>
> 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.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---
>  drivers/thermal/thermal_core.h | 5 +++++
>  include/linux/thermal.h        | 6 +-----
>  2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
> index 828305508556..5d08ad60d9df 100644
> --- a/drivers/thermal/thermal_core.h
> +++ b/drivers/thermal/thermal_core.h
> @@ -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
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 71cff87dcb46..5aa80fb2fb61 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -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
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 7/9] thermal: Change IS_ENABLED to IFDEF in the header file
  2020-04-02 14:27 ` [PATCH V2 7/9] thermal: Change IS_ENABLED to IFDEF in the header file Daniel Lezcano
@ 2020-04-04  7:30   ` Amit Kucheria
  0 siblings, 0 replies; 20+ messages in thread
From: Amit Kucheria @ 2020-04-04  7:30 UTC (permalink / raw)
  To: Daniel Lezcano; +Cc: Zhang Rui, open list:THERMAL, open list

On Thu, Apr 2, 2020 at 7:58 PM Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>
> The thermal framework can not be compiled as a module. The IS_ENABLED
> macro is useless here and can be replaced by an ifdef.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---
>  include/linux/thermal.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 47e745c5dfca..12df9ff0182d 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -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
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 3/9] thermal: Move internal IPA functions
  2020-04-02 14:27 ` [PATCH V2 3/9] thermal: Move internal IPA functions Daniel Lezcano
@ 2020-04-04  7:30   ` Amit Kucheria
  0 siblings, 0 replies; 20+ messages in thread
From: Amit Kucheria @ 2020-04-04  7:30 UTC (permalink / raw)
  To: Daniel Lezcano; +Cc: Zhang Rui, open list:THERMAL, open list

On Thu, Apr 2, 2020 at 7:58 PM Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>
> The 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.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---
>  drivers/thermal/thermal_core.h | 13 +++++++++++++
>  include/linux/thermal.h        | 24 ------------------------
>  2 files changed, 13 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
> index 5d08ad60d9df..f99551ce9838 100644
> --- a/drivers/thermal/thermal_core.h
> +++ b/drivers/thermal/thermal_core.h
> @@ -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
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 5aa80fb2fb61..e0279f7b43f4 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -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
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 8/9] thermal: Remove stubs for thermal_zone_[un]bind_cooling_device
  2020-04-02 14:27 ` [PATCH V2 8/9] thermal: Remove stubs for thermal_zone_[un]bind_cooling_device Daniel Lezcano
@ 2020-04-04  7:30   ` Amit Kucheria
  0 siblings, 0 replies; 20+ messages in thread
From: Amit Kucheria @ 2020-04-04  7:30 UTC (permalink / raw)
  To: Daniel Lezcano; +Cc: Zhang Rui, open list:THERMAL, open list

On Thu, Apr 2, 2020 at 7:58 PM Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>
> All callers of the functions depends on THERMAL, it is pointless to
> define stubs. Remove them.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---
>  include/linux/thermal.h | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 12df9ff0182d..7b3dbfe15b59 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -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
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 1/9] thermal: Move default governor config option to the internal header
  2020-04-02 14:27 [PATCH V2 1/9] thermal: Move default governor config option to the internal header Daniel Lezcano
                   ` (7 preceding siblings ...)
  2020-04-02 14:27 ` [PATCH V2 9/9] thermal: Remove thermal_zone_device_update() stub Daniel Lezcano
@ 2020-04-04  7:30 ` Amit Kucheria
  2020-04-12  8:35 ` Zhang Rui
  9 siblings, 0 replies; 20+ messages in thread
From: Amit Kucheria @ 2020-04-04  7:30 UTC (permalink / raw)
  To: Daniel Lezcano; +Cc: Zhang Rui, open list:THERMAL, open list

On Thu, Apr 2, 2020 at 7:58 PM Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>
> 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 <daniel.lezcano@linaro.org>

Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---
>  drivers/thermal/thermal_core.h | 11 +++++++++++
>  include/linux/thermal.h        | 11 -----------
>  2 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
> index 37cd4e2bead2..828305508556 100644
> --- a/drivers/thermal/thermal_core.h
> +++ b/drivers/thermal/thermal_core.h
> @@ -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
>
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 448841ab0dca..71cff87dcb46 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -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
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 5/9] thermal: Move get_tz_trend to the internal header
  2020-04-02 14:27 ` [PATCH V2 5/9] thermal: Move get_tz_trend to the internal header Daniel Lezcano
@ 2020-04-04  7:30   ` Amit Kucheria
  0 siblings, 0 replies; 20+ messages in thread
From: Amit Kucheria @ 2020-04-04  7:30 UTC (permalink / raw)
  To: Daniel Lezcano; +Cc: Zhang Rui, open list:THERMAL, open list

On Thu, Apr 2, 2020 at 7:58 PM Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>
> 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.
>
> 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 <daniel.lezcano@linaro.org>

Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---
>  drivers/thermal/thermal_core.h | 2 ++
>  include/linux/thermal.h        | 4 +---
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
> index d37de708c28a..5fb2bd9c7034 100644
> --- a/drivers/thermal/thermal_core.h
> +++ b/drivers/thermal/thermal_core.h
> @@ -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
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 7adbfe092281..8006ba5de855 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -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
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 6/9] thermal: Move get_thermal_instance to the internal header
  2020-04-02 14:27 ` [PATCH V2 6/9] thermal: Move get_thermal_instance " Daniel Lezcano
@ 2020-04-04  7:30   ` Amit Kucheria
  0 siblings, 0 replies; 20+ messages in thread
From: Amit Kucheria @ 2020-04-04  7:30 UTC (permalink / raw)
  To: Daniel Lezcano; +Cc: Zhang Rui, open list:THERMAL, open list

On Thu, Apr 2, 2020 at 7:58 PM Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
>
> 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.
>
> 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 <daniel.lezcano@linaro.org>

Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---
>  drivers/thermal/thermal_core.h | 5 +++++
>  include/linux/thermal.h        | 6 ------
>  2 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
> index 5fb2bd9c7034..c95689586e19 100644
> --- a/drivers/thermal/thermal_core.h
> +++ b/drivers/thermal/thermal_core.h
> @@ -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
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 8006ba5de855..47e745c5dfca 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -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
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 1/9] thermal: Move default governor config option to the internal header
  2020-04-02 14:27 [PATCH V2 1/9] thermal: Move default governor config option to the internal header Daniel Lezcano
                   ` (8 preceding siblings ...)
  2020-04-04  7:30 ` [PATCH V2 1/9] thermal: Move default governor config option to the internal header Amit Kucheria
@ 2020-04-12  8:35 ` Zhang Rui
  2020-04-12  8:39   ` Daniel Lezcano
  9 siblings, 1 reply; 20+ messages in thread
From: Zhang Rui @ 2020-04-12  8:35 UTC (permalink / raw)
  To: Daniel Lezcano; +Cc: amit.kucheria, open list:THERMAL, open list

Hi, Daniel,

please feel free to add my Acked-by for the whole patch set.

thanks,
rui

On Thu, 2020-04-02 at 16:27 +0200, Daniel Lezcano wrote:
> 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 <daniel.lezcano@linaro.org>
> ---
>  drivers/thermal/thermal_core.h | 11 +++++++++++
>  include/linux/thermal.h        | 11 -----------
>  2 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/thermal/thermal_core.h
> b/drivers/thermal/thermal_core.h
> index 37cd4e2bead2..828305508556 100644
> --- a/drivers/thermal/thermal_core.h
> +++ b/drivers/thermal/thermal_core.h
> @@ -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
>  
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 448841ab0dca..71cff87dcb46 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -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;


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH V2 1/9] thermal: Move default governor config option to the internal header
  2020-04-12  8:35 ` Zhang Rui
@ 2020-04-12  8:39   ` Daniel Lezcano
  0 siblings, 0 replies; 20+ messages in thread
From: Daniel Lezcano @ 2020-04-12  8:39 UTC (permalink / raw)
  To: Zhang Rui; +Cc: amit.kucheria, open list:THERMAL, open list

On 12/04/2020 10:35, Zhang Rui wrote:
> Hi, Daniel,
> 
> please feel free to add my Acked-by for the whole patch set.

Great, thanks!



-- 
<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

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-04-12  8:39 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02 14:27 [PATCH V2 1/9] thermal: Move default governor config option to the internal header Daniel Lezcano
2020-04-02 14:27 ` [PATCH V2 2/9] thermal: Move struct thermal_attr to the private header Daniel Lezcano
2020-04-04  7:30   ` Amit Kucheria
2020-04-02 14:27 ` [PATCH V2 3/9] thermal: Move internal IPA functions Daniel Lezcano
2020-04-04  7:30   ` Amit Kucheria
2020-04-02 14:27 ` [PATCH V2 4/9] thermal: Move trip point structure definition to private header Daniel Lezcano
2020-04-04  7:30   ` Amit Kucheria
2020-04-02 14:27 ` [PATCH V2 5/9] thermal: Move get_tz_trend to the internal header Daniel Lezcano
2020-04-04  7:30   ` Amit Kucheria
2020-04-02 14:27 ` [PATCH V2 6/9] thermal: Move get_thermal_instance " Daniel Lezcano
2020-04-04  7:30   ` Amit Kucheria
2020-04-02 14:27 ` [PATCH V2 7/9] thermal: Change IS_ENABLED to IFDEF in the header file Daniel Lezcano
2020-04-04  7:30   ` Amit Kucheria
2020-04-02 14:27 ` [PATCH V2 8/9] thermal: Remove stubs for thermal_zone_[un]bind_cooling_device Daniel Lezcano
2020-04-04  7:30   ` Amit Kucheria
2020-04-02 14:27 ` [PATCH V2 9/9] thermal: Remove thermal_zone_device_update() stub Daniel Lezcano
2020-04-04  7:30   ` Amit Kucheria
2020-04-04  7:30 ` [PATCH V2 1/9] thermal: Move default governor config option to the internal header Amit Kucheria
2020-04-12  8:35 ` Zhang Rui
2020-04-12  8:39   ` Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).