Re: [PATCH 1/3] HID: hid-lenovo-go-s: Fix signedness bug

From: Derek John Clark

Date: Fri Mar 06 2026 - 00:58:47 EST


On Fri, Feb 27, 2026 at 12:55 PM Ethan Tidmore <ethantidmore06@xxxxxxxxx> wrote:
>
> The function get_endpoint_address() returns type u8 but in its error
> path returns -ENODEV. Also, every variable that is assigned from this
> function is type int.
>
> Change return type to int from u8.
>
> Detected by Smatch:
> drivers/hid/hid-lenovo-go-s.c:391 get_endpoint_address() warn:
> signedness bug returning '(-19)'
>
> Fixes: 4325fdab5dbbf ("HID: hid-lenovo-go-s: Add Lenovo Legion Go S Series HID Driver")
> Signed-off-by: Ethan Tidmore <ethantidmore06@xxxxxxxxx>
> ---
> drivers/hid/hid-lenovo-go-s.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-lenovo-go-s.c b/drivers/hid/hid-lenovo-go-s.c
> index cacc5bd5ed2b..0ef98ba68d86 100644
> --- a/drivers/hid/hid-lenovo-go-s.c
> +++ b/drivers/hid/hid-lenovo-go-s.c
> @@ -377,7 +377,7 @@ static int hid_gos_set_event_return(struct command_report *cmd_rep)
> return 0;
> }
>
> -static u8 get_endpoint_address(struct hid_device *hdev)
> +static int get_endpoint_address(struct hid_device *hdev)
> {
> struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
> struct usb_host_endpoint *ep;
> --
> 2.53.0
>
Hmm, odd that I did this correctly in the Go driver.
Thanks.

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