Re: [PATCH 1/2] platform/x86: asus-wmi: Remove redundant condition
From: Ilpo Järvinen
Date: Tue Mar 31 2026 - 09:11:41 EST
On Thu, 26 Mar 2026, Ethan Tidmore wrote:
> The condition (ctrl_param >= 0) is always true because ctrl_param is an
> unsigned integer.
>
> Remove the redundant condition.
>
> Detected by Smatch:
> drivers/platform/x86/asus-wmi.c:4427 update_screenpad_bl_status() warn:
> always true condition '(ctrl_param >= 0) => (0-u32max >= 0)'
>
>
> Fixes: 034f5efd362fb ("platform/x86: asus-wmi: adjust screenpad power/brightness handling")
> Signed-off-by: Ethan Tidmore <ethantidmore06@xxxxxxxxx>
> ---
> drivers/platform/x86/asus-wmi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index 0b87214ddd1b..80144c412b90 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -4424,7 +4424,7 @@ static int update_screenpad_bl_status(struct backlight_device *bd)
> u32 ctrl_param = bd->props.brightness;
> int err = 0;
>
> - if (ctrl_param >= 0 && bd->props.power) {
> + if (bd->props.power) {
> err = asus_wmi_set_devstate(ASUS_WMI_DEVID_SCREENPAD_POWER, 1, NULL);
> if (err < 0)
> return err;
I've folded this into the original change.
--
i.