]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: stop exporting hid_snto32()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 3 Oct 2024 14:46:51 +0000 (07:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Sep 2025 16:58:04 +0000 (18:58 +0200)
commitd6cfa97a4d6f31b29a5c0994283d1e97ca6ba925
tree3342fd66cba4003252a8357a43f85d1bdcca6aaf
parent7a7ba33110698166b488a06cdc04a16ca3dba176
HID: stop exporting hid_snto32()

[ Upstream commit c653ffc283404a6c1c0e65143a833180c7ff799b ]

The only user of hid_snto32() is Logitech HID++ driver, which always
calls hid_snto32() with valid size (constant, either 12 or 8) and
therefore can simply use sign_extend32().

Make the switch and remove hid_snto32(). Move snto32() and s32ton() to
avoid introducing forward declaration.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://patch.msgid.link/20241003144656.3786064-2-dmitry.torokhov@gmail.com
[bentiss: fix checkpatch warning]
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Stable-dep-of: a6b87bfc2ab5 ("HID: core: Harden s32ton() against conversion to 0 bits")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-core.c
drivers/hid/hid-logitech-hidpp.c
include/linux/hid.h