Skip to content

Commit

Permalink
HID: wiimote: fix weight conversion error for values > 17kg
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Echtler <floe@butterbrot.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Florian Echtler authored and Jiri Kosina committed Sep 18, 2012
1 parent 3155a09 commit a2f6e4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hid/hid-wiimote-ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit a2f6e4e

Please sign in to comment.