Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+5 -4
+1 -1
drivers/acpi/thermal.c
··· 492 492 } 493 493 494 494 static int thermal_get_trend(struct thermal_zone_device *thermal, 495 - struct thermal_trip *trip, 495 + const struct thermal_trip *trip, 496 496 enum thermal_trend *trend) 497 497 { 498 498 struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
+2 -1
drivers/thermal/ti-soc-thermal/ti-thermal-common.c
··· 110 110 } 111 111 112 112 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) 114 115 { 115 116 struct ti_thermal_data *data = thermal_zone_device_priv(tz); 116 117 struct ti_bandgap *bgp;
+2 -2
include/linux/thermal.h
··· 80 80 int (*set_trip_hyst) (struct thermal_zone_device *, int, int); 81 81 int (*get_crit_temp) (struct thermal_zone_device *, int *); 82 82 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 *); 85 85 void (*hot)(struct thermal_zone_device *); 86 86 void (*critical)(struct thermal_zone_device *); 87 87 };