diff mbox

HID: rmi: Use hid_report_len to compute the size of reports

Message ID 1420757496-3955-3-git-send-email-aduggan@synaptics.com (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

Andrew Duggan Jan. 8, 2015, 10:51 p.m. UTC
Now that hid_report_len is in hid.h we can use this function instead of
duplicating the code which computes it.

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
---
 drivers/hid/hid-rmi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Jiri Kosina Jan. 12, 2015, 9:14 a.m. UTC | #1
On Thu, 8 Jan 2015, Andrew Duggan wrote:

> Now that hid_report_len is in hid.h we can use this function instead of
> duplicating the code which computes it.
> 
> Signed-off-by: Andrew Duggan <aduggan@synaptics.com>

Applied to for-3.20/rmi.
diff mbox

Patch

diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c
index b08774a..49d4fe4 100644
--- a/drivers/hid/hid-rmi.c
+++ b/drivers/hid/hid-rmi.c
@@ -1025,7 +1025,7 @@  static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
 		goto start;
 	}
 
-	data->input_report_size = (input_report->size >> 3) + 1 /* report id */;
+	data->input_report_size = hid_report_len(input_report);
 
 	if (!rmi_check_valid_report_id(hdev, HID_OUTPUT_REPORT,
 	    RMI_WRITE_REPORT_ID, &output_report)) {
@@ -1034,8 +1034,7 @@  static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id)
 		goto start;
 	}
 
-	data->output_report_size = (output_report->size >> 3)
-					+ 1 /* report id */;
+	data->output_report_size = hid_report_len(output_report);
 
 	data->device_flags |= RMI_DEVICE;
 	alloc_size = data->output_report_size + data->input_report_size;