aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid/hid-core.c
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2015-11-24 13:33:47 +0100
committerJiri Kosina <jkosina@suse.cz>2015-11-27 00:02:59 +0100
commit92529623d242cea4440958d7bcebdf291f4ab15e (patch)
tree642b9391e9d698fd623a640582264c7f33ba3042 /drivers/hid/usbhid/hid-core.c
parentHID: usbhid: discarded events don't abort idleness (diff)
downloadlinux-dev-92529623d242cea4440958d7bcebdf291f4ab15e.tar.xz
linux-dev-92529623d242cea4440958d7bcebdf291f4ab15e.zip
HID: debug: improve hid_debug_event()
The code in hid_debug_event() causes horrible code generation. First, we do a strlen() call for every byte we copy (we're doing a store to global memory, so gcc has no way of proving that strlen(buf) doesn't change). Second, since both i, list->tail and HID_DEBUG_BUFSIZE have signed type, the modulo computation has to take into account the possibility that list->tail+i is negative, so it's not just a simple and. Fix the former by simply not doing strlen() at all (we have to load buf[i] anyway, so testing it is almost free) and the latter by changing i to unsigned. This cuts 29% (69 bytes) of the size of the function. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/usbhid/hid-core.c')
0 files changed, 0 insertions, 0 deletions