thermal: Constify the trip argument of the .get_trend() zone callback
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 7 Sep 2023 18:18:56 +0000 (20:18 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 11 Sep 2023 15:16:40 +0000 (17:16 +0200)
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>
drivers/acpi/thermal.c
drivers/thermal/ti-soc-thermal/ti-thermal-common.c
include/linux/thermal.h

index f14e682..312730f 100644 (file)
@@ -492,7 +492,7 @@ static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
 }
 
 static int thermal_get_trend(struct thermal_zone_device *thermal,
-                            struct thermal_trip *trip,
+                            const struct thermal_trip *trip,
                             enum thermal_trend *trend)
 {
        struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
index 6ba2613..0cf0826 100644 (file)
@@ -110,7 +110,8 @@ static inline int __ti_thermal_get_temp(struct thermal_zone_device *tz, int *tem
 }
 
 static int __ti_thermal_get_trend(struct thermal_zone_device *tz,
-                                 struct thermal_trip *trip, enum thermal_trend *trend)
+                                 const struct thermal_trip *trip,
+                                 enum thermal_trend *trend)
 {
        struct ti_thermal_data *data = thermal_zone_device_priv(tz);
        struct ti_bandgap *bgp;
index c99440a..a5ae4af 100644 (file)
@@ -80,8 +80,8 @@ struct thermal_zone_device_ops {
        int (*set_trip_hyst) (struct thermal_zone_device *, int, int);
        int (*get_crit_temp) (struct thermal_zone_device *, int *);
        int (*set_emul_temp) (struct thermal_zone_device *, int);
-       int (*get_trend) (struct thermal_zone_device *, struct thermal_trip *,
-                         enum thermal_trend *);
+       int (*get_trend) (struct thermal_zone_device *,
+                         const struct thermal_trip *, enum thermal_trend *);
        void (*hot)(struct thermal_zone_device *);
        void (*critical)(struct thermal_zone_device *);
 };