[PATCH v1 16/17] thermal/drivers/acerhdf: Remove pointless governor test

Daniel Lezcano posted 17 patches 1 year, 8 months ago
There is a newer version of this series
[PATCH v1 16/17] thermal/drivers/acerhdf: Remove pointless governor test
Posted by Daniel Lezcano 1 year, 8 months ago
The thermal zone parameter specifies the bang-bang governor.

The Kconfig selects the bang-bang governor. So it is pointless to test
if the governor was set for the thermal zone assuming it may not have
been compiled-in.

Remove the test and prevent another access into the thermal internals.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/platform/x86/acerhdf.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
index 61f1c3090867..71b9c1f922d9 100644
--- a/drivers/platform/x86/acerhdf.c
+++ b/drivers/platform/x86/acerhdf.c
@@ -697,13 +697,6 @@ static int __init acerhdf_register_thermal(void)
 	if (ret)
 		return ret;
 
-	if (strcmp(thz_dev->governor->name,
-				acerhdf_zone_params.governor_name)) {
-		pr_err("Didn't get thermal governor %s, perhaps not compiled into thermal subsystem.\n",
-				acerhdf_zone_params.governor_name);
-		return -EINVAL;
-	}
-
 	return 0;
 }
 
-- 
2.34.1
Re: [PATCH v1 16/17] thermal/drivers/acerhdf: Remove pointless governor test
Posted by Peter Kästle 1 year, 8 months ago
19. Februar 2023 15:38, "Daniel Lezcano" <daniel.lezcano@linaro.org> schrieb:

> The thermal zone parameter specifies the bang-bang governor.
> 
> The Kconfig selects the bang-bang governor. So it is pointless to test
> if the governor was set for the thermal zone assuming it may not have
> been compiled-in.
> 
> Remove the test and prevent another access into the thermal internals.
> 
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

Acked-by: Peter Kaestle <peter@piie.net>


> ---
> drivers/platform/x86/acerhdf.c | 7 -------
> 1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
> index 61f1c3090867..71b9c1f922d9 100644
> --- a/drivers/platform/x86/acerhdf.c
> +++ b/drivers/platform/x86/acerhdf.c
> @@ -697,13 +697,6 @@ static int __init acerhdf_register_thermal(void)
> if (ret)
> return ret;
> 
> - if (strcmp(thz_dev->governor->name,
> - acerhdf_zone_params.governor_name)) {
> - pr_err("Didn't get thermal governor %s, perhaps not compiled into thermal subsystem.\n",
> - acerhdf_zone_params.governor_name);
> - return -EINVAL;
> - }
> -
> return 0;
> }
> 
> -- 
> 2.34.1