* [PATCH 1/2] thermal: core: Make thermal_zone_set_trips private
@ 2020-03-31 16:54 Daniel Lezcano
2020-03-31 16:54 ` [PATCH 2/2] thermal: core: Remove pointless debug traces Daniel Lezcano
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Daniel Lezcano @ 2020-03-31 16:54 UTC (permalink / raw)
To: daniel.lezcano; +Cc: Zhang Rui, Amit Kucheria, open list:THERMAL, open list
The function thermal_zone_set_trips() is used by the thermal core code
in order to update the next trip points, there are no other users.
Move the function definition in the thermal_core.h, remove the
EXPORT_SYMBOL_GPL and document the function.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/thermal/thermal_core.h | 3 +++
drivers/thermal/thermal_helpers.c | 13 ++++++++++++-
include/linux/thermal.h | 3 ---
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index a9bf00e91d64..37cd4e2bead2 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -69,6 +69,9 @@ void thermal_zone_device_unbind_exception(struct thermal_zone_device *,
int thermal_zone_device_set_policy(struct thermal_zone_device *, char *);
int thermal_build_list_of_policies(char *buf);
+/* Helpers */
+void thermal_zone_set_trips(struct thermal_zone_device *tz);
+
/* sysfs I/F */
int thermal_zone_create_device_groups(struct thermal_zone_device *, int);
void thermal_zone_destroy_device_groups(struct thermal_zone_device *);
diff --git a/drivers/thermal/thermal_helpers.c b/drivers/thermal/thermal_helpers.c
index 2ba756af76b7..59eaf2d0fdb3 100644
--- a/drivers/thermal/thermal_helpers.c
+++ b/drivers/thermal/thermal_helpers.c
@@ -113,6 +113,18 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp)
}
EXPORT_SYMBOL_GPL(thermal_zone_get_temp);
+/**
+ * thermal_zone_set_trips - Computes the next trip points for the driver
+ * @tz: a pointer to a thermal zone device structure
+ *
+ * The function computes the next temperature boundaries by browsing
+ * the trip points. The result is the closer low and high trip points
+ * to the current temperature. These values are passed to the backend
+ * driver to let it set its own notification mechanism (usually an
+ * interrupt).
+ *
+ * It does not return a value
+ */
void thermal_zone_set_trips(struct thermal_zone_device *tz)
{
int low = -INT_MAX;
@@ -161,7 +173,6 @@ void thermal_zone_set_trips(struct thermal_zone_device *tz)
exit:
mutex_unlock(&tz->lock);
}
-EXPORT_SYMBOL_GPL(thermal_zone_set_trips);
void thermal_cdev_update(struct thermal_cooling_device *cdev)
{
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index c91b1e344d56..448841ab0dca 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -439,7 +439,6 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int,
struct thermal_cooling_device *);
void thermal_zone_device_update(struct thermal_zone_device *,
enum thermal_notify_event);
-void thermal_zone_set_trips(struct thermal_zone_device *);
struct thermal_cooling_device *thermal_cooling_device_register(const char *,
void *, const struct thermal_cooling_device_ops *);
@@ -497,8 +496,6 @@ static inline int thermal_zone_unbind_cooling_device(
static inline void thermal_zone_device_update(struct thermal_zone_device *tz,
enum thermal_notify_event event)
{ }
-static inline void thermal_zone_set_trips(struct thermal_zone_device *tz)
-{ }
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] 6+ messages in thread
* [PATCH 2/2] thermal: core: Remove pointless debug traces
2020-03-31 16:54 [PATCH 1/2] thermal: core: Make thermal_zone_set_trips private Daniel Lezcano
@ 2020-03-31 16:54 ` Daniel Lezcano
2020-04-01 7:29 ` Lukasz Luba
2020-04-01 8:20 ` Amit Kucheria
2020-04-01 7:39 ` [PATCH 1/2] thermal: core: Make thermal_zone_set_trips private Lukasz Luba
2020-04-01 8:21 ` Amit Kucheria
2 siblings, 2 replies; 6+ messages in thread
From: Daniel Lezcano @ 2020-03-31 16:54 UTC (permalink / raw)
To: daniel.lezcano; +Cc: Zhang Rui, Amit Kucheria, open list:THERMAL, open list
The last temperature and the current temperature are show via a
dev_debug. The line before, those temperature are also traced.
It is pointless to duplicate the traces for the temperatures,
remove the dev_dbg traces.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/thermal/thermal_core.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 9a321dc548c8..c06550930979 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -447,12 +447,6 @@ static void update_temperature(struct thermal_zone_device *tz)
mutex_unlock(&tz->lock);
trace_thermal_temperature(tz);
- if (tz->last_temperature == THERMAL_TEMP_INVALID)
- dev_dbg(&tz->device, "last_temperature N/A, current_temperature=%d\n",
- tz->temperature);
- else
- dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n",
- tz->last_temperature, tz->temperature);
}
static void thermal_zone_device_init(struct thermal_zone_device *tz)
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] thermal: core: Remove pointless debug traces
2020-03-31 16:54 ` [PATCH 2/2] thermal: core: Remove pointless debug traces Daniel Lezcano
@ 2020-04-01 7:29 ` Lukasz Luba
2020-04-01 8:20 ` Amit Kucheria
1 sibling, 0 replies; 6+ messages in thread
From: Lukasz Luba @ 2020-04-01 7:29 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: Zhang Rui, Amit Kucheria, open list:THERMAL, open list
Hi Daniel,
On 3/31/20 5:54 PM, Daniel Lezcano wrote:
> The last temperature and the current temperature are show via a
> dev_debug. The line before, those temperature are also traced.
>
> It is pointless to duplicate the traces for the temperatures,
> remove the dev_dbg traces.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
> drivers/thermal/thermal_core.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 9a321dc548c8..c06550930979 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -447,12 +447,6 @@ static void update_temperature(struct thermal_zone_device *tz)
> mutex_unlock(&tz->lock);
>
> trace_thermal_temperature(tz);
> - if (tz->last_temperature == THERMAL_TEMP_INVALID)
> - dev_dbg(&tz->device, "last_temperature N/A, current_temperature=%d\n",
> - tz->temperature);
> - else
> - dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n",
> - tz->last_temperature, tz->temperature);
> }
>
> static void thermal_zone_device_init(struct thermal_zone_device *tz)
>
This prints really deserve to be removed.
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Regards,
Lukasz
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] thermal: core: Make thermal_zone_set_trips private
2020-03-31 16:54 [PATCH 1/2] thermal: core: Make thermal_zone_set_trips private Daniel Lezcano
2020-03-31 16:54 ` [PATCH 2/2] thermal: core: Remove pointless debug traces Daniel Lezcano
@ 2020-04-01 7:39 ` Lukasz Luba
2020-04-01 8:21 ` Amit Kucheria
2 siblings, 0 replies; 6+ messages in thread
From: Lukasz Luba @ 2020-04-01 7:39 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: Zhang Rui, Amit Kucheria, open list:THERMAL, open list
On 3/31/20 5:54 PM, Daniel Lezcano wrote:
> The function thermal_zone_set_trips() is used by the thermal core code
> in order to update the next trip points, there are no other users.
>
> Move the function definition in the thermal_core.h, remove the
> EXPORT_SYMBOL_GPL and document the function.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
> drivers/thermal/thermal_core.h | 3 +++
> drivers/thermal/thermal_helpers.c | 13 ++++++++++++-
> include/linux/thermal.h | 3 ---
> 3 files changed, 15 insertions(+), 4 deletions(-)
>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Regards,
Lukasz
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] thermal: core: Remove pointless debug traces
2020-03-31 16:54 ` [PATCH 2/2] thermal: core: Remove pointless debug traces Daniel Lezcano
2020-04-01 7:29 ` Lukasz Luba
@ 2020-04-01 8:20 ` Amit Kucheria
1 sibling, 0 replies; 6+ messages in thread
From: Amit Kucheria @ 2020-04-01 8:20 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: Zhang Rui, open list:THERMAL, open list
On Tue, Mar 31, 2020 at 10:27 PM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> The last temperature and the current temperature are show via a
> dev_debug. The line before, those temperature are also traced.
>
> It is pointless to duplicate the traces for the temperatures,
> remove the dev_dbg traces.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
> ---
> drivers/thermal/thermal_core.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 9a321dc548c8..c06550930979 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -447,12 +447,6 @@ static void update_temperature(struct thermal_zone_device *tz)
> mutex_unlock(&tz->lock);
>
> trace_thermal_temperature(tz);
> - if (tz->last_temperature == THERMAL_TEMP_INVALID)
> - dev_dbg(&tz->device, "last_temperature N/A, current_temperature=%d\n",
> - tz->temperature);
> - else
> - dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n",
> - tz->last_temperature, tz->temperature);
> }
>
> static void thermal_zone_device_init(struct thermal_zone_device *tz)
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] thermal: core: Make thermal_zone_set_trips private
2020-03-31 16:54 [PATCH 1/2] thermal: core: Make thermal_zone_set_trips private Daniel Lezcano
2020-03-31 16:54 ` [PATCH 2/2] thermal: core: Remove pointless debug traces Daniel Lezcano
2020-04-01 7:39 ` [PATCH 1/2] thermal: core: Make thermal_zone_set_trips private Lukasz Luba
@ 2020-04-01 8:21 ` Amit Kucheria
2 siblings, 0 replies; 6+ messages in thread
From: Amit Kucheria @ 2020-04-01 8:21 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: Zhang Rui, open list:THERMAL, open list
On Tue, Mar 31, 2020 at 10:26 PM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> The function thermal_zone_set_trips() is used by the thermal core code
> in order to update the next trip points, there are no other users.
>
> Move the function definition in the thermal_core.h, remove the
> EXPORT_SYMBOL_GPL and document the function.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
> ---
> drivers/thermal/thermal_core.h | 3 +++
> drivers/thermal/thermal_helpers.c | 13 ++++++++++++-
> include/linux/thermal.h | 3 ---
> 3 files changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
> index a9bf00e91d64..37cd4e2bead2 100644
> --- a/drivers/thermal/thermal_core.h
> +++ b/drivers/thermal/thermal_core.h
> @@ -69,6 +69,9 @@ void thermal_zone_device_unbind_exception(struct thermal_zone_device *,
> int thermal_zone_device_set_policy(struct thermal_zone_device *, char *);
> int thermal_build_list_of_policies(char *buf);
>
> +/* Helpers */
> +void thermal_zone_set_trips(struct thermal_zone_device *tz);
> +
> /* sysfs I/F */
> int thermal_zone_create_device_groups(struct thermal_zone_device *, int);
> void thermal_zone_destroy_device_groups(struct thermal_zone_device *);
> diff --git a/drivers/thermal/thermal_helpers.c b/drivers/thermal/thermal_helpers.c
> index 2ba756af76b7..59eaf2d0fdb3 100644
> --- a/drivers/thermal/thermal_helpers.c
> +++ b/drivers/thermal/thermal_helpers.c
> @@ -113,6 +113,18 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp)
> }
> EXPORT_SYMBOL_GPL(thermal_zone_get_temp);
>
> +/**
> + * thermal_zone_set_trips - Computes the next trip points for the driver
> + * @tz: a pointer to a thermal zone device structure
> + *
> + * The function computes the next temperature boundaries by browsing
> + * the trip points. The result is the closer low and high trip points
> + * to the current temperature. These values are passed to the backend
> + * driver to let it set its own notification mechanism (usually an
> + * interrupt).
> + *
> + * It does not return a value
> + */
> void thermal_zone_set_trips(struct thermal_zone_device *tz)
> {
> int low = -INT_MAX;
> @@ -161,7 +173,6 @@ void thermal_zone_set_trips(struct thermal_zone_device *tz)
> exit:
> mutex_unlock(&tz->lock);
> }
> -EXPORT_SYMBOL_GPL(thermal_zone_set_trips);
>
> void thermal_cdev_update(struct thermal_cooling_device *cdev)
> {
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index c91b1e344d56..448841ab0dca 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -439,7 +439,6 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int,
> struct thermal_cooling_device *);
> void thermal_zone_device_update(struct thermal_zone_device *,
> enum thermal_notify_event);
> -void thermal_zone_set_trips(struct thermal_zone_device *);
>
> struct thermal_cooling_device *thermal_cooling_device_register(const char *,
> void *, const struct thermal_cooling_device_ops *);
> @@ -497,8 +496,6 @@ static inline int thermal_zone_unbind_cooling_device(
> static inline void thermal_zone_device_update(struct thermal_zone_device *tz,
> enum thermal_notify_event event)
> { }
> -static inline void thermal_zone_set_trips(struct thermal_zone_device *tz)
> -{ }
> 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] 6+ messages in thread
end of thread, other threads:[~2020-04-01 8:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-31 16:54 [PATCH 1/2] thermal: core: Make thermal_zone_set_trips private Daniel Lezcano
2020-03-31 16:54 ` [PATCH 2/2] thermal: core: Remove pointless debug traces Daniel Lezcano
2020-04-01 7:29 ` Lukasz Luba
2020-04-01 8:20 ` Amit Kucheria
2020-04-01 7:39 ` [PATCH 1/2] thermal: core: Make thermal_zone_set_trips private Lukasz Luba
2020-04-01 8:21 ` Amit Kucheria
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox