Skip to content

Commit ebc7abb

Browse files
committed
thermal: Constify the trip argument of the .get_trend() zone callback
Add 'const' to the definition of the 'trip' argument of the .get_trend() thermal zone callback to indicate that the trip point passed to it should not be modified by it and adjust the callback functions implementing it, thermal_get_trend() in the ACPI thermal driver and __ti_thermal_get_trend(), accordingly. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Michal Wilczynski <michal.wilczynski@intel.com>
1 parent 8a81cf9 commit ebc7abb

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

drivers/acpi/thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
492492
}
493493

494494
static int thermal_get_trend(struct thermal_zone_device *thermal,
495-
struct thermal_trip *trip,
495+
const struct thermal_trip *trip,
496496
enum thermal_trend *trend)
497497
{
498498
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);

drivers/thermal/ti-soc-thermal/ti-thermal-common.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ static inline int __ti_thermal_get_temp(struct thermal_zone_device *tz, int *tem
110110
}
111111

112112
static int __ti_thermal_get_trend(struct thermal_zone_device *tz,
113-
struct thermal_trip *trip, enum thermal_trend *trend)
113+
const struct thermal_trip *trip,
114+
enum thermal_trend *trend)
114115
{
115116
struct ti_thermal_data *data = thermal_zone_device_priv(tz);
116117
struct ti_bandgap *bgp;

include/linux/thermal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ struct thermal_zone_device_ops {
8080
int (*set_trip_hyst) (struct thermal_zone_device *, int, int);
8181
int (*get_crit_temp) (struct thermal_zone_device *, int *);
8282
int (*set_emul_temp) (struct thermal_zone_device *, int);
83-
int (*get_trend) (struct thermal_zone_device *, struct thermal_trip *,
84-
enum thermal_trend *);
83+
int (*get_trend) (struct thermal_zone_device *,
84+
const struct thermal_trip *, enum thermal_trend *);
8585
void (*hot)(struct thermal_zone_device *);
8686
void (*critical)(struct thermal_zone_device *);
8787
};

0 commit comments

Comments
 (0)