Re: [PATCH 2/3] HID: hid-lenovo-go-s: Remove impossible condition

From: Derek John Clark

Date: Fri Mar 06 2026 - 00:59:42 EST


On Fri, Feb 27, 2026 at 12:55 PM Ethan Tidmore <ethantidmore06@xxxxxxxxx> wrote:
>
> 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@xxxxxxxxx>
> ---
> 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
>

Reviewed-by: Derek J. Clark <derekjohn.clark@xxxxxxxxx>