Commit 3afbf023 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Stefan Bader

hid-sensor-hub.c: fix wrong do_div() usage

BugLink: https://bugs.launchpad.net/bugs/1826212

[ Upstream commit 8d43b49e ]

do_div() must only be used with a u64 dividend.
Signed-off-by: default avatarNicolas Pitre <nico@linaro.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 7ad16e03
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment