From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Ethan Tidmore <ethantidmore06@gmail.com>
Cc: Corentin Chary <corentin.chary@gmail.com>,
"Luke D . Jones" <luke@ljones.dev>,
Denis Benato <denis.benato@linux.dev>,
Hans de Goede <hansg@kernel.org>,
platform-driver-x86@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] platform/x86: asus-wmi: Remove redundant condition
Date: Tue, 31 Mar 2026 16:07:45 +0300 (EEST) [thread overview]
Message-ID: <faafc737-d420-5de8-f6c5-1835094da093@linux.intel.com> (raw)
In-Reply-To: <20260326231154.856729-2-ethantidmore06@gmail.com>
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@gmail.com>
> ---
> 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.
next prev parent reply other threads:[~2026-03-31 13:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 23:11 [PATCH 0/2] platform/x86: asus-wmi: Clean up asus_wmi_set_devstate() Ethan Tidmore
2026-03-26 23:11 ` [PATCH 1/2] platform/x86: asus-wmi: Remove redundant condition Ethan Tidmore
2026-03-31 13:07 ` Ilpo Järvinen [this message]
2026-03-26 23:11 ` [PATCH 2/2] platform/x86: asus-wmi: Refactor control flow Ethan Tidmore
2026-03-31 13:07 ` Ilpo Järvinen
2026-03-26 23:14 ` [PATCH 0/2] platform/x86: asus-wmi: Clean up asus_wmi_set_devstate() Ethan Tidmore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=faafc737-d420-5de8-f6c5-1835094da093@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=corentin.chary@gmail.com \
--cc=denis.benato@linux.dev \
--cc=ethantidmore06@gmail.com \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luke@ljones.dev \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®