All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal/core: Remove pointless thermal_zone_device_reset() function
@ 2020-12-22 18:11 Daniel Lezcano
  2021-01-19 21:27 ` [thermal: thermal/next] " thermal-bot for Daniel Lezcano
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Lezcano @ 2020-12-22 18:11 UTC (permalink / raw)
  To: daniel.lezcano, rui.zhang; +Cc: Amit Kucheria, open list:THERMAL, open list

The function thermal_zone_device_reset() is called in the
thermal_zone_device_register() which allocates and initialize the
structure. The passive field is already zero-ed by the allocation, the
function is useless.

Call directly thermal_zone_device_init() instead and
thermal_zone_device_reset().

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/thermal/thermal_core.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index b2615449b18f..996c038f83a4 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -478,12 +478,6 @@ static void thermal_zone_device_init(struct thermal_zone_device *tz)
 		pos->initialized = false;
 }
 
-static void thermal_zone_device_reset(struct thermal_zone_device *tz)
-{
-	tz->passive = 0;
-	thermal_zone_device_init(tz);
-}
-
 static int thermal_zone_device_set_mode(struct thermal_zone_device *tz,
 					enum thermal_device_mode mode)
 {
@@ -1363,7 +1357,7 @@ thermal_zone_device_register(const char *type, int trips, int mask,
 
 	INIT_DELAYED_WORK(&tz->poll_queue, thermal_zone_device_check);
 
-	thermal_zone_device_reset(tz);
+	thermal_zone_device_init(tz);
 	/* Update the new thermal zone and mark it as already updated. */
 	if (atomic_cmpxchg(&tz->need_update, 1, 0))
 		thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);
-- 
2.25.1


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

* [thermal: thermal/next] thermal/core: Remove pointless thermal_zone_device_reset() function
  2020-12-22 18:11 [PATCH] thermal/core: Remove pointless thermal_zone_device_reset() function Daniel Lezcano
@ 2021-01-19 21:27 ` thermal-bot for Daniel Lezcano
  0 siblings, 0 replies; 2+ messages in thread
From: thermal-bot for Daniel Lezcano @ 2021-01-19 21:27 UTC (permalink / raw)
  To: linux-pm; +Cc: Daniel Lezcano, rui.zhang, amitk

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     d0df264fbd3c531787dec59c4b3fca854bc7ee49
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//d0df264fbd3c531787dec59c4b3fca854bc7ee49
Author:        Daniel Lezcano <daniel.lezcano@linaro.org>
AuthorDate:    Tue, 22 Dec 2020 19:11:10 +01:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Tue, 19 Jan 2021 22:23:49 +01:00

thermal/core: Remove pointless thermal_zone_device_reset() function

The function thermal_zone_device_reset() is called in the
thermal_zone_device_register() which allocates and initialize the
structure. The passive field is already zero-ed by the allocation, the
function is useless.

Call directly thermal_zone_device_init() instead and
thermal_zone_device_reset().

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20201222181110.1231977-1-daniel.lezcano@linaro.org
---
 drivers/thermal/thermal_core.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index b261544..996c038 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -478,12 +478,6 @@ static void thermal_zone_device_init(struct thermal_zone_device *tz)
 		pos->initialized = false;
 }
 
-static void thermal_zone_device_reset(struct thermal_zone_device *tz)
-{
-	tz->passive = 0;
-	thermal_zone_device_init(tz);
-}
-
 static int thermal_zone_device_set_mode(struct thermal_zone_device *tz,
 					enum thermal_device_mode mode)
 {
@@ -1363,7 +1357,7 @@ thermal_zone_device_register(const char *type, int trips, int mask,
 
 	INIT_DELAYED_WORK(&tz->poll_queue, thermal_zone_device_check);
 
-	thermal_zone_device_reset(tz);
+	thermal_zone_device_init(tz);
 	/* Update the new thermal zone and mark it as already updated. */
 	if (atomic_cmpxchg(&tz->need_update, 1, 0))
 		thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);

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

end of thread, other threads:[~2021-01-19 21:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22 18:11 [PATCH] thermal/core: Remove pointless thermal_zone_device_reset() function Daniel Lezcano
2021-01-19 21:27 ` [thermal: thermal/next] " thermal-bot for Daniel Lezcano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.