summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-sensor-hub.c
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2015-11-03 17:01:46 -0500
committerNicolas Pitre <nicolas.pitre@linaro.org>2015-11-16 12:39:55 -0500
commit8d43b49e7e0070f96ac46d30659a336c0224fa0b (patch)
tree8e9fb99e0a67ced9f6099c257eb8a8132236173a /drivers/hid/hid-sensor-hub.c
parent3db14288bcc1ef8b53c1ceef35d998530b630657 (diff)
hid-sensor-hub.c: fix wrong do_div() usage
do_div() must only be used with a u64 dividend. Signed-off-by: Nicolas Pitre <nico@linaro.org>
Diffstat (limited to 'drivers/hid/hid-sensor-hub.c')
-rw-r--r--drivers/hid/hid-sensor-hub.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index 92870cdb52d9..8efaa88329aa 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -218,7 +218,8 @@ int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
goto done_proc;
}
- remaining_bytes = do_div(buffer_size, sizeof(__s32));
+ remaining_bytes = buffer_size % sizeof(__s32);
+ buffer_size = buffer_size / sizeof(__s32);
if (buffer_size) {
for (i = 0; i < buffer_size; ++i) {
hid_set_field(report->field[field_index], i,