summaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid
diff options
context:
space:
mode:
authorMathieu Magnaudet <mathieu.magnaudet@gmail.com>2014-11-27 16:02:36 +0100
committerJiri Kosina <jkosina@suse.cz>2014-12-01 21:34:17 +0100
commitdabb05c6670e6e4415d7b56cd5864a5dbd90207f (patch)
treeca80d7c8cf44f32bb0c870855ae87452c8a004c3 /drivers/hid/usbhid
parentHID: multitouch: Add quirk for VTL touch panels (diff)
downloadlinux-dabb05c6670e6e4415d7b56cd5864a5dbd90207f.tar.xz
linux-dabb05c6670e6e4415d7b56cd5864a5dbd90207f.zip
HID: make hid_report_len as a static inline function in hid.h
In several hid drivers it is necessary to calculate the length of an hid_report. This patch exports the existing static function hid_report_len of hid-core.c as an inline function in hid.h Signed-off-by: Mathieu Magnaudet <mathieu.magnaudet@enac.fr> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/usbhid')
-rw-r--r--drivers/hid/usbhid/hid-core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index ca6849a0121e..b6cb7a5e4b27 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -338,8 +338,7 @@ static int hid_submit_out(struct hid_device *hid)
report = usbhid->out[usbhid->outtail].report;
raw_report = usbhid->out[usbhid->outtail].raw_report;
- usbhid->urbout->transfer_buffer_length = ((report->size - 1) >> 3) +
- 1 + (report->id > 0);
+ usbhid->urbout->transfer_buffer_length = hid_report_len(report);
usbhid->urbout->dev = hid_to_usb_dev(hid);
if (raw_report) {
memcpy(usbhid->outbuf, raw_report,