From: Ethan Tidmore <ethantidmore06@gmail.com>
To: "Derek J . Clark" <derekjohn.clark@gmail.com>,
Mark Pearson <mpearson-lenovo@squebb.ca>,
Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <bentiss@kernel.org>,
Mario Limonciello <mario.limonciello@amd.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Ethan Tidmore <ethantidmore06@gmail.com>
Subject: [PATCH 2/3] HID: hid-lenovo-go-s: Remove impossible condition
Date: Fri, 27 Feb 2026 14:54:43 -0600 [thread overview]
Message-ID: <20260227205444.1083103-3-ethantidmore06@gmail.com> (raw)
In-Reply-To: <20260227205444.1083103-1-ethantidmore06@gmail.com>
The variable val is of type u8, so it can only be 0-255.
Remove this condition.
Detected by Smatch:
drivers/hid/hid-lenovo-go-s.c:508 gamepad_property_store() warn:
impossible condition '(val > 255) => (0-255 > 255)'
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
---
drivers/hid/hid-lenovo-go-s.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/hid/hid-lenovo-go-s.c b/drivers/hid/hid-lenovo-go-s.c
index 0ef98ba68d86..a24737170f83 100644
--- a/drivers/hid/hid-lenovo-go-s.c
+++ b/drivers/hid/hid-lenovo-go-s.c
@@ -504,9 +504,6 @@ static ssize_t gamepad_property_store(struct device *dev,
ret = kstrtou8(buf, 10, &val);
if (ret)
return ret;
-
- if (val < 0 || val > 255)
- return -EINVAL;
break;
case FEATURE_IMU_ENABLE:
ret = sysfs_match_string(feature_enabled_text, buf);
--
2.53.0
next prev parent reply other threads:[~2026-02-27 20:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 20:54 [PATCH 0/3] HID: hid-lenovo-go-s: Multiple bug fixes Ethan Tidmore
2026-02-27 20:54 ` [PATCH 1/3] HID: hid-lenovo-go-s: Fix signedness bug Ethan Tidmore
2026-03-06 5:57 ` Derek John Clark
2026-02-27 20:54 ` Ethan Tidmore [this message]
2026-03-06 5:57 ` [PATCH 2/3] HID: hid-lenovo-go-s: Remove impossible condition Derek John Clark
2026-02-27 20:54 ` [PATCH 3/3] HID: hid-lenovo-go-s: Fix positive promotion bug Ethan Tidmore
2026-03-06 5:57 ` Derek John Clark
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=20260227205444.1083103-3-ethantidmore06@gmail.com \
--to=ethantidmore06@gmail.com \
--cc=bentiss@kernel.org \
--cc=derekjohn.clark@gmail.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mpearson-lenovo@squebb.ca \
/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