]> git.ipfire.org Git - thirdparty/linux.git/commit
HID: lenovo-go: drop dead NULL check on to_usb_interface()
authorLouis Clinckx <clinckx.louis@gmail.com>
Fri, 15 May 2026 14:57:40 +0000 (14:57 +0000)
committerBenjamin Tissoires <bentiss@kernel.org>
Thu, 21 May 2026 15:12:54 +0000 (17:12 +0200)
commitda7f96a68c39de9eb1c351a261e7fbf716375c91
treea2ab39e7d2114c2dc7a412d45add729dd874e225
parent2ee7e632405b022319f42c01635eb6fbbd86414a
HID: lenovo-go: drop dead NULL check on to_usb_interface()

to_usb_interface() is a container_of_const() macro: it performs
pointer arithmetic and never returns NULL. The if (!intf) and if
(intf) tests in get_endpoint_address() can never fire. Remove them
in both drivers.

No functional change.

Suggested-by: Derek J. Clark <derekjohn.clark@gmail.com>
Signed-off-by: Louis Clinckx <clinckx.louis@gmail.com>
Reviewed-by: Derek J. Clark <derekjoh.clark@gmail.com>
Tested-by: Derek J. Clark <derekjohn.clark@gmail.com>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/hid-lenovo-go-s.c
drivers/hid/hid-lenovo-go.c