* [PATCH] asus-wmi: delete impossible condition
@ 2021-08-24 11:36 Dan Carpenter
2021-08-26 13:13 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-08-24 11:36 UTC (permalink / raw)
To: Corentin Chary, Luke D. Jones
Cc: Hans de Goede, Mark Gross, acpi4asus-user, platform-driver-x86,
kernel-janitors
The "asus->throttle_thermal_policy_mode" variable is a u8 so it can't
be negative. And we always verify that the value is valid before
setting the policy mode so there is no need to check again here.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/platform/x86/asus-wmi.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index cc5811844012..679429d41264 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -2179,9 +2179,6 @@ static int platform_profile_get(struct platform_profile_handler *pprof,
tp = asus->throttle_thermal_policy_mode;
- if (tp < 0)
- return tp;
-
switch (tp) {
case ASUS_THROTTLE_THERMAL_POLICY_DEFAULT:
*profile = PLATFORM_PROFILE_BALANCED;
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] asus-wmi: delete impossible condition
2021-08-24 11:36 [PATCH] asus-wmi: delete impossible condition Dan Carpenter
@ 2021-08-26 13:13 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2021-08-26 13:13 UTC (permalink / raw)
To: Dan Carpenter, Corentin Chary, Luke D. Jones
Cc: Mark Gross, acpi4asus-user, platform-driver-x86, kernel-janitors
Hi,
On 8/24/21 1:36 PM, Dan Carpenter wrote:
> The "asus->throttle_thermal_policy_mode" variable is a u8 so it can't
> be negative. And we always verify that the value is valid before
> setting the policy mode so there is no need to check again here.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thank you for your patch, I've applied this patch to my review-hans
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
> ---
> drivers/platform/x86/asus-wmi.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index cc5811844012..679429d41264 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -2179,9 +2179,6 @@ static int platform_profile_get(struct platform_profile_handler *pprof,
>
> tp = asus->throttle_thermal_policy_mode;
>
> - if (tp < 0)
> - return tp;
> -
> switch (tp) {
> case ASUS_THROTTLE_THERMAL_POLICY_DEFAULT:
> *profile = PLATFORM_PROFILE_BALANCED;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-26 13:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-24 11:36 [PATCH] asus-wmi: delete impossible condition Dan Carpenter
2021-08-26 13:13 ` Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).