From patchwork Mon Sep 17 19:15:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Echtler X-Patchwork-Id: 1469331 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 37B94DF2D8 for ; Mon, 17 Sep 2012 19:15:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932476Ab2IQTPq (ORCPT ); Mon, 17 Sep 2012 15:15:46 -0400 Received: from butterbrot.org ([176.9.106.16]:36246 "EHLO butterbrot.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932417Ab2IQTPq (ORCPT ); Mon, 17 Sep 2012 15:15:46 -0400 Received: from localhost (localhost [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by butterbrot.org (Postfix) with ESMTPS id 264CDC002A0; Mon, 17 Sep 2012 21:15:40 +0200 (CEST) Date: Mon, 17 Sep 2012 21:15:40 +0200 (CEST) From: Florian Echtler X-X-Sender: floe@butterbrot To: linux-input@vger.kernel.org cc: jkosina@suse.cz, dh.herrmann@googlemail.com Subject: [PATCH] HID: wiimote: fix weight conversion error for values > 17kg Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Signed-Off-By: Florian Echtler Signed-off-by: David Herrmann --- drivers/hid/hid-wiimote-ext.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 @@ 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; }