]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
thermal: cooling: Remove unused variable *tz
authorzhuguangqing <zhuguangqing@xiaomi.com>
Mon, 14 Sep 2020 07:11:01 +0000 (15:11 +0800)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 12 Oct 2020 10:08:36 +0000 (12:08 +0200)
1. devfreq_cooling.c: The variable *tz is not used in
devfreq_cooling_get_requested_power(), devfreq_cooling_state2power()
and devfreq_cooling_power2state().

2. cpufreq_cooling.c: After 84fe2cab48590, the variable *tz is not used
anymore in cpufreq_get_requested_power(), cpufreq_state2power() and
cpufreq_power2state().

Remove the variable *tz.

Signed-off-by: zhuguangqing <zhuguangqing@xiaomi.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200914071101.13575-1-zhuguangqing83@gmail.com
drivers/thermal/cpufreq_cooling.c
drivers/thermal/devfreq_cooling.c
drivers/thermal/gov_power_allocator.c
drivers/thermal/thermal_core.c
drivers/thermal/thermal_core.h
include/linux/thermal.h

index 6cf23a54e85366bdaa5138c1c0167a07de8a7229..cc2959f22f01a90394dd06b7d51374615894b032 100644 (file)
@@ -182,7 +182,6 @@ static u32 get_dynamic_power(struct cpufreq_cooling_device *cpufreq_cdev,
 /**
  * cpufreq_get_requested_power() - get the current power
  * @cdev:      &thermal_cooling_device pointer
- * @tz:                a valid thermal zone device pointer
  * @power:     pointer in which to store the resulting power
  *
  * Calculate the current power consumption of the cpus in milliwatts
@@ -203,7 +202,6 @@ static u32 get_dynamic_power(struct cpufreq_cooling_device *cpufreq_cdev,
  * Return: 0 on success, -E* if getting the static power failed.
  */
 static int cpufreq_get_requested_power(struct thermal_cooling_device *cdev,
-                                      struct thermal_zone_device *tz,
                                       u32 *power)
 {
        unsigned long freq;
@@ -253,7 +251,6 @@ static int cpufreq_get_requested_power(struct thermal_cooling_device *cdev,
 /**
  * cpufreq_state2power() - convert a cpu cdev state to power consumed
  * @cdev:      &thermal_cooling_device pointer
- * @tz:                a valid thermal zone device pointer
  * @state:     cooling device state to be converted
  * @power:     pointer in which to store the resulting power
  *
@@ -266,7 +263,6 @@ static int cpufreq_get_requested_power(struct thermal_cooling_device *cdev,
  * when calculating the static power.
  */
 static int cpufreq_state2power(struct thermal_cooling_device *cdev,
-                              struct thermal_zone_device *tz,
                               unsigned long state, u32 *power)
 {
        unsigned int freq, num_cpus, idx;
@@ -288,7 +284,6 @@ static int cpufreq_state2power(struct thermal_cooling_device *cdev,
 /**
  * cpufreq_power2state() - convert power to a cooling device state
  * @cdev:      &thermal_cooling_device pointer
- * @tz:                a valid thermal zone device pointer
  * @power:     power in milliwatts to be converted
  * @state:     pointer in which to store the resulting state
  *
@@ -306,8 +301,7 @@ static int cpufreq_state2power(struct thermal_cooling_device *cdev,
  * device.
  */
 static int cpufreq_power2state(struct thermal_cooling_device *cdev,
-                              struct thermal_zone_device *tz, u32 power,
-                              unsigned long *state)
+                              u32 power, unsigned long *state)
 {
        unsigned int target_freq;
        u32 last_load, normalised_power;
index a12d2909622956d9ab2373abe7f4e663372a35a4..dfab49a672529d563ff8fbb81b5c4fd27e657f87 100644 (file)
@@ -229,7 +229,6 @@ static inline unsigned long get_total_power(struct devfreq_cooling_device *dfc,
 
 
 static int devfreq_cooling_get_requested_power(struct thermal_cooling_device *cdev,
-                                              struct thermal_zone_device *tz,
                                               u32 *power)
 {
        struct devfreq_cooling_device *dfc = cdev->devdata;
@@ -289,7 +288,6 @@ fail:
 }
 
 static int devfreq_cooling_state2power(struct thermal_cooling_device *cdev,
-                                      struct thermal_zone_device *tz,
                                       unsigned long state,
                                       u32 *power)
 {
@@ -308,7 +306,6 @@ static int devfreq_cooling_state2power(struct thermal_cooling_device *cdev,
 }
 
 static int devfreq_cooling_power2state(struct thermal_cooling_device *cdev,
-                                      struct thermal_zone_device *tz,
                                       u32 power, unsigned long *state)
 {
        struct devfreq_cooling_device *dfc = cdev->devdata;
index 5cb518d8f1562573425ab498ee1f7cd164c7815f..ab0be26f0816960aff154d33494cc7d0ebd1b0f0 100644 (file)
@@ -96,7 +96,7 @@ static u32 estimate_sustainable_power(struct thermal_zone_device *tz)
                if (instance->trip != params->trip_max_desired_temperature)
                        continue;
 
-               if (power_actor_get_min_power(cdev, tz, &min_power))
+               if (power_actor_get_min_power(cdev, &min_power))
                        continue;
 
                sustainable_power += min_power;
@@ -388,7 +388,7 @@ static int allocate_power(struct thermal_zone_device *tz,
                if (!cdev_is_power_actor(cdev))
                        continue;
 
-               if (cdev->ops->get_requested_power(cdev, tz, &req_power[i]))
+               if (cdev->ops->get_requested_power(cdev, &req_power[i]))
                        continue;
 
                if (!total_weight)
@@ -398,7 +398,7 @@ static int allocate_power(struct thermal_zone_device *tz,
 
                weighted_req_power[i] = frac_to_int(weight * req_power[i]);
 
-               if (power_actor_get_max_power(cdev, tz, &max_power[i]))
+               if (power_actor_get_max_power(cdev, &max_power[i]))
                        continue;
 
                total_req_power += req_power[i];
index 49ae4a61cbe60f8df1ef6777285f73e23fb3df19..c6d74bc1c90bb8be4ae2ee91e774281d1616c0c8 100644 (file)
@@ -603,7 +603,6 @@ static void thermal_zone_device_check(struct work_struct *work)
 /**
  * power_actor_get_max_power() - get the maximum power that a cdev can consume
  * @cdev:      pointer to &thermal_cooling_device
- * @tz:                a valid thermal zone device pointer
  * @max_power: pointer in which to store the maximum power
  *
  * Calculate the maximum power consumption in milliwats that the
@@ -613,18 +612,17 @@ static void thermal_zone_device_check(struct work_struct *work)
  * power_actor API or -E* on other error.
  */
 int power_actor_get_max_power(struct thermal_cooling_device *cdev,
-                             struct thermal_zone_device *tz, u32 *max_power)
+                             u32 *max_power)
 {
        if (!cdev_is_power_actor(cdev))
                return -EINVAL;
 
-       return cdev->ops->state2power(cdev, tz, 0, max_power);
+       return cdev->ops->state2power(cdev, 0, max_power);
 }
 
 /**
  * power_actor_get_min_power() - get the mainimum power that a cdev can consume
  * @cdev:      pointer to &thermal_cooling_device
- * @tz:                a valid thermal zone device pointer
  * @min_power: pointer in which to store the minimum power
  *
  * Calculate the minimum power consumption in milliwatts that the
@@ -634,7 +632,7 @@ int power_actor_get_max_power(struct thermal_cooling_device *cdev,
  * power_actor API or -E* on other error.
  */
 int power_actor_get_min_power(struct thermal_cooling_device *cdev,
-                             struct thermal_zone_device *tz, u32 *min_power)
+                             u32 *min_power)
 {
        unsigned long max_state;
        int ret;
@@ -646,7 +644,7 @@ int power_actor_get_min_power(struct thermal_cooling_device *cdev,
        if (ret)
                return ret;
 
-       return cdev->ops->state2power(cdev, tz, max_state, min_power);
+       return cdev->ops->state2power(cdev, max_state, min_power);
 }
 
 /**
@@ -670,7 +668,7 @@ int power_actor_set_power(struct thermal_cooling_device *cdev,
        if (!cdev_is_power_actor(cdev))
                return -EINVAL;
 
-       ret = cdev->ops->power2state(cdev, instance->tz, power, &state);
+       ret = cdev->ops->power2state(cdev, power, &state);
        if (ret)
                return ret;
 
index e00fc5585ea805680c56e0dd1a029fae41f965dd..764c2de317711a2ab91cd220fd410442e30a0f29 100644 (file)
@@ -66,9 +66,9 @@ static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev)
 }
 
 int power_actor_get_max_power(struct thermal_cooling_device *cdev,
-                             struct thermal_zone_device *tz, u32 *max_power);
+                             u32 *max_power);
 int power_actor_get_min_power(struct thermal_cooling_device *cdev,
-                             struct thermal_zone_device *tz, u32 *min_power);
+                             u32 *min_power);
 int power_actor_set_power(struct thermal_cooling_device *cdev,
                          struct thermal_instance *ti, u32 power);
 /**
index 42b69d4072a4b07446b32ba786be529bc084baad..d07ea27e72a9438990e05882e5c2d8f7e8f17637 100644 (file)
@@ -85,12 +85,9 @@ struct thermal_cooling_device_ops {
        int (*get_max_state) (struct thermal_cooling_device *, unsigned long *);
        int (*get_cur_state) (struct thermal_cooling_device *, unsigned long *);
        int (*set_cur_state) (struct thermal_cooling_device *, unsigned long);
-       int (*get_requested_power)(struct thermal_cooling_device *,
-                                  struct thermal_zone_device *, u32 *);
-       int (*state2power)(struct thermal_cooling_device *,
-                          struct thermal_zone_device *, unsigned long, u32 *);
-       int (*power2state)(struct thermal_cooling_device *,
-                          struct thermal_zone_device *, u32, unsigned long *);
+       int (*get_requested_power)(struct thermal_cooling_device *, u32 *);
+       int (*state2power)(struct thermal_cooling_device *, unsigned long, u32 *);
+       int (*power2state)(struct thermal_cooling_device *, u32, unsigned long *);
 };
 
 struct thermal_cooling_device {