From: Florian Echtler Date: Mon, 17 Sep 2012 19:15:40 +0000 (+0200) Subject: HID: wiimote: fix weight conversion error for values > 17kg X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a2f6e4e009f13097acafd09cccf274fb5869dde2;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git HID: wiimote: fix weight conversion error for values > 17kg Signed-off-by: Florian Echtler Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-wiimote-ext.c b/drivers/hid/hid-wiimote-ext.c index fc98cc9ed42..bc85bf29062 100644 --- a/drivers/hid/hid-wiimote-ext.c +++ b/drivers/hid/hid-wiimote-ext.c @@ -585,7 +585,8 @@ static void handler_balance_board(struct wiimote_ext *ext, const __u8 *payload) } 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; }