aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSimon Budig <simon@budig.de>2007-03-12 13:52:04 +0100
committerJiri Kosina <jkosina@suse.cz>2007-04-11 10:36:36 +0200
commit46386b587086c8d2698222a031bf749688464032 (patch)
tree47eba4258864a9f34801fda490a7602b4ba90ebb /fs
parentLinux 2.6.21-rc6 (diff)
downloadlinux-dev-46386b587086c8d2698222a031bf749688464032.tar.xz
linux-dev-46386b587086c8d2698222a031bf749688464032.zip
HID: introduce proper zeroing of unused bits in output reports
Some HID devices are looking on the unused bits in the HID reports they receive. This is violating the specification, but we want to make those devices work. Well-behaving devices are unaffected, as they don't care about the unused bits. If bitsused % 8 is 0 all bits in data[] get used and we don't need to clear anything. Otherwise (bitsused % 8) bits of the last byte get used. By shifting 1 for (bitsused % 8) bits and subtracting 1 we create a mask consisting of (bitsused % 8) ones and remaining zeroes. By ANDing we clear the upper unused bits. Signed-off-by: Simon Budig <simon@budig.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions