mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] thermal/drivers/int340x: Fix uninitialized trip_cnt variable
       [not found] <Y8/1ccQLn41w+Vek@kili>
@ 2023-01-24 16:31 ` Daniel Lezcano
  2023-01-24 16:41   ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Lezcano @ 2023-01-24 16:31 UTC (permalink / raw)
  To: rafael
  Cc: error27, Amit Kucheria, Zhang Rui, Srinivas Pandruvada,
	open list:THERMAL, open list

The conversion to the generic trip points missed to initializes the
extra trip points to zero in case the _PATC method is not found.

Set by default the trip_cnt to zero.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
index 7ff5d9b1c490..c113962a599e 100644
--- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
+++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
@@ -121,7 +121,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
 {
 	struct int34x_thermal_zone *int34x_thermal_zone;
 	acpi_status status;
-	unsigned long long trip_cnt;
+	unsigned long long trip_cnt = 0;
 	int trip_mask = 0;
 	int i, ret;
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] thermal/drivers/int340x: Fix uninitialized trip_cnt variable
  2023-01-24 16:31 ` [PATCH] thermal/drivers/int340x: Fix uninitialized trip_cnt variable Daniel Lezcano
@ 2023-01-24 16:41   ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2023-01-24 16:41 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: rafael, error27, Amit Kucheria, Zhang Rui, Srinivas Pandruvada,
	open list:THERMAL, open list

On Tue, Jan 24, 2023 at 5:35 PM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> The conversion to the generic trip points missed to initializes the
> extra trip points to zero in case the _PATC method is not found.

The _PATC name is incorrect.

> Set by default the trip_cnt to zero.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
>  drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
> index 7ff5d9b1c490..c113962a599e 100644
> --- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
> +++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
> @@ -121,7 +121,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
>  {
>         struct int34x_thermal_zone *int34x_thermal_zone;
>         acpi_status status;
> -       unsigned long long trip_cnt;
> +       unsigned long long trip_cnt = 0;
>         int trip_mask = 0;
>         int i, ret;
>
> --

I've just posted an equivalent fix and I prefer mine.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-24 16:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Y8/1ccQLn41w+Vek@kili>
2023-01-24 16:31 ` [PATCH] thermal/drivers/int340x: Fix uninitialized trip_cnt variable Daniel Lezcano
2023-01-24 16:41   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®