From: Mathieu Magnaudet <mathieu.magnau...@gmail.com> 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.magnau...@enac.fr> Reviewed-by: Benjamin Tissoires <benjamin.tissoi...@gmail.com> Reviewed-by: David Herrmann <dh.herrm...@gmail.com> Signed-off-by: Jiri Kosina <jkos...@suse.cz> Signed-off-by: Jason Gerecke <killert...@gmail.com> --- 3.17/wacom_sys.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/3.17/wacom_sys.c b/3.17/wacom_sys.c index d523e91..8b841e5 100644 --- a/3.17/wacom_sys.c +++ b/3.17/wacom_sys.c @@ -1321,12 +1321,6 @@ static void wacom_calculate_res(struct wacom_features *features) features->unitExpo); } -static int wacom_hid_report_len(struct hid_report *report) -{ - /* equivalent to DIV_ROUND_UP(report->size, 8) + !!(report->id > 0) */ - return ((report->size - 1) >> 3) + 1 + (report->id > 0); -} - static size_t wacom_compute_pktlen(struct hid_device *hdev) { struct hid_report_enum *report_enum; @@ -1336,7 +1330,7 @@ static size_t wacom_compute_pktlen(struct hid_device *hdev) report_enum = hdev->report_enum + HID_INPUT_REPORT; list_for_each_entry(report, &report_enum->report_list, list) { - size_t report_size = wacom_hid_report_len(report); + size_t report_size = hid_report_len(report); if (report_size > size) size = report_size; } -- 2.1.3 ------------------------------------------------------------------------------ New Year. New Location. New Benefits. New Data Center in Ashburn, VA. GigeNET is offering a free month of service with a new server in Ashburn. Choose from 2 high performing configs, both with 100TB of bandwidth. Higher redundancy.Lower latency.Increased capacity.Completely compliant. www.gigenet.com _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel