mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ethan Tidmore <ethantidmore06@gmail.com>
To: "Corentin Chary" <corentin.chary@gmail.com>,
	"Luke D . Jones" <luke@ljones.dev>,
	"Denis Benato" <denis.benato@linux.dev>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Ethan Tidmore <ethantidmore06@gmail.com>
Subject: [PATCH 1/2] platform/x86: asus-wmi: Remove redundant condition
Date: Thu, 26 Mar 2026 18:11:53 -0500	[thread overview]
Message-ID: <20260326231154.856729-2-ethantidmore06@gmail.com> (raw)
In-Reply-To: <20260326231154.856729-1-ethantidmore06@gmail.com>

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;
-- 
2.53.0


  reply	other threads:[~2026-03-26 23:12 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 ` Ethan Tidmore [this message]
2026-03-31 13:07   ` [PATCH 1/2] platform/x86: asus-wmi: Remove redundant condition Ilpo Järvinen
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=20260326231154.856729-2-ethantidmore06@gmail.com \
    --to=ethantidmore06@gmail.com \
    --cc=corentin.chary@gmail.com \
    --cc=denis.benato@linux.dev \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --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®