From: Andrew Duggan <aduggan@synaptics.com>
To: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Andrew Duggan <aduggan@synaptics.com>,
Jiri Kosina <jkosina@suse.cz>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>
Subject: [PATCH] HID: rmi: Use hid_report_len to compute the size of reports
Date: Thu, 8 Jan 2015 14:51:36 -0800 [thread overview]
Message-ID: <1420757496-3955-3-git-send-email-aduggan@synaptics.com> (raw)
In-Reply-To: <1420757496-3955-1-git-send-email-aduggan@synaptics.com>
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(-)
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;
--
2.1.0
next prev parent reply other threads:[~2015-01-08 22:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 22:51 [PATCH v2 2/3] HID: rmi: Support touchpads with external buttons Andrew Duggan
2015-01-08 22:51 ` [PATCH v2 3/3] HID: rmi: Add support for the touchpad in the Razer Blade 14 laptop Andrew Duggan
2015-01-12 9:14 ` Jiri Kosina
2015-01-08 22:51 ` Andrew Duggan [this message]
2015-01-12 9:14 ` [PATCH] HID: rmi: Use hid_report_len to compute the size of reports Jiri Kosina
2015-01-12 9:14 ` [PATCH v2 2/3] HID: rmi: Support touchpads with external buttons Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420757496-3955-3-git-send-email-aduggan@synaptics.com \
--to=aduggan@synaptics.com \
--cc=benjamin.tissoires@redhat.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).