diff mbox series

[v1] thermal: Constify the trip argument of the .get_trend() zone callback

Message ID 5709115.DvuYhMxLoT@kreacher (mailing list archive)
State Mainlined, archived
Headers show
Series [v1] thermal: Constify the trip argument of the .get_trend() zone callback | expand

Commit Message

Rafael J. Wysocki Sept. 7, 2023, 6:18 p.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

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>
---
 drivers/acpi/thermal.c                             |    2 +-
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c |    3 ++-
 include/linux/thermal.h                            |    4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

Comments

Wilczynski, Michal Sept. 8, 2023, 8:25 a.m. UTC | #1
On 9/7/2023 8:18 PM, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> 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>
> ---
>  drivers/acpi/thermal.c                             |    2 +-
>  drivers/thermal/ti-soc-thermal/ti-thermal-common.c |    3 ++-
>  include/linux/thermal.h                            |    4 ++--
>  3 files changed, 5 insertions(+), 4 deletions(-)
>
> Index: linux-pm/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> +++ linux-pm/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> @@ -110,7 +110,8 @@ static inline int __ti_thermal_get_temp(
>  }
>  
>  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: linux-pm/include/linux/thermal.h
> ===================================================================
> --- linux-pm.orig/include/linux/thermal.h
> +++ linux-pm/include/linux/thermal.h
> @@ -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 *);
>  };
> Index: linux-pm/drivers/acpi/thermal.c
> ===================================================================
> --- linux-pm.orig/drivers/acpi/thermal.c
> +++ linux-pm/drivers/acpi/thermal.c
> @@ -531,7 +531,7 @@ static int thermal_get_temp(struct therm
>  }
>  
>  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);
>

Looks good to me,
Reviewed-by: Michal Wilczynski <michal.wilczynski@intel.com>

>
diff mbox series

Patch

Index: linux-pm/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
===================================================================
--- linux-pm.orig/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ linux-pm/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -110,7 +110,8 @@  static inline int __ti_thermal_get_temp(
 }
 
 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: linux-pm/include/linux/thermal.h
===================================================================
--- linux-pm.orig/include/linux/thermal.h
+++ linux-pm/include/linux/thermal.h
@@ -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 *);
 };
Index: linux-pm/drivers/acpi/thermal.c
===================================================================
--- linux-pm.orig/drivers/acpi/thermal.c
+++ linux-pm/drivers/acpi/thermal.c
@@ -531,7 +531,7 @@  static int thermal_get_temp(struct therm
 }
 
 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);