HID: wiimote: fix weight conversion error for values > 17kg
Signed-off-by: Florian Echtler <floe@butterbrot.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
diff --git a/drivers/hid/hid-wiimote-ext.c b/drivers/hid/hid-wiimote-ext.c
index fc98cc9..bc85bf2 100644
--- a/drivers/hid/hid-wiimote-ext.c
+++ b/drivers/hid/hid-wiimote-ext.c
@@ -585,7 +585,8 @@
} else {
tmp = val[i] - ext->calib[i][1];
tmp *= 1700;
- tmp /= ext->calib[i][2] - ext->calib[i][1] + 1700;
+ tmp /= ext->calib[i][2] - ext->calib[i][1];
+ tmp += 1700;
}
val[i] = tmp;
}